User Tools

Site Tools


notes:email-configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:email-configuration [2026/05/31 14:24] – [Notes on Email Configuration] samnotes:email-configuration [2026/06/02 22:55] (current) – Add a note about mbsync sam
Line 9: Line 9:
  
 I got all of the software from ''brew''. I got all of the software from ''brew''.
-The packages required are ''davmail'', ''isync'' (which provides the ''mbsync'' executable), and ''msmtp''.+The packages required are ''davmail'', ''isync'' (which provides the ''mbsync'' executable), ''msmtp'', and ''mu''.
  
 ==== davmail ==== ==== davmail ====
Line 79: Line 79:
  
 <code> <code>
 +### University Email (using davmail)
 +
 IMAPAccount <account name> IMAPAccount <account name>
 Host 127.0.0.1 Host 127.0.0.1
 Port 6001 Port 6001
 User <my email> User <my email>
-PassCmd "security find-generic-password -a umail -s mbsync -w"+PassCmd "security find-generic-password -a <my email> -s <my account name> -w"
 TLSType None TLSType None
 AuthMechs LOGIN AuthMechs LOGIN
Line 90: Line 92:
 Account <account name> Account <account name>
  
-MaildirStore uchicago-local+MaildirStore <account name>-local
 Path ~/Mail/<account name>-mail/ Path ~/Mail/<account name>-mail/
 Inbox ~/Mail/<account name>-mail/INBOX Inbox ~/Mail/<account name>-mail/INBOX
 SubFolders Verbatim SubFolders Verbatim
  
-Channel uchicago+Channel <account name>
 Far :<account name>-remote: Far :<account name>-remote:
 Near :<account name>-local: Near :<account name>-local:
 +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>@gmail.com
 +PassCmd "security find-generic-password -a <my gmail>@gmail.com -s <my gmail> -w"
 +
 +IMAPStore gmail-remote
 +Account gmail
 +
 +MaildirStore gmail-local
 +Path ~/Mail/gmail-mail/
 +Inbox ~/Mail/gmail-mail/INBOX
 +SubFolders Verbatim
 +
 +Channel gmail
 +Far :gmail-remote:
 +Near :gmail-local:
 Patterns * Patterns *
 SyncState * SyncState *
Line 107: Line 136:
 ''PassCmd'' is a command to run to find your account password. ''PassCmd'' is a command to run to find your account password.
 We can use macOS' ''security'' command to call up the password from keychain when it's required, rather than writing it in plain text in the configuration file. We can use macOS' ''security'' command to call up the password from keychain when it's required, rather than writing it in plain text in the configuration file.
 +
 +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 ''AuthMechs LOGIN'' was also necessary to get authentication to work (see [[https://frostyx.cz/posts/synchronize-your-2fa-gmail-with-mbsync|this blog post]]).
  
 Running ''mbsync <account name>'' will sync the local mail directory specified as above with the server. Running ''mbsync <account name>'' will sync the local mail directory specified as above with the server.
 +Passing ''-a'' will cause //all// accounts to be synchronized.
 +
 +==== msmtp ====
 +
 +''msmtp'' is used to send mail. It's configuration (''~/.msmtprc'') is as follows:
 +<code>
 +defaults
 +logfile ~/Mail/msmtp.log
 +tls_trust_file system # Use the system's tls certificate
 +
 +### 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 "security find-generic-password -a <my email> -s <my account name> -w"
 +
 +### Gmail
 +
 +account gmail
 +auth on
 +host smtp.gmail.com
 +port 465
 +protocol smtp
 +from <my gmail>@gmail.com
 +user <my gmail>@gmail.com
 +passwordeval "security find-generic-password -a <my gmail>@gmail.com -s <my gmail> -w"
 +tls on
 +tls_starttls off
 +
 +# Default
 +account default : <account name>
 +</code>
notes/email-configuration.1780237473.txt.gz · Last modified: by sam