notes:email-configuration
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| notes:email-configuration [2026/05/31 01:35] – removed - external edit (Unknown date) 127.0.0.1 | notes:email-configuration [2026/06/02 22:55] (current) – Add a note about mbsync sam | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Notes on Email Configuration ====== | ||
| + | This document describes how I can read mail without relying on the outlook web interface, or Mac's mail app. | ||
| + | This is somewhat complex because the university mail uses Microsoft exchange. | ||
| + | |||
| + | Mainly, the information below is compiled from [[https:// | ||
| + | |||
| + | ==== installation ==== | ||
| + | |||
| + | I got all of the software from '' | ||
| + | The packages required are '' | ||
| + | |||
| + | ==== davmail ==== | ||
| + | |||
| + | [[https:// | ||
| + | The local machine' | ||
| + | |||
| + | '' | ||
| + | Its contents are as follows: | ||
| + | < | ||
| + | # Disallow access to the davmail server from remote hosts (i.e., | ||
| + | # other computers on the network) | ||
| + | davmail.allowRemote=false | ||
| + | |||
| + | |||
| + | # Don't use SSL (between email client and davmail) | ||
| + | davmail.ssl.nosecurecaldav=false | ||
| + | davmail.ssl.nosecureimap=false | ||
| + | davmail.ssl.nosecureldap=false | ||
| + | davmail.ssl.nosecuresmtp=false | ||
| + | |||
| + | |||
| + | # The ports to run the different services on. You'll need | ||
| + | # these to connect clients. | ||
| + | davmail.caldavPort=6000 | ||
| + | davmail.imapPort=6001 | ||
| + | davmail.ldapPort=6002 | ||
| + | davmail.smtpPort=6003 | ||
| + | |||
| + | |||
| + | # Connection details for your exchange account. Odds are good | ||
| + | # that the url listed here will work for you. If not, see if your | ||
| + | # University/ | ||
| + | # connect to their email services with. | ||
| + | davmail.url=https:// | ||
| + | |||
| + | |||
| + | # Set the authentication mode to manual | ||
| + | davmail.mode=O365Manual | ||
| + | |||
| + | |||
| + | # Run davmail in server mode | ||
| + | davmail.server=true | ||
| + | davmail.enableKeepAlive=true | ||
| + | </ | ||
| + | |||
| + | Once a program, like '' | ||
| + | This URL leads you through an authentication flow finally resulting in a blank page whose URL contains the authentication token. | ||
| + | Passing this URL back into '' | ||
| + | Once it's authenticated, | ||
| + | < | ||
| + | ... | ||
| + | # Run davmail in server mode | ||
| + | davmail.server=true | ||
| + | davmail.enableKeepAlive=true | ||
| + | davmail.oauth.< | ||
| + | </ | ||
| + | |||
| + | In my case, there was one hitch, which is that the canonical input processing mode prevented me from pasting the entire token since it's so long. So, I had to disable canonical mode when running '' | ||
| + | < | ||
| + | $ stty -icanon && davmail ~/ | ||
| + | </ | ||
| + | |||
| + | ==== mbsync ==== | ||
| + | |||
| + | '' | ||
| + | My configuration file is located at '' | ||
| + | (I've replaced my actual account name with ''< | ||
| + | |||
| + | < | ||
| + | ### University Email (using davmail) | ||
| + | |||
| + | IMAPAccount <account name> | ||
| + | Host 127.0.0.1 | ||
| + | Port 6001 | ||
| + | User <my email> | ||
| + | PassCmd " | ||
| + | TLSType None | ||
| + | AuthMechs LOGIN | ||
| + | |||
| + | IMAPStore <account name> | ||
| + | Account <account name> | ||
| + | |||
| + | MaildirStore <account name> | ||
| + | Path ~/ | ||
| + | Inbox ~/ | ||
| + | SubFolders Verbatim | ||
| + | |||
| + | Channel <account name> | ||
| + | Far :< | ||
| + | Near :< | ||
| + | Patterns * | ||
| + | SyncState * | ||
| + | Create Both | ||
| + | Sync All | ||
| + | Expunge Near | ||
| + | |||
| + | ### Gmail | ||
| + | |||
| + | IMAPAccount gmail | ||
| + | Host imap.gmail.com | ||
| + | Port 993 | ||
| + | TLSType IMAPS | ||
| + | AuthMechs LOGIN # <-- Note this line | ||
| + | User <my gmail> | ||
| + | PassCmd " | ||
| + | |||
| + | IMAPStore gmail-remote | ||
| + | Account gmail | ||
| + | |||
| + | MaildirStore gmail-local | ||
| + | Path ~/ | ||
| + | Inbox ~/ | ||
| + | SubFolders Verbatim | ||
| + | |||
| + | Channel gmail | ||
| + | Far : | ||
| + | Near : | ||
| + | Patterns * | ||
| + | SyncState * | ||
| + | Create Both | ||
| + | Sync All | ||
| + | Expunge Near | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | We can use macOS' '' | ||
| + | |||
| + | Note that in the case of Gmail, the password stored in the keychain is an application password, since google does not permit IMAP authentication using your account password. | ||
| + | Adding '' | ||
| + | |||
| + | Running '' | ||
| + | Passing '' | ||
| + | |||
| + | ==== msmtp ==== | ||
| + | |||
| + | '' | ||
| + | < | ||
| + | defaults | ||
| + | logfile ~/ | ||
| + | tls_trust_file system # Use the system' | ||
| + | |||
| + | ### University Email | ||
| + | |||
| + | account <account name> | ||
| + | host 127.0.0.1 | ||
| + | port 6003 | ||
| + | protocol smtp | ||
| + | auth plain | ||
| + | tls off | ||
| + | user <my email> | ||
| + | from <my email> | ||
| + | passwordeval " | ||
| + | |||
| + | ### Gmail | ||
| + | |||
| + | account gmail | ||
| + | auth on | ||
| + | host smtp.gmail.com | ||
| + | port 465 | ||
| + | protocol smtp | ||
| + | from <my gmail> | ||
| + | user <my gmail> | ||
| + | passwordeval " | ||
| + | tls on | ||
| + | tls_starttls off | ||
| + | |||
| + | # Default | ||
| + | account default : <account name> | ||
| + | </ | ||