1

My college signed me up with Office 365 and I'd like to be able to download the emails and either save to file or print to stdout within a script.

I've already managed to send email with scripts using Mutt, but I haven't found a way to download received email.

Please note that I'll want to download emails as part of something automatic, so a command line interface with ncurses is no good. No human intervention.

Any ideas?

3

Since you are already using mutt, you can configure the IMAP mailbox in mutt:

You would put in ~/.muttrc a configuration like

set spoolfile="imaps://johndoe:p455w0rd@outlook.office365.com:993/INBOX"

see http://dev.mutt.org/trac/wiki/MuttGuide/UseIMAP

Alternatively, you could download the new mail to a Maildir and process the emails locally (there will be a file per email).

  • How/where do I access the email through a script? – Dziugas Oct 27 '15 at 16:08
  • In other words, where are the emails going to be saved using this method? – Dziugas Oct 27 '15 at 16:43
  • @Dziugas if you are accessing an IMAP mailbox, emails are stored in the email server. – Ángel Oct 29 '15 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.