Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send from MFA organisational accounts #70

Open
shemraz opened this issue May 3, 2024 · 3 comments
Open

Send from MFA organisational accounts #70

shemraz opened this issue May 3, 2024 · 3 comments

Comments

@shemraz
Copy link

shemraz commented May 3, 2024

As a big fan of the charmbracelet ecosystem, I am so excited to see pop 😄

Would the ability to send mail from an institutional Outlook address be at all achievable?

@maaslalani
Copy link
Contributor

Hey @shemraz, thanks for opening the issue. I haven't looked into institutional Outlook at all but is it possible to send email with SMTP using your account, if so then it should definitely be possible.

Alternatively, if there's some sort of API key that you can use, we could hook into that.

@shemraz
Copy link
Author

shemraz commented May 4, 2024

Hey @maaslalani !

I've tried sending an email using my institutional Outlook account, but it throws with this error:
freeze

I'm certain I have all the POP_SMTP_* env vars set correctly. I also tested it with my personal Outlook account and it worked like a charm. I assume the error is because my organisation/Office365 requires an OAuth connection.

I'm not too familiar with this sort of stuff, but you may find the Microsoft Graph Outlook Mail API useful. See also sendMail action and Microsoft Graph SDK for Go which looks promising!

@shemraz
Copy link
Author

shemraz commented May 4, 2024

There was some discussion about adding this to go-simple-mail but I don't think this has been taken further. However, go-mail fully supports XOAUTH2. See SMTPAuthType in the go-mail documentation.

Perhaps pop could have an --auth.method flag and use the go-mail API to handle XOAUTH2 requests? This may be simpler than having pop itself handling authentication via the Microsoft Graph API. Looks achievable! Would love to help in any way that I can, although my Go knowledge is limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants