GS_ICT has asked for the wisdom of the Perl Monks concerning the following question:

Hi

We would like to download e-mails and attachments from 365 and then move the mail to a different e-mail folder.

However, after a lot of searching and trying, IMAP examples fail even though the 365 account has IMAP ticked. This is probably down to modern 365 security. We are basic users of Perl, so work ideally by example. We are looking for link to or a working example that we can copy with a guide for any settings that need to be done in Azure.

Apparently there is a way to do this using autodiscovery. This is where the software displays a Microsoft prompt requesting authentication and then stores the credentials somehow. Unfortunately not found any way of doing this. Any pointers also will be appreciated.

Replies are listed 'Best First'.
Re: 365 E-Mail
by Corion (Patriarch) on Aug 25, 2022 at 08:51 UTC

    It's not (yet) IMAP access, but App::wsgetmail shows how to set up an application to authenticate with Office 365. You will likely have to adapt the authentication there and then maybe use that authentication token in connection with your IMAP client.

    I have not done any of this, but this is where I would start.