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
 +
root:          helpdesk@domain.com
 
   
 
   
 
  # 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 = example.com'
postconf -e 'myorigin = $mydomain'

myhostname

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.

curl ifconfig.me/host

Then set myhostname

postconf -e 'myhostname = ppp203-0-113-205.static.isp.net'
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 = 203.0.113.205'
postconf -e 'smtpd_banner = $myhostname ESMTP'

Optionally set a relay host:

postconf -e 'relayhost = smtp.example.com'
echo "root@example.com admin@example.com" > /etc/postfix/generic
postmap /etc/postfix/generic
echo "root me@example.com" > /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
root:          helpdesk@domain.com

# 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

newaliases
invoke-rc.d postfix restart
Personal tools