(NOTE: this is part of the “An Anti-Spam gateway” series)
Continuing the Postfix configuration… Edit the /etc/postfix/main.cf
file.
Look for, and change according to your configuration, the following options:
myhostname
(should be your machine’s name)
myorigin
(probably $mydomain
)
mynetworks
(your network(s), possibly 10.0.0.0/24
in this case)
relay_domains
(should be, of course, your domain(s))
bounce_notice_recipient
, delay_notice_recipient
, error_notice_recipient
, policy_notice_recipient
(change them all to postmaster@yourdomain
, assuming that address exists or is an alias to an existing one – possibly yours, and replacing yourdomain
with your domain, of course)
Change the smtpd_client_restrictions
option to:
smtpd_client_restrictions = permit_mynetworks,
reject_rbl_client relays.ordb.org,
reject_rbl_client sbl.spamhaus.org,
permit
Change smtpd_helo_required
to yes
. Mail servers should learn to behave. Besides, it’s bulk spam senders that normally don’t.
Now, save that file, and edit /etc/postfix/transport
. Except for the comments, it should be changed so that it only has this line:
* smtp:10.0.0.2
(remember? that’s the real mail server’s address)
Leave the editor, then do the following: postmap /etc/postfix/transport
, to update the transport.db
file.
Now, test it. Yes, when you start it (postfix start
), if everything went well, it should already be working as a non-filtering gateway. Assuming, of course, that you configure your firewall so that mail from the outside (to port 25) is delivered there, and that it can connect to the real mail server, and that the latter accepts mail from the gateway.
When it’s working, go to the next part of the series.
Copyright © 2013 The Tlog - a technology blog