LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-20-2022, 09:20 AM   #1
mike-2013
LQ Newbie
 
Registered: Aug 2013
Posts: 10

Rep: Reputation: Disabled
Postfix - Block domain


I can blacklist an entire domain by adding the line -
gmail.com REJECT You can contact us via our website.

That works and I can see the rejection in the mail logs but the sender doesn't receive the bounce message. If a block a specific user, e.g. -
spammer@gmail.com the sender does receive the bounce message. Is there a way to blacklist the entire domain so the sender does receive the bounce message?
 
Old 02-21-2022, 03:47 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Just a wild thought - maybe sth like
Code:
*@gmail.com
 
1 members found this post helpful.
Old 02-21-2022, 04:05 AM   #3
mike-2013
LQ Newbie
 
Registered: Aug 2013
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks. I had tried that (Great Minds ) but it didn't work. I think the problem is with gmail as a similar block on outlook.com does result in the sender receiving the bounce message.

We receive a lot of spam from these throwaway email addresses. The idea is to bounce messages from these addresses with a message asking genuine users of these services to contact us via a form on our website. Unforunately, if the sender doesn't receive the bounce message, she won't know. We may have to use a different strategy.
 
Old 02-21-2022, 05:07 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I have to admit I answered your post on a whim; I have never used postfix or run my own mailserver.


I made some searches on why the messages don't get delivered, and it appears that there's a lot more options to consider, and the syntax is a proper regex and not a simple glob pattern.

Some random links from a quick search:
https://www.linuxbabe.com/mail-serve...l-spam-postfix
https://blog.tinned-software.net/per...using-postfix/
https://serverfault.com/questions/66...ostfix/1041475
https://serverfault.com/questions/53...ess-in-postfix
https://nacko.net/postfix-block-spec...ntos-6-rhel-6/

Even so, I can't help thinking that blocking ALL gmail addresses because of a few spammers is the wrong approach.
 
1 members found this post helpful.
Old 02-21-2022, 05:43 AM   #5
mike-2013
LQ Newbie
 
Registered: Aug 2013
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks for those links.

We deal mainly with business users who have email addresses on their own domains. We can whitelist the few who use services such as gmail after their initial contact using the website form. It may seem like a heavy handed approach and certainly isn't for everyone.
 
  


Reply

Tags
postfix



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
Can't get Postfix to block domain suffix deathsfriend99 Linux - Server 1 12-13-2016 10:11 AM
Postfix: block outgoing mail to any domain except one bas_at_cipix Linux - Server 2 05-11-2012 09:50 AM
[Postfix] Block sending emails outside of the domain fabler Linux - Server 0 07-07-2011 02:35 AM
Sendmail doubling sender domain- ex. hostname.domain.net.domain.net halborr Slackware 7 08-23-2010 08:37 AM
IPtables - block subdomains (a.domain.com, b.domain.com, c.domain.com,...) benjalien Linux - Networking 6 06-24-2009 07:03 AM

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

All times are GMT -5. The time now is 10:12 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