postfix: only accept relay mail from authenticated users
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.