LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Fetching mail from an office365 server (https://www.linuxquestions.org/questions/slackware-14/fetching-mail-from-an-office365-server-4175734865/)

RandomTroll 03-13-2024 07:41 AM

Fetching mail from an office365 server
 
I've been using fetchmail for 25 years, wish I could keep using it, but they refuse to get along with oauth2 and one of my accounts uses it.

What's the easiest alternative to get to get my mail with oauth2 support? I've looked at a few different, but the instructions haven't been instructive.

I can pick up my mail from gmail, which uses oauth2, and I can send my mail through the office365 server, so I'm not sure what the hold-up is, but I've failed to figure it out. No doubt it's me.

kgha 03-13-2024 08:27 AM

I've previously used this plugin for Thunderbird:
https://addons.thunderbird.net/en-us...-for-exchange/

Worked like a charm. Not free, though: €10 per year.

EDIT: before that I used davmail for Office365 account (see https://slackbuilds.org/repository/15.0/network/davmail ). But late last year something or other changed in Office365, forcing me to find another solution.

Petri Kaukasoina 03-13-2024 10:24 AM

It works here with thunderbird without any plugin.

kgha 03-13-2024 11:07 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 6489489)
It works here with thunderbird without any plugin.

It will, provided that IMAP works for the account in question. If it's a pure Exchange account, I don't think it works without some kind of plugin.

RandomTroll 03-13-2024 11:43 AM

Quote:

Originally Posted by kgha (Post 6489455)
I've previously used this plugin for Thunderbird.

Quote:

Originally Posted by Petri Kaukasoina (Post 6489489)
It works here with thunderbird without any plugin.

Quote:

Originally Posted by kgha (Post 6489494)
It will

I want to fetch my mail into my mail spool file, not do all the stuff Thunderbird does.

kgha 03-13-2024 12:17 PM

OK, did some googling for you, maybe this could help?
https://www.linux.com/training-tutor...-courier-imap/

RandomTroll 03-13-2024 01:32 PM

Quote:

Originally Posted by kgha (Post 6489506)
did some googling for you, maybe this could help?

No, it doesn't. I've already done a lot of searching, read many pages. I don't use postfix; I've already set it up for gmail.

r1w1s1 03-13-2024 01:45 PM

Quote:

Originally Posted by RandomTroll (Post 6489518)
No, it doesn't. I've already done a lot of searching, read many pages. I don't use postfix; I've already set it up for gmail.

Did you tried getmail ? Do you mind to share the error ?

Tonus 03-13-2024 06:37 PM

If it uses imap, have a look at offlineimap.
At work I use owl plugin for thunderbird on windows. I tried to set things up in neomutt with a gateway (davmail) to no avail. Maybe you could get it working now it might be more mature project.

I concluded your exchange server config must be at least slightly open to third-party tools to have any success

RandomTroll 03-13-2024 09:13 PM

Quote:

Originally Posted by r1w1s1 (Post 6489520)
Did you tried getmail ? Do you mind to share the error ?

Yes. I finally figured out how I was supposed to try to get it to work. I logged into portal.azure.com, tried to register the app to get the client_id and client_secret. azure replied that my 'tenant' didn't allow this. I got it to work for another domain, for which I don't need it, which worked. I tried using the id and secret of the second domain for the first, but that didn't.

badbetty 04-23-2024 03:18 AM

as an aside, just imagine the 'ordinary' amongst us trying to navigate the calamity the 'big tech' firms foist.

gattocarlo 04-23-2024 04:01 AM

Quote:

Originally Posted by RandomTroll (Post 6489593)
Yes. I finally figured out how I was supposed to try to get it to work. I logged into portal.azure.com, tried to register the app to get the client_id and client_secret. azure replied that my 'tenant' didn't allow this. I got it to work for another domain, for which I don't need it, which worked. I tried using the id and secret of the second domain for the first, but that didn't.

you could use getmail6 (similar to fetchmail and comes with slackware): you need to use a mutt script (present ins slackware: mutt_oauth2.py) to retrieve a refresh token and, feeding it to getmail, get an authorization token to retrieve your mail.

as you said to get the refresh token you need to have an approved client_id and client_secret. the manager of your account could approve it, but if it doesn't you will not be able to access your mail with a non approved client. this is what oauth2 is all about: controlling the client.

if thunderbird works you could use its credentials (client_id and client_secret) with mutt (and, with the refresh token use getmail), but retrieving the refresh token this way may be tricky.

with gmail I was able to get my client id and client secret and use it with my university email account, but my university, so far, does not discriminate between good and bad clients...

hope this helps (but I do not think so).


All times are GMT -5. The time now is 01:07 AM.