Tags

, ,

For mail gateway installation of postfix is same as before. There are some few changes:

1. changes in main.cf.

# vi /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = hostname.domain-name.com
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8
relay_domains = hash:/etc/postfix/relay_domains
transport_maps = hash:/etc/postfix/transport
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
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.2.11-documentation/samples
readme_directory = /usr/share/doc/postfix-2.2.11-
documentation/README_FILES
maximal_queue_lifetime = 30d
message_size_limit = 30480000000
mailbox_size_limit = 50480000000
smtpd_banner = $myhostname ESMTP
maps_rbl_domains = bl.spamcop.net
smtpd_client_restrictions = hash:/etc/postfix/access,
reject_unauth_pipelining
smtpd_sender_restrictions = reject_unknown_sender_domain,
hash:/etc/postfix/access
smtpd_recipient_restrictions = hash:/etc/postfix/access,
reject_rbl_client bl.spamcop.net, reject_non_fqdn_recipient,
reject_non_fqdn_sender, reject_unknown_s
ender_domain, reject_unknown_recipient_domain, permit_mynetworks,
reject_unauth_destination, reject_multi_recipient_bounce
biff = no
smtpd_helo_required = yes
smtp_always_send_ehlo = yes
default_destination_concurrency_limit = 10
default_destination_recipient_limit = 20
default_process_limit = 150
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
header_checks = regexp:/etc/postfix/header_checks

Permit the domain you want to relay:

# vi /etc/postfix/relay_domains
domain1.com OK
domain2.com OK
domain3.com OK

Forward the relayed mail to the original mail server.

# vi /etc/postfix/transport
domain1.com smtp:[192.168.169.20]
domain2.com smtp:[172.16.17.18]
domain3.com smtp:[192.168.169.170]