Postfix: reject emails for list of recipient domains
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: reject emails for list of recipient domains
Hi,
I am running postfix . I have a list of domains for which i am currently receiving emails.
I want to block/reject all the emails with recipient contains these domains.Can i get a detail example how to reject emails in postfix for particular list of domains.
I have a bit of idea that we can use smtp_recipient_restriction parameter with access files containing domains to reject email for .
Can someone give me an example of it ?
i have domains like:
example1.com
example2.com
for which i am allowing to accept emails for delivery but now i want to have them rejected.
Without knowing more about how you have configured Postfix, it is not so easy to tell you exactly what changes you ought to make in order to reject these domains. But here are some thoughts that may point the way:
1. In the file /etc/postfix/main.cf, you probably have a declaration that starts out mydestinations, with a list of domain names that Postfix will act on behalf of. Remove the domains that you want to block from your server,
and Postfix will no longer accept mail for those destinations.
2. Mail will still arrive, though, as long as the DNS system has MX records for those domains that point to your server as a Mail eXchanger. If you have control of these records, remove your actual domain name or IP address from them. If not, you will just see a bunch of reject messages in the mail log file.
If these suggestions do not help, perhaps you should post your /etc/postfix/main.cf file for comment or further analysis.
I am receiving a lot of spam from different IPs, making it difficult to block by IP number, but the suffix on the mail is usually the same, ie .stream... I have seen in previous posts, that /etc/postfix/access can be used to block by the FQDN, but need to find out if the incoming mail can be blocked by using the shorter name or perhaps using something like *, as a wildcard, if it is needed. Just listing the suffix does not seem to be working...ie .baddomain ...
Any suggestions on how to proceed??
thanks,
gary
I am receiving a lot of spam from different IPs, making it difficult to block by IP number, but the suffix on the mail is usually the same, ie .stream... I have seen in previous posts, that /etc/postfix/access can be used to block by the FQDN, but need to find out if the incoming mail can be blocked by using the shorter name or perhaps using something like *, as a wildcard, if it is needed. Just listing the suffix does not seem to be working...ie .baddomain ...
Any suggestions on how to proceed??
thanks,
gary
Please, see the LQ Rules and Question Guidelines....you have re-opened a thread that's been closed for EIGHT YEARS, to post your own question to it. Please open your own thread for your own question.
You should look into loading spamassassin or another spam filter with postfix...it does exactly the type of things you're after.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.