Table of Contents

Postfix (postfix.py)

Postfix Configuration /etc/postfix/main.cf



My /etc/postfix/main.cf

#==============================================================================
#/etc/postfix/main.cf
# -rw-r--r-- root root
#
# How to check configuration
#    postconf : list all configuration
#    postconf -d : list default configuration
#    postconf -n : Display only parameters different from default
#==============================================================================

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix

mail_owner = postfix

myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain      # This is Mail From

inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

unknown_local_recipient_reject_code = 550


#relayhost
relayhost = [192.168.0.100]
#relayhost = [smtp.example.com] 
#relayhost = [smtp.gmail.com]:587

mynetworks = 10.50.0.0/16, 127.0.0.0/8

#relay_domains
relay_domains = $mydestination
#relay_domains =  # this mail server doesn't receive mail.

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases


debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES


# Security
disable_vrfy_command = yes #disable
smtpd_banner = $myhostname ESMTP unknown


Note

Specify the source IP with multiple Postfix

#Postfix A
inet_interface=all
smtp_bind_address=192.168.1.10

#Postfix B
inet_interface=all
smtp_bind_address=192.168.2.10


Postfix (postfix.py)





Postfix (postfix.py)