LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-02-2008, 09:12 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
postfix: only accept relay mail from authenticated users


hi!

I've set up postfix to get collect mails for a given domain and also relay mail to any other domain (mynetworks = 0.0.0.0/0) so that people is able to send mails using our SMTP, however I want only authenticated users to be able to send mails to other domains and not just anyone. Is there an easy way to ask for that (and at the same time continue accepting any mail to our local domain)?

Thanks in advance.
 
Old 10-02-2008, 09:41 AM   #2
racracracrac
Member
 
Registered: Sep 2008
Posts: 44

Rep: Reputation: 15
In smtpd_recipient_restrictions, you need to add "permit_sasl_authenticated,reject_unauth_destination" at the first

Here is mine:

smtpd_recipient_restrictions = permit_sasl_authenticated, reject_rbl_client bl.spamcop.net, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client list.dsbl.org, reject_rbl_client rbl.mail-abuse.org, reject_rbl_client spamsources.fabel.dk, permit_mynetworks, reject_invalid_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_destination

Last edited by reddazz; 10-14-2008 at 06:43 PM. Reason: removed spammed link
 
Old 10-02-2008, 09:46 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
That's right, racra.

With only this, it worked (I was asking on the irc channel of postfix as well):
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination

Thanks for your kind reply anyway. :-)
 
Old 10-04-2008, 05:02 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Quote:
Originally Posted by racracracrac View Post
In smtpd_recipient_restrictions, you need to add "permit_sasl_authenticated,reject_unauth_destination" at the first

Here is mine:

smtpd_recipient_restrictions = permit_sasl_authenticated, reject_rbl_client bl.spamcop.net, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client list.dsbl.org, reject_rbl_client rbl.mail-abuse.org, reject_rbl_client spamsources.fabel.dk, permit_mynetworks, reject_invalid_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_destination
You should reorder your checks:
Code:
smtpd_recipient_restrictions = 
   reject_non_fqdn_recipient,
   reject_non_fqdn_sender,
   reject_unlisted_recipient
the above are cheap; perform them first
   permit_mynetworks,
   permit_sasl_authenticated, 
now accept your networks and authenticated users
   reject_unauth_destination,
   reject_invalid_hostname,
in >2.3, reject_invalid_hostname is changed to reject_invalid_helo_hostname
   reject_unknown_sender_domain,
   reject_unknown_recipient_domain
your expensive rbl checks should be done last (require dns lookups on external servers)
   reject_rbl_client sbl-xbl.spamhaus.org, 
consider replacing with zen.spamhaus.org, which includes sbl + xbl + pbl. In any event, spamhaus is better suited to go before spamcop.
   reject_rbl_client bl.spamcop.net,
   reject_rbl_client list.dsbl.org, 
   reject_rbl_client rbl.mail-abuse.org, 
   reject_rbl_client spamsources.fabel.dk,
There are helo checks you can perform too before rbl checks which will weed out loads of spam.
 
  


Reply

Tags
relay


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
disable sendmail relay check for authenticated users sunethj Linux - Server 0 08-15-2007 12:05 AM
Postfix as a mail relay (getting relay access denied) hypexr Linux - Software 3 09-13-2005 08:15 PM
Help getting Postfix to accept mail from anywhere nevarlen Linux - Networking 4 06-23-2005 06:53 AM
Postfix - relay mail to internet for specified users FatOldSun Linux - Software 2 03-21-2005 04:32 AM
Postfix Authenticated mail servers MaverickApollo Linux - Software 1 01-06-2004 04:23 PM


All times are GMT -5. The time now is 09:32 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration