My task is to set up a Postfix Open Relay Server, which allows all users inside & outside network to relay their email through it! Also Included Spamassassin and ClamaV (I know Open Relay is not advised! But this is the task in my project, so have to go with it, later on i will play around with my networks and firewall, Currently im doing this for ISP so they will list their networks that are allowed to relay but for the moment i want everyone to be allowed!)
When i'm testing online for an open relay it says it's closed! (https://mxtoolbox.com/)

Heres my main.cf Postfix configuration :


smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no

append_dot_mydomain = no

readme_directory = no




smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache

smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

myhostname = testmail.*****.ie

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

mydomain = *****.ie

myorigin = $mydomain

mydestination =

local_transport = error:local mail delivery is disabled relayhost =

mynetworks =

mailbox_size_limit = 0

recipient_delimiter = +

inet_interfaces = all

inet_protocols = ipv4

header_checks = regexp:/etc/postfix/header_checks

content_filter = scan:

receive_override_options = no_address_mappings


Also im still waiting for my Reverse DNS to be set up, would this be the cause of Relay Access Denied ? If not, are my configurations set up right ?


Apr 26 11:44:53 testmail postfix/smtpd[4387]: connect from pws3.mxtoolbox.com[] Apr 26 11:44:56 testmail postfix/smtpd[4387]: NOQUEUE: reject: RCPT from pws3.mxtoolbox.com[]: 554 5.7.1 : Relay access denied; from= to= proto=ESMTP helo= Apr 26 11:44:56 testmail postfix/smtpd[4387]: disconnect from pws3.mxtoolbox.com[] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4


The answer is that you haven't allowed it in smtpd_relay_restrictions. This is how it SHOULD be. Open Relay SMTP servers were popular back in the 90s, in the dawn of SPAM. The test you have used on MxToolbox is for testing that you don't have accidentally set up an open relay. No-one wants to make one on purpose.

RFC2505: Anti-Spam Recommendations for SMTP MTAs from February 1999 already notices the issue:

2.1. Restricting unauthorized Mail Relay usage

Unauthorized usage of a host as Mail Relay means theft of the relay's resources and puts the relay owner's reputation at risk. It also makes it impossible to filter out or block spam without at the same time blocking legitimate mail.

Therefore, the MTA MUST be able to control/refuse such Relay usage.

Instead, you should use submission for outgoing mail. From outside it should have SASL authentication. From internal network it can relay without authentication based on the trusted network.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.