When I set up an email server using postfix on ubuntu server, how do I make sure that it won't be an open relay??
|
Being an open relay means that you are accepting mail from unauthenticated users for domains that are not the domains you manage. Postfix has some very simple config options to help: mynetworks and *mynetworks_style* between them dictate from which network addresses messages to any destination will be accepted. mydestination is used to specify which domains are domains that you manage (ie that you should accept messages for because they're yours). So the very simplest setup looks like:
This will accept mail only:
and will reject anything else. That is the most basic setup I can come up with. You need to read the entries for mydomain, mydestination, mynetworks{_style} in postconf(5). If you need to be able to accept mail from clients by any other criterion than network, such as say username and password or kerberos ticket, you need to read about SMTP_AUTH. |
|||
|
|
|
I believe you'll need to set the There are some tests listed at http://articles.slicehost.com/2008/8/7/postfix-checking-for-an-open-relay that you can use to check whether your server is running an open relay. (Some of the links may be dead but I'm pretty sure at least one still works... don't remember which though) Here's an excerpt from my server's Postfix config:
luser_relay =
mydestination = $myhostname, $mydomain, localhost, localhost.$mydomain
mynetworks = 127.0.0.1/32 [server's IP address]/32
mynetworks_style = host
myorigin = $mydomain
relay_domains = $mydestination
smtpd_helo_restrictions = permit_mynetworks,
reject_non_fqdn_hostname,
reject_invalid_hostname
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
check_policy_service unix:private/postgrey,
check_policy_service unix:private/policyd-spf,
reject_rbl_client sbl-xbl.spamhaus.org
|
|||
|
|
|
Give this website a try. It will allow you to check that you've configured your mail server properly |
|||
|
|