Postfix Relay - Configuration without Auth

Tags: #<Tag:0x00007f4f43302d18>


I need to setup postfix to relay using an SMTP server. There is no AUTH LOGIN so I do not need to setup the usual sasl_passwd file.

Telnet Successful
I can successfully use telnet to send an email from the SMTP server.
[1] telnet relayserverdomainFQDN 25
[2] EHLO
[3] MAIL
[4] RCPT
[5] DATA – add body content

Postfix Setup Not Successfull
[1] Add this value to /etc/postfix/
relayhost = [relayserverdomainFQDN]:25
[2] postfix reload
[3] sudo -u asterisk mail -s TestEmail
Result: No relay. Email sent directly from server.

(Andrew) #2

You may need to set the mynetworks variable in So assuming your internal network is

mynetworks =


No dice on the modified values:

relayhost = [relayaddress]:25
mynetworks =

(Andrew) #4

May also need to specify:

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

Make sure to restart postfix after the changes as well.


Went ahead and added that line as well as a postfix reload and service postfix restart. No luck.

(Andrew) #6

Try adding check_recipient_access hash:/etc/postfix/access.recipients in the smtpd_recipient_restrictions variable. So:

smtpd_recipient_restrictions = 
   check_recipient_access hash:/etc/postfix/access.recipients

then create /etc/postfix/access.recipients and in it put all recipient domains you want to allow OK

Then run postmap /etc/postfix/access.recipients and restart postfix. If it’s not that then it’s past my postfix knowledge, sorry :frowning:


While it didn’t, I do appreciate all of your help! It was a valiant effort. If I can figure this out, I’ll share the solution.



[1] Turns out the relay was actually working (I didn’t have access to the SMTP server itself), but it kept the source from address.

[2] Edit generic file
Add: sourcefrom desiredfrom
i.e., freepbx.local

[3] Add to
smtp_generic_maps = hash:/etc/postfix/generic

[4] Run postmap against generic

[5] reload postmap; restart postmap; run test email

(Andrew) #9

Lol I literally offered this solution to someone recently here. Good work figuring it out!

(system) closed #10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.