korearight.blogg.se

Macos server mail aliases
Macos server mail aliases








  1. MACOS SERVER MAIL ALIASES INSTALL
  2. MACOS SERVER MAIL ALIASES PASSWORD

$ printf "Subject: Test\n\nhello there username." | msmtp -a default with the addresses in a file: $ echo "hello there username." | msmtp -a default send both a subject and a body: The account option ( -account=,-a) tells which account to use as sender: Add the following line to the defaults section of msmtprc or your local configuration file:Īnd create an aliases file in /etc /etc/aliases # Example aliases file msmtprc file will need to be in the home of every user who wants to send mail or alternatively the system wide /etc/msmtprc can be used. You will also need to provide a sendmail-compatible MTA, either by installing msmtp-mta (which symlinks sendmail to msmtp) or by editing /etc/mail.rc to set the sendmail path:Ī.

MACOS SERVER MAIL ALIASES INSTALL

To send mails using the mail command you must install the package s-nail, which also provides the mailx command. And see Gmail API quickstart for instruction on registering a Gmail APP and authorizing it to access emails. See more information on getmail link about how this works. The get-gmail-token script can be found from the source files of the msmtp-oauth2 package.

macos server mail aliases

, effectively disabling plain authentication and enabling XOAUTH2.

macos server mail aliases

MACOS SERVER MAIL ALIASES PASSWORD

The package does a small hack so that the plain authentication method will send the AUTH XOAUTH2 password instead of the AUTH PLAIN. To use XOAUTH2 authentication with Gmail (see official information), you can install the msmtp-oauth2 AUR package. Note: This method may work, but uses outdated tools. If you comment out the last line, msmtp will request you for the token that oauth2.py provides you, which is normally valid for one hour. Once you have your Gmail API setup, you can implement the wrapper script oauth2token (that employs secret-tool(1)) or an adaptation of oauth2token (that employs pass).Īn msmtp configuration would be adapted thus: This is a scripted method, using the msmtp setting oauthbearer for authentication. Run the oauth2create script to obtain and store credentials for each account.Īdd auth oauthbearer and passwordeval oauth2get provider account, substituting provider and account with the values you used for oauth2create in your config. Install oauth2token AUR and follow its README to configure the account. Tls_trust_file /etc/ssl/certs/ca-certificates.crtĪccess token renewal happens automatically in the background transparent to the user.

macos server mail aliases

To use mailctl, install mailctl-bin AUR and configure msmtp to use it: A comprehensive solution is using the mailctl utility which provides IMAP/SMTP clients with renewal capabilities and authorization of OAuth2 credentials. Msmtp alone lacks the ability to renew or authorize OAuth2 credentials. OAuth2 can be used to securely authenticate msmtp when basic username/password authentication is unsupported by the site configuration or otherwise undesirable. ~/.msmtprc passwordeval "gpg -quiet -for-your-eyes-only -no-tty -decrypt ~/.msmtp-gmail.gpg" After running that snippet of code, type in your password, press enter, and press Control-d so gpg can encrypt your password. The ending dash is not a typo, rather it causes gpg to use stdin. To avoid this, use gpg with shell stdin: gpg -encrypt -o.

macos server mail aliases

Warning: Most shells save command history(e.g.bash_history.










Macos server mail aliases