0

I'm new to postfix server and trying to setup simple postfix server and client with below requirement-

Postfix server should be able to send mail to postfix clients with networks "192.168.100.0/24" and "172.25.1.0/24" but not to the clients having network - 10.10.1.0/24

Everywhere on internet its mentioned -
"You can specify the trusted networks in the main.cf file, or you can let Postfix do the work for you. The default is to let Postfix do the work. The result depends on the mynetworks_style parameter value. Alternatively, you can specify the mynetworks list by hand, in which case Postfix ignores the mynetworks_style setting."

So , below is my existing settings for postfix server in /etc/postfix/main.cf -

myhostname = mail.hr.example.com
mydomain = hr.example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.100.0/24, 127.0.0.0/8 , 172.25.1.0/24

IP address of postfix server is 192.168.100.10 and hostname is hr.example.com

Settings of Postfix client in /etc/postfix/main.cf is -

myhostname = mail.mkt.example.com
mydomain = mkt.example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 10.10.1.0/24, 127.0.0.0/8

IP address of postfix client is 10.10.1.12/24 and hostname is mkt.example.com

Below is output of sending mail from postfix server to postfix client -

[root@hr ~]# mail root@mkt.example.com
Subject: testing
hi
.
EOT

[root@mkt ~]# mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 12 messages 1 new 6 unread
N 12 root Sun Jun 11 17:45 21/784 "testing"
&

Have I understood "mynetwork" parameter worng here or is my configuration missing something ??

3

You misunderstand mynetworks. Those are "MY NETWORKS". That means that MY SAFE NETWORKS are these so go ahead and relay mail from these IP without authentication. Note the word "FROM". You want "TO". smtpd_recipient_restrictions =

But after reading your message several times, it's clear you don't have a good grasp of email servers. So get some reading done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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