Generic Postfix

From Bit Binary Wiki
(Difference between revisions)
Jump to: navigation, search
Line 43: Line 43:
  #      >>>>>>>>>>      show through to sendmail.
  #      >>>>>>>>>>      show through to sendmail.
# Person who should get root's mail
  # Basic system aliases -- these MUST be present.
  # Basic system aliases -- these MUST be present.
Line 130: Line 133:
  decode:        root
  decode:        root
# Person who should get root's mail
#root:        marc
  # Debian www-data user
  # Debian www-data user

Revision as of 15:59, 16 December 2013

Warning: Use single quotes to stop shell expansion reading variables
postconf -e 'mydomain ='
postconf -e 'myorigin = $mydomain'


If the system does not have a global DNS name (behind a NAT firewall for example) then one option is to use the A record of the systems default gateway.but a reverse DNS should exist for the associated IP. Another option is to use the reverse DNS of the systems default gateway. If your gateway has no reverse DNS you should consider creating one.

You can discover the gateway with the command.


Then set myhostname

postconf -e 'myhostname ='
Note: myhostname should match your mx record

postconf -e 'smtp_generic_maps = hash:/etc/postfix/generic'
postconf -e 'virtual_alias_maps = hash:/etc/postfix/virtual'
postconf -e 'smtpd_banner = $myhostname ESMTP'
postconf -e 'proxy_interfaces ='
postconf -e 'smtpd_banner = $myhostname ESMTP'

Optionally set a relay host:

postconf -e 'relayhost ='
echo "" > /etc/postfix/generic
postmap /etc/postfix/generic
echo "root" > /etc/postfix/virtual
postmap /etc/postfix/virtual

/etc/aliases stolen from RHEL6

#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#      >>>>>>>>>>      The program "newaliases" must be run after
#      >> NOTE >>      this file is updated for any changes to
#      >>>>>>>>>>      show through to sendmail.
# Person who should get root's mail

# Basic system aliases -- these MUST be present.
mailer-daemon: postmaster
postmaster:    root

# General redirections for pseudo accounts.
bin:           root
daemon:        root
adm:           root
lp:            root
sync:          root
shutdown:      root
halt:          root
mail:          root
news:          root
uucp:          root
operator:      root
games:         root
gopher:        root
ftp:           root
nobody:        root
radiusd:       root
nut:           root
dbus:          root
vcsa:          root
canna:         root
wnn:           root
rpm:           root
nscd:          root
pcap:          root
apache:        root
webalizer:     root
dovecot:       root
fax:           root
quagga:        root
radvd:         root
pvm:           root
amanda:        root
privoxy:       root
ident:         root
named:         root
xfs:           root
gdm:           root
mailnull:      root
postgres:      root
sshd:          root
smmsp:         root
postfix:       root
netdump:       root
ldap:          root
squid:         root
ntp:           root
mysql:         root
desktop:       root
rpcuser:       root
rpc:           root
nfsnobody:     root
backuppc:      root

ingres:        root
system:        root
toor:          root
manager:       root
dumper:        root
abuse:         root

newsadm:       news
newsadmin:     news
usenet:        news
ftpadm:        ftp
ftpadmin:      ftp
ftp-adm:       ftp
ftp-admin:     ftp
www:           webmaster
webmaster:     root
noc:           root
security:      root
hostmaster:    root
info:          postmaster
marketing:     postmaster
sales:         postmaster
support:       postmaster

# trap decode to catch security attacks
decode:        root

# Debian www-data user
www-data:      root

Run newaliases

invoke-rc.d postfix restart
Personal tools