Remove the plain text file and move the encrypted file to the final location, e.g. ![]() $ gpg -default-recipient-self -e /path/to/plain/password Then, encrypt the file with your private key: In that directory create a plain text file with the mail account password. Create a secure directory with 700 permissions located on a tmpfs to avoid writing the unencrypted password to the disk. Then, create an encrypted password file for msmtp, as follows. To do this, set up GnuPG, including gpg-agent to avoid having to enter the password every time. For such cases, the -passwordeval parameterĬan be used to call an external keyring tool like GnuPG. msmtp will not prompt if it has been called by another type of application, such as Mutt. In that case, if the account in question has auth set to a legitimate value other than off, invoking msmtp from an interactive shell will ask for the password before sending mail. Msmtp should now find the password automatically. Secret-tool store -label=msmtp host service smtp user yourusername Setup the keyring as described on the linked wiki page and install libsecret. Storing passwords in GNOME Keyring is supported natively in msmtp. Passwords for msmtp can be stored in plaintext, encrypted files, or a keyring. ![]() Add a MAILTO line to the crontab: Add a MAILFROM line to the crontab: last part is necessary to prevent this error: sendmail: server message: 550 5.7.1 Rejected due to unmatching envelope and header sender.Create /etc/aliases: your_username: you can add it directly to the crontab:.Add to /etc/msmtprc: aliases /etc/aliases.One way to accomplish this is by adding it to the msmtp configuration: Then you must tell cronie or msmtp what your email address is. etc/systemd/system//nf ĮxecStart=/usr/bin/crond -n -m '/usr/bin/msmtp -t' To make Cronie use msmtp rather than sendmail, make sure msmtp-mta is installed, or edit the rvice systemd unit: $ cat test.mail | msmtp -a default Arch uses systemd/Timers instead of cronie (Discuss in Talk:Msmtp) $ 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:Ī. To send mails using the mail command you must install the package s-nail, which also provides the mailx command. Tls_trust_file /etc/ssl/certs/ca-certificates.crtĪccess token renewal happens automatically in the background transparent to the user. 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. Note: this post explains the now extremely limited functionality permitted for Gmail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |