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

Support for exim SMTP (and also refresh token expiry) #16

Open
clarified opened this issue Feb 18, 2023 · 7 comments
Open

Support for exim SMTP (and also refresh token expiry) #16

clarified opened this issue Feb 18, 2023 · 7 comments

Comments

@clarified
Copy link

Hello again,

I use exim for my outgoing email, and it does not (yet?) support OAUTH natively.
I have now got it working with pretty much a 5 line gawk script, although there is a little more to it than that.

I started with exim4-oauth2 but that didn't work, and I don't understand how it could ever have worked, but adapted that approach for use with M365-IMAP.

You give instructions for msmtp. Would you like me to provide the instructions for exim as well?

In the course of getting exim to work with MS oauth, I came across a a statement from MS that refresh tokens expire after 90 days. You don't seem to allow for that: have I missed something?

I am planning to arrange to renew the refresh token every month or two in my gawk script, but
haven't done that yet.

@goomens
Copy link
Member

goomens commented Feb 19, 2023

Yes, I think that would be useful! I'm not sure how refresh token expiry works in practice but renewing the token every so often is probably a good idea in any case.

@clarified
Copy link
Author

I have now uploaded my project to github:
oauth2ForExim.

It is designed to be used alongside M365-IMAP although it can be used independently.
It caches both the refresh and access tokens. And looks after refresh token expiry by
renewing the refresh token periodically. Currently roughly once a month.

The README.md file gives more detail.

@clarified
Copy link
Author

s/github/gitlab/g !!

@clarified
Copy link
Author

I just encountered refresh token expiry in my .offlinimaprc file for the first time. Fortunately I had a current refresh token cached in oauth2ForExim, so it was trivial to copy for offlineimaprc. offlineimap ddin't give a very clear message.

@chris001
Copy link

Ideally, the code should try to detect xoauth2 login failure, and catch when the reason is expired token, renew it, and try again!

@clarified
Copy link
Author

clarified commented Apr 22, 2023 via email

@clarified
Copy link
Author

Please ignore my previous comment :-) I replied to the email copy without the context, and now realise that it was about M365-IMAP and not about oauthForExim.

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

3 participants