Mail Setup (Wheezy)

From Hexwiki
Jump to: navigation, search

The basics given here are pretty much identical for any *nix setup.

Virtual Mail User

addgroup --gid 999 vmail
useradd -d /var/vmail -s /usr/sbin/nologin -g 999 -r -u 999 --disabled-password --gecos "" vmail
chmod 2770 /var/vmail

Keep track of what ids you use for vmail's user/group.

Mailing Certificate(s)

Make a 2048 bit rsa certificate for your IMAP and/or SMTP Submission domain

  1. Make a private directory in /etc/ that is chmod 0700
  2. openssl genrsa -out keyname.key 2048
  3. chmod 600 keyname.key
  4. Either leave as snake-oil certs or get it signed by a 'real' signer. The latter is more of a convenience, really.

/etc/aliases

mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
noc: root
security: root
logcheck: root
clamav: root
root: administrator@yourmaindomain.com

Note that if your main mailserver defines a different alias for root in this guide, it is going to override what you specify here.