LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Postfix's mynetworks not working (https://www.linuxquestions.org/questions/linux-general-1/postfixs-mynetworks-not-working-822444/)

grob115 07-27-2010 10:03 AM

Postfix's mynetworks not working
 
Am trying to set Postfix to only allow specific machines in the network to connect and send mail through it. However, it doesn't appear that it's working properly.

Some background:
Test Outlook Client running on 192.168.10.11

Postfix's main.cf has the following:
mynetworks = 192.168.0.1
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

When I Add Account on Outlook, and use the Test Account Settings, it was able to send a test mail to a user on the Postfix server. What I don't understand is how, given the Outlook has an IP that is not set for the "mynetworks" variable. In addition, I typed in the name "abcd" with no password on the Outlook account, and the test mail arrived in one of the user's mailbox on the Postfix server.

Any ideas?

kbp 07-27-2010 05:25 PM

The mynetworks directive defines who the server will send outbound mail or relay for. The server will usually accept mail for local recipients by default, to test your 'mynetworks' directive, try to use the Outlook client to send an email to an recipient on the internet.

You may want to include 'localhost' as well -
Code:

mynetworks = 192.168.0.1, 127.0.0.0/8
cheers

grob115 07-28-2010 06:33 PM

Thanks. I tested it out and yes it does ban relaying to external users (ie e-mail not within the same domain name) but continue to allow mails to be sent to users on the mail server. I wonder if this can be changed.

I also implemented SASL authentication for Outlook based on /etc/passwd. Works like a charm, though initially struggled to get it to work because SELinux blocked access to a socket file used by SASL. Luckily I found some instructions on a site.... I think Postfix?

Now I'm battling with how I can get Dovecot to work in order to have POP since I upgraded to MySQL 5.1 and the libmysqlclient.so.15 has been changed to libmysqlclient.so.16, which is not recognized by Dovecot. I posted another thread here for this.

So many issues just to get something simple to be installed. Wonder when we can be like Windows one day when it's so much easier.

kbp 07-29-2010 07:33 AM

Quote:

I wonder if this can be changed
.. that's not it's purpose, there are plenty of other directives for that - http://www.postfix.org/SMTPD_ACCESS_README.html


All times are GMT -5. The time now is 01:43 PM.