RSS Amplifier

zaage.IT · Feb 1, 2023

Sending e-mails via mailbox.org with msmtp on Fedora

0
Sign in to vote or save

Robert Zaage · zaage.IT

:: 2 min read (215 words)

#tutorials  #networking  #linux 

Since I run several ZFS pools and want to get a notification by the integrated daemon “zed” in case of an error, I had the idea to create an alias at my email provider mailbox.org and send these notifications to my private mailbox via this alias.

First, we need to install the msmtp and s-nail packages. This is a very lightweight SMTP client and a mailx compatible mail processing system to be able to send emails later using the mail command.

dnf install msmtp s-nail

After the installation, we copy the default configuration of msmtp into /etc and adjust it according to our requirements.

cp /usr/share/doc/msmtp/msmtprc-system.example /etc/msmtprc

bash /etc/msmtprc


account default
host smtp.mailbox.org
port 587
tls on
tls_starttls on
auth plain
user <[email protected]>
password <mailbox.org-password>
from [email protected]
allow_from_override off
set_from_header on
syslog LOG_MAIL

Now we have configured a system-wide SMTP account. However, not every user should be able to access the password. Therefore, we then adjust the permissions of the file.

chmod 600 /etc/msmtprc

Last but not least, we now define the MTA (Mail Transport Agent) so that s-nail uses the msmtp client.

bash /etc/mail.rc


set mta=/usr/bin/msmtp

With the help of the following command, we can now send a test mail. It shouldn’t generate any output.

Read the original on zaage.it

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.