Skip to content

Instantly share code, notes, and snippets.

@cebe
Last active December 26, 2015 07:49
Show Gist options
  • Save cebe/7118289 to your computer and use it in GitHub Desktop.
Save cebe/7118289 to your computer and use it in GitHub Desktop.
example postfix config for sending root server replace #HOSTNAME# with your hostname and #DOMAIN# with your domain. example: hostname = tador.cebe.net domain = cebe.net Also make sure to replace [email protected] with your mail. I do not want to get your cron mails ;-)
# /etc/postfix/main.cf
## uncomment these when relaying via mail provider
## the host to relay via. The brackets mean "take the hostname itself, not its MX"
#relayhost = [mala.cebe.net]
## a fallback host to use if relayhost is not available
#smtp_fallback_relay= [hermes.bh-servers.net]
## uncommend these when you need smtp auth for mail provider
## put the following line in /etc/postfix/relay_password:
## relayhost username:password
#smtp_sasl_password_maps=hash:/etc/postfix/relay_password
#smtp_sasl_auth_enable=yes
#smtp_sasl_security_options = noanonymous
default_database_type = btree
biff = no
append_dot_mydomain = no
myorigin = #HOSTNAME#
mydomain = #DOMAIN#
myhostname = #HOSTNAME#
mydestination = localhost, localhost.$mydomain, #HOSTNAME#
mynetworks = 127.0.0.0/8, [::ffff:127.0.0.0]/104, [::1]/128
recipient_delimiter = +
maximal_queue_lifetime = 4d
delay_warning_time = 4h
# these values control how long a mail will stay in the queue. These values play good with greylisting.
minimal_backoff_time = 3m
maximal_backoff_time = 30m
# No mailbox limit to avoid conflict with message size
mailbox_size_limit = 0
virtual_mailbox_limit = 0
# 100 MB * 1,36 wegen base64 http://de.wikipedia.org/wiki/Base64
message_size_limit = 142606336
# 1 MB
bounce_size_limit = 1048576
# 100 KB
header_size_limit = 102400
alias_maps = hash:/etc/aliases
alias_database = $alias_maps
luser_relay = [email protected]
# good for debugging
#always_bcc = [email protected]
# TLS parameters
# make sure cert and key file exist (these are default on debian)
smtp_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtp_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtp_use_tls=yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# in case we enable smtpd in master.cf, only accept mail from mynetworks (as configured above)
smtpd_recipient_restrictions = permit_mynetworks, defer
# /etc/postfix/master.cf
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
# there is no smtpd here we are only relaying
#smtp inet n - - - - smtpd
# these are services needed for queue management
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
rewrite unix - - - - - trivial-rewrite
tlsmgr unix - - - 1000? 1 tlsmgr
# mail transports, smtp is the only relevant here but we keep others in case we need them
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
# stats and cache processes
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment