Avatar of Ricky Nguyen
Ricky Nguyen
Flag for Australia asked on

Postfix Mail Relay for Local Network

Hi Experts,

I've been trying to setup my Postfix Email Server but having no luck so I bought a book call "The Book of Postfix". In Chapter 4, it says, in order to allow local network to relay, we just need to configure "mynetworks" as per below statement.


Is this correct? I was told differently from another posting:

https://www.experts-exchange.com/Software/Server_Software/Email_Servers/Q_27695984.html

Shouldn't you need to configure SASL in order to relay?

Any comments would be appreciated.

Regards,
Rick
Linux NetworkingLinux

Avatar of undefined
Last Comment
Ricky Nguyen

8/22/2022 - Mon
arnold

SASL deals with users authenticating prior to sending.  mynetworks defines who can relay through the server without the need to authenticate on the local network.
You would not want to define a Public (external IP/Range of IPs) as allowed to relay through your server as the other post referenced unless:
1) you own and have full control of the segments in question.
2) You make sure if you do not own the segments to remove them from the configuration once you no longer control them.  While it is not likely that the next party that gets those IP allocated will know that your email server is open to them to relay through, it is best to maintain a concise definition/configuration.
Ricky Nguyen

ASKER
Ok thanks arnold. But all ive been trying to do is to send a test mail from the local network or more speecifically send from the server itself. Why would it reject my mails for relaying if im on the local network and as u just said should be allowed without authentication?

Could u think of any other reason for postfix to reject my mails relaying?
arnold

Need to see the logs detailing the error to know what might be going on.
How are you trying to send emails from the server?
Do you use a web interface with a form that emails? (check whether the apache user is blocked from sending)
Are you using mail/mailx to compose the message?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
SOLUTION
David Beveridge

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
David Beveridge

Of course if you wanted to use SASL then you'd need an entry in there for it too.
And you'd need to provide all the other parameters to configure SASL.
Ricky Nguyen

ASKER
Hi arnold/bevhost, thanks for your replies.

Bevhost, I just want to get the basics first then add the extra layers later. So don't really want to tackle SASL setup right now, unless you say its an easier approach..

I tried uninstalling and re-installing postfix because I thought I made a mess of it but now not even sending mail within local network is working.

Please see log below:
maillog
Main.cf:
maincf
Ricky Nguyen

ASKER
Sorry arnold, I was using telnet to send emails.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
arnold

mynetworks defined the source IPs from which connecting clients can relay.
Nothing from the public network will be allowed to relay with the exception of the relay_domain. That brings, you should request attention and have the last few mages removed given you have a defined relay_domains which sets your server as a relay for the domain and could be used to spam that domain.

Are you certain that the relayhost should be using port 2525?
Ricky Nguyen

ASKER
I'm certain the relayhost is using port 2525.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Ricky Nguyen

ASKER
Ok here it is
telnet
Your help has saved me hundreds of hours of internet surfing.
fblack61
Ricky Nguyen

ASKER
Not sure where the quota of 100. Need to check with tzo.
arnold

They seem to only allow 100 connections/transmissions from you.
It seems as this host is designated for email client setup versus an email server relaying through them.
Ricky Nguyen

ASKER
They store and forward emails for me. So I need to be able to handle the mail when it arrives as well as direct my email server to point to them ie. mail.omr.tzo.com when sending emails.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
arnold

Check with them what the quota means? Is this a time based limitation, or as indicated a connection count based limitation.
Ricky Nguyen

ASKER
Many thanks experts. I'll raise my follow up question in a new post.