Table of Contents

mail

Quick Start

To set up an email server, we typically use Postfix for SMTP, Dovecot for POP3/IMAP, and mail utilities (“s-nail” package on RedHat Linux).

dnf install -y postfix dovecot s-nail

Edit the /etc/postfix/main.cp file:

inet_interfaces = all
home_mailbox = Maildir/  # To match the path for dovecot

Edit the /etc/dovecot/conf.d/10-auth.conf file:

disable_plaintext_auth = no
auth_mechanisms = plain login
login_trusted_networks = 0.0.0.0/0  # To allow plain login on non-tls connections

Edit the /etc/dovecot/conf.d/10-mail.conf file:

mail_location = maildir:~/Maildir

s-nail test

# Read email
s-nail -f ./Maildir/

# Send email
echo "Message body" | s-nail -s "Subject line" recipient@example.com

curl test

printf 'Subject: Test email from curl\n\nTest.' | curl --url 'smtp://ARTSLOPMDB03.ar.sspad.ng' --mail-from 'artest@localhost' --mail-rcpt 'artest@localhost' -T -