LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-12-2011, 06:20 PM   #1
the_apostle21
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
restrict outgoing mail with postfix


Hi,

We currently have 2 linux email servers, which we want to merge into one. They are running RHEL5, Dovecot for IMAP/POP, and SMTP i assume is running through Postfix (Sorry, I inherited these and my Linux skills that great!). These are used for internal email only.

Both servers are setup so only certain users can send to non-trusted domains (config is the same as this link - http://www.postfix.org/RESTRICTION_CLASS_README.html, bottom of the page). One server works, the other doesn't. I have trolled a lot of forums, but cannot find an answer.

I believe it is using postfix, as if i remove the line "permit_mynetworks" from "smtpd_recipient_restrictions" in the main.cf, all email stops working.

My assumption is that username/email is not finding a match in the /etc/postfix/restricted_senders file, but i have tried different possibilities with no success. Is there a log file i can check which shows postfix errors or email traces?

Any thoughts? I can post some configs if you need them.

Thanks in advance.
 
Old 09-14-2011, 02:30 PM   #2
gorav
LQ Newbie
 
Registered: Sep 2007
Posts: 11

Rep: Reputation: 0
Are both servers running different domains? Are they using mysql database or linux users? What is the pop/smtp software running.

Further details will be required before anything can be concluded. Also posting main.cf of both servers may help.

Regards,
Gorav
 
Old 09-15-2011, 06:41 PM   #3
the_apostle21
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi gorav,

main.cf files are attached for both servers.

They are on different domains. The server that isn't working was connected to Active Directory at some point - I'm not sure if it still is or not.

The logins are all linux users.

Dovecot is used for POP/IMAP. In regards to SMTP, I assume it is using postfix on both servers. As mentioned before, I removed the line "permit_mynetworks" from "smtpd_recipient_restrictions" in the main.cf and all emails were bouncing, which points me to postfix controlling the SMTP.

Thanks
Attached Files
File Type: txt postfix-working.txt (27.5 KB, 15 views)
File Type: txt postfix-notworking.txt (27.7 KB, 12 views)
 
Old 09-21-2011, 06:33 PM   #4
the_apostle21
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
bump.

Can anyone assist with this? or point me in a direction for diagnosis?

Thanks
 
Old 09-26-2011, 12:20 AM   #5
gorav
LQ Newbie
 
Registered: Sep 2007
Posts: 11

Rep: Reputation: 0
Error log

What error does it show in /var/log/maillog?

Also, permitting emails for mynetwork is a bad idea as it becomes open relay host which can usually is undesirable.

My email id is gorav(at)impactservices(dot)in
 
Old 09-26-2011, 01:05 AM   #6
the_apostle21
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi gorav,

The maillog has some detail. Here are the extracts from my test emails:

WORKING
Sep 27 00:51:08 sendmail postfix/smtpd[15189]: connect from gm716pc1[10.110.12.151]
Sep 27 00:51:08 sendmail postfix/smtpd[15189]: NOQUEUE: reject: RCPT from gm716pc1[10.110.12.151]: 554 5.7.1 <innaloo312@*****.biz>: Sender address rejected: Access denied; from=<innaloo312@*****.biz> to=<*****@bigpond.com> proto=SMTP helo=<GM716PC1>
Sep 27 00:51:08 sendmail postfix/smtpd[15189]: disconnect from gm716pc1[10.110.12.151]


NOT WORKING
Sep 26 14:34:52 dovecot postfix/smtpd[7236]: connect from gm716pc1[10.110.12.151]
Sep 26 14:34:52 dovecot postfix/smtpd[7236]: CDA6CB50043: client=gm716pc1[10.110.12.151]
Sep 26 14:34:52 dovecot postfix/cleanup[7204]: CDA6CB50043: message-id=<665A65D5EA7A40F6BB71E011BDB9EF12@GM716PC1>
Sep 26 14:34:52 dovecot postfix/qmgr[30426]: CDA6CB50043: from=<test999@*****.biz>, size=1331, nrcpt=1 (queue active)
Sep 26 14:34:52 dovecot postfix/smtpd[7236]: disconnect from gm716pc1[10.110.12.151]
Sep 26 14:34:52 dovecot postfix/smtp[7353]: CDA6CB50043: to=<*****@bigpond.com>, relay=exchange.***.local[10.110.1.5]:25, delay=0.15, delays=0.06/0/0/0.09, dsn=2.6.0, status=sent (250 2.6.0 <665A65D5EA7A40F6BB71E011BDB9EF12@GM716PC1> Queued mail for delivery)
Sep 26 14:34:52 dovecot postfix/qmgr[30426]: CDA6CB50043: removed
Sep 26 14:34:53 dovecot dovecot: IMAP(test999.*****.biz): Effective uid=758, gid=504, home=/home/*****/homes/test999
Sep 26 14:34:53 dovecot dovecot: IMAP(test999.*****.biz): maildir: data=/home/*****/homes/test999/Maildir
Sep 26 14:34:53 dovecot dovecot: IMAP(test999.*****.biz): maildir: root=/home/*****/homes/test999/Maildir, index=/home/*****/homes/test999/Maildir, control=, inbox=
Sep 26 14:34:53 dovecot dovecot: imap-login: Login: user=<test999.*****.biz>, method=PLAIN, rip=::ffff:10.110.12.151, lip=::ffff:10.110.1.6
Sep 26 14:34:53 dovecot dovecot: IMAP(test999.*****.biz): Disconnected: Logged out


Note that I put ***** to blank out some detail.


I also found this in the log of the server that isnt working:

Sep 26 14:14:24 dovecot postfix/smtpd[6091]: warning: database /etc/postfix/restricted_senders.db is older than source file /etc/postfix/restricted_senders
Sep 26 14:14:24 dovecot postfix/smtpd[6091]: warning: database /etc/postfix/local_domains.db is older than source file /etc/postfix/local_domains

Is this the cause of the issue?

Thanks
 
Old 10-19-2011, 10:58 PM   #7
the_apostle21
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
...bump...

Can anyone help at all?
 
Old 10-20-2011, 12:34 AM   #8
gorav
LQ Newbie
 
Registered: Sep 2007
Posts: 11

Rep: Reputation: 0
You may need professional help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting up postfix for outgoing mail sneakyimp Linux - Server 3 07-28-2011 01:47 PM
Postfix: Disable outgoing mail dvishloff Linux - Server 1 05-13-2009 03:11 PM
Postfix - Configuration to Forward Outgoing Mail Elsewhere Ruler2112 Linux - Server 7 09-15-2008 05:55 PM
Postfix, copy all outgoing mail to admin account. exodist Linux - Software 8 02-01-2008 10:39 AM
Outgoing Only mail server using Postfix opnsrc Linux - Networking 0 06-15-2006 11:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration