Re: [SLE] Postfix: Blocking mails from a top-level domain



Joachim Schrod wrote:
Hello,

Perhaps someone can help me. I use Postfix 2.2.5-5 on SUSE 10.0.
I want to reject all emails where the (envelope) sender is from the top-level domain .biz.

Well, I thought, no problem, and added:

.biz REJECT

to the access map. The access map is used with

smtpd_sender_restrictions =
check_sender_access hash:/etc/postfix/access, permit

in main.cf.

Well, it doesn't work and I'm wondering why. E.g., an email with the sender <richard@xxxxxxxxxx> is still delivered.

When I use plain domain names in access, rejection works, but the TLD ".biz" does not work. According to the documentation, check_sender_access should "Search the specified access(5) database for the MAIL FROM address, domain, parent domains, or localpart@, and execute the corresponding action." But it doesn't search for the parent domain.

Can anybody help me and shed light on that problem?

If your version of Postfix supports pcre maps (it should), then the easy way out is here:

main.cf:
smtpd_sender_restrictions =
permit_mynetworks,
check_sender_access pcre:/etc/postfix/sender_access_pcre

pcre:/etc/postfix/sender_access_pcre:
/\.biz$/ 554 domain .biz not accepted as sender address

test with postmap:
postmap -q sender@xxxxxxxxxxx pcre:/etc/postfix/sender_access_pcre

To test pcre capability of your Postfix version:

# postconf -m
btree
cidr
environ
hash
ldap
mysql
nis
pcre <=
proxy
regexp
static
tcp
unix

Sandy
--
List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx



Relevant Pages

  • [SLE] Postfix: Blocking mails from a top-level domain
    ... I want to reject all emails where the sender is from the top-level domain .biz. ... to the access map. ... According to the documentation, check_sender_access should "Search the specified accessdatabase for the MAIL FROM address, domain, parent domains, or localpart@, and execute the corresponding action." ...
    (SuSE)
  • Re: Postfix-Sender and recipient restriction problem
    ... This is because Postfix is the Final Recipient for this domain. ... Mail server dont alert me "Sender address reject:User unknown in local ... allows mail relaying for all IPs you enter in mynetworks. ...
    (Debian-User)
  • Re: Postfix config - cron messages for root going to root@ISP.
    ... >> I have installed Postfix on Mandrake 10.1, ... Among his settings he recommends ... >> setting myorigin to be isp.net, so that my emails will appear to be from ... > If you don't plan on using postfix for your own domainname, ...
    (comp.os.linux.networking)
  • Re: question about sending mail and postfix
    ... All I need is for my system to send various administrative emails to my ... As you *explicitly* installed Postfix I thought you knew beforehand what ... As per your described setup, Postfix can do the job (sending e-mails to ... between you and your own host) but also can be used to ...
    (Debian-User)
  • AW: Postfix: copy of all outbounds relays to myself
    ... Optional address that receives a "blind carbon copy" of each message that is received by the Postfix mail system. ... To avoid mailer loops, automatic BCC recipients are not generated for mail that Postfix forwards internally, nor for mail that Postfix generates itself. ... I allow emails sent from the localhost. ...
    (Fedora)