LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-19-2018, 05:08 AM   #1
linpi
LQ Newbie
 
Registered: Mar 2018
Posts: 4

Rep: Reputation: Disabled
Postfix - blocking spammer domains


hello,
on a small server, I use Postfix version 2.11 (debian) and want to reject some spam domains which for example dbl[dot]spamhaus[dot]org doesn't seem to recognize.
her a part of my configuration:
Code:
smtpd_sender_restrictions =
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_unknown_sender_domain,
   reject_non_fqdn_sender,
   check_sender_access pcre:/etc/postfix/spam_sender_addr_pcre
   permit


smtpd_recipient_restrictions =
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_unauth_destination,
   reject_invalid_hostname,
   reject_non_fqdn_sender,
   reject_non_fqdn_recipient,
   reject_unknown_sender_domain,
   reject_unknown_recipient_domain,
   check_client_access hash:/etc/postfix/rbl_whitelist,
    reject_rbl_client  ...
    reject_rhsbl_client dbl[dot]spamhaus[dot]org,
    check_recipient_access pcre:/etc/postfix/spam_rec_addr_pcre,
   check_policy_service inet:127.0.0.1:10031
   permit
When I try one of the spam domain that I receive lately "...@es2[dot]trmaildat[dot]com"

Code:
postmap -q es2[dot]trmaildat[dot]com pcre:/etc/postfix/spam_sender_addr_pcre
I get the expected REJECT

here the one line of spam_sender_addr_pcre:
Code:
/.*es2.trmaildat.com/i REJECT
but still I receive emails from ...@es2[dot]trmaildat[dot]com.

what is wrong with this configuration ?
before using pcre, I tried a hash file, but it didn't work either.
thank you for some hints!
 
Old 03-20-2018, 06:46 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,147

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Are you sure that address is the envelope sender?

Please post the portion of /var/log/maillog which shows the reception.
 
Old 03-20-2018, 09:49 AM   #3
linpi
LQ Newbie
 
Registered: Mar 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
here
Quote:
Mar 19 17:03:55 miranda postfix/cleanup[1407]: 912172F911F: message-id=<20180319160132.8425A2461BC@es2.trmaildat.com>
Mar 19 17:03:55 miranda postfix/qmgr[12306]: 912172F911F: from=<052454857a4-8-314@globe-yellow-pages.com>, size=56112, nrcpt=1 (queue active)
Mar 19 17:03:55 miranda postfix/smtpd[1414]: disconnect from localhost[127.0.0.1]
Mar 19 17:03:55 miranda amavis[955]: (00955-15) Passed SPAM {RelayedTaggedInbound,Quarantined}, [127.0.0.1] [185.111.183.36] <052454857a4-8-314@globe-yellow-pages.com> -> <xyz@gottsdorf.de>, quarantine: U/spam-UN6HU2RREwdg.gz, Message-ID: <20180319160132.8425A2461BC@es2.trmaildat.com>, mail_id: UN6HU2RREwdg, Hits: 6.589, size: 55011, queued_as: 912172F911F, 6771 ms
Mar 19 17:03:55 miranda postfix/smtp[1408]: 8793F2F80BD: to=<xyz@gottsdorf.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=33, delays=26/0/0/6.8, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 912172F911F)
Mar 19 17:03:55 miranda postfix/qmgr[12306]: 8793F2F80BD: removed
ok, it seems the sender address is globe-yellow-pages.com... right ?
 
Old 03-22-2018, 09:49 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,147

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
from=<052454857a4-8-314@globe-yellow-pages.com>,

host globe-yellow-pages.com
globe-yellow-pages.com has address 192.64.119.78
globe-yellow-pages.com mail is handled by 10 mail.globe-yellow-pages.com.
host mail.globe-yellow-pages.com
mail.globe-yellow-pages.com has address 80.211.229.185

but this is from 185.111.183.36 so it seems to be lying.

jwhois 185.111.183.36
netname: Biz-catalogs

Says network 185.111.183.0 - 185.111.183.255 is a good candidate for the block list.
 
Old 03-22-2018, 03:06 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by smallpond View Post
Says network 185.111.183.0 - 185.111.183.255 is a good candidate for the block list.
Agreed. At least none of my customers need to receive email from Lithuania.

I don't know how to do it in postfix, but spam blocking by domain name is pretty hit-and-miss, because of forgeries; but an MTA always knows the IP of the server delivering the email, so blocking by IP address/range is very effective.

[PS: Note that "by IP" is how SORBS, spamcop, and SBL-XBL do their RBL (Real-time Block List) blocking, not by domain name]

Last edited by scasey; 03-22-2018 at 03:10 PM.
 
  


Reply



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
Blocking domains in services Melete Linux - Newbie 2 08-22-2017 06:01 PM
[SOLVED] Blocking domains at specific times sabresong Linux - Networking 2 01-05-2012 06:58 PM
Blocking mails from specific email addresses/domains in postfix jomy Linux - Networking 1 07-15-2008 08:32 PM
Postfix - how do hosted domains download their mail from my postfix franschoek Linux - Software 1 04-01-2006 09:41 PM
EXIM blocking domains n3r0 Debian 3 09-22-2004 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:05 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
Open Source Consulting | Domain Registration