Difference between revisions of "OpenSMTPD"

From ArchWiki
Jump to: navigation, search
(create user accounts)
(See also)
Line 63: Line 63:
* OpenSMTPD pairs well with [[Dovecot]]. Combine the two for a nice minimalist mailserver
* OpenSMTPD pairs well with [[Dovecot]]. Combine the two for a nice minimalist mailserver
*[http://opensmtpd.org/] OpenSMTPD project page
*[http://opensmtpd.org/ OpenSMTPD project page]
*[https://coderwall.com/p/eejzja Simple SMTP server with OpenSMTPD]
*[https://coderwall.com/p/eejzja Simple SMTP server with OpenSMTPD]

Revision as of 00:36, 17 March 2014

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary end

Required packages


pacman -S opensmptd

simple OpenSMTPD/mbox configuration

create user accounts

Create a user account on the mail server for each discrete mailbox. OpenSMTPD will deliver messages to the user account's mbox file at /var/spool/mail/<username>. Multiple SMTP email addresses can be delivered into one mailbox if desired.

# useradd -m -s /bin/bash roger
# useradd -m -s /bin/bash shirley

edit /etc/smtpd/smtpd.conf

A working configuration can be had in as little as five lines!

listen on eth0 hostname myemaildomain.com
table vdoms             "/etc/smtpd/vdoms"
table vusers            "/etc/smtpd/vusers"
accept from any for domain <vdoms> virtual <vusers> deliver to mbox
accept from source { localhost } for any relay

create domain and user maps

/etc/smtpd/vdoms - put one domain per line


/etc/smtpd/vusers - map inbound email addresses to local mbox user account names, or inside/outside email addresses. Mix and match as desired.

roger@personaldomain.org          roger
newsletters@personaldomain.org    roger,roger.rulz@gmail.com

roger@businessname.com            roger
shirley@businessname.com          shirley
info@businessname.com             roger,shirley
contact@businessname.com          info@businessname.com

Starting the server

Use the standard systemd syntax to control the smtpd.service daemon.

# systemctl start smtpd.service

To have it start on boot

# systemctl enable smtpd.service

Watch the spice flow!

# journalctl -f _SYSTEMD_UNIT=smtpd.service

See also