msmtpΒΆ
msmtp is tool for sending mail. By default it sends email messages provided by standard input. It can be used to send email with scripts or some mail clients, such as mutt.
To install msmtp:
- Open an SSH session to your account.
- Download the msmtp source tar file. Enter wget url, where url is the URL for the source archive (see the msmtp files page for the latest version), and press Enter. The source file (typically of the form msmtp-version.tar.bz2) is created in the current directory.
- Unpack the archive. Enter tar -xf archive, where archive is the name of the tar file containing the msmtp source, and press Enter. A directory containing the msmtp source is created in the current directory.
- Switch to the msmtp source directory. Enter cd source, where source is the path to the directory containing the source files, and press Enter.
- Configure the installation. Enter ./configure --prefix=$HOME and press Enter.
- Build msmtp. Enter make and press Enter.
- Install msmtp. Enter make install and press Enter.
To configure msmtp to send mail:
Open your ~/.msmtprc file in a text editor.
Add the following lines to the file:
account default host smtp.webfaction.com port 587 from email_address auth on user mailbox_name password mysecret tls on tls_trust_file certificate_file
where email_address is the email address you configured in the WebFaction control panel, mailbox_name is the name of a WebFaction mailbox, mysecret is the mailbox password, and certificate_file is the path to your certificate authority file. Alternatively, you may substitute the tls_trust_file setting with tls_certcheck off, to disable the verification of certificates.
Save and close the file.
Note
.msmtprc‘s permissions must be user-only read and write. To correctly set the permissions for .msmtprc, enter chmod 600 ~/.msmtprc and press Enter.
You can now verify your settings work by entering msmtp -S and pressing Enter.
