How to Mail Rule for empty senders?

itechniker

Member
Jan 6, 2022
8
0
21
32
Dear experts,

does someone know why my rule is not hitting the mails with empty senders?

I think it has to do with my What-Filter, do I maybe have to filter for field "Return-Path"?

1770378416167.png
1770378483577.png

1770378778694.png

There is a mail with empty sender which is blocked, but beacuse of another rule with lower priority:

2026-02-06T10:23:28.239058+01:00 antispam postfix/smtpd[490029]: connect from ip74-208-70-90.pbiaas.com[74.208.70.90]
2026-02-06T10:23:29.523534+01:00 antispam postfix/smtpd[490029]: 7F952A04AF: client=ip74-208-70-90.pbiaas.com[74.208.70.90]
2026-02-06T10:23:29.712613+01:00 antispam postfix/cleanup[490031]: 7F952A04AF: message-id=<58be62a3-f098-4111-85b3-9e280ae0d089@ip74-208-70-90.pbiaas.com>
2026-02-06T10:23:29.714493+01:00 antispam postfix/qmgr[800]: 7F952A04AF: from=<>, size=12677, nrcpt=1 (queue active)
2026-02-06T10:23:29.715344+01:00 antispam postfix/smtpd[490029]: disconnect from ip74-208-70-90.pbiaas.com[74.208.70.90] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
2026-02-06T10:23:29.777359+01:00 antispam pmg-smtp-filter[489896]: 1020406985B311B95A5: new mail message-id=<58be62a3-f098-4111-85b3-9e280ae0d089@ip74-208-70-90.pbiaas.com>
2026-02-06T10:23:31.208368+01:00 antispam pmg-smtp-filter[489896]: 1020406985B311B95A5: SA score=28/5 time=1.231 bayes=1.00 autolearn=no autolearn_force=no hits=AWL(1.198),BAYES_99(6),BAYES_999(0.2),DATE_IN_FUTURE_03_06(3.027),DMARC_REJECT(0.1),HTML_MESSAGE(0.001),HTML_OBFUSCATE_05_10(0.26),KAM_DMARC_REJECT(5),KAM_DMARC_STATUS(0.01),KAM_NUMSUBJECT(0.5),KAM_SHORT(0.001),KHOP_HELO_FCRDNS(0.8),MIME_HTML_MOSTLY(0.1),MPART_ALT_DIFF(1),RCVD_IN_SBL(1),RCVD_IN_SBL_CSS(5),RDNS_DYNAMIC(3.5),SPF_HELO_SOFTFAIL(0.732)
2026-02-06T10:23:31.220290+01:00 antispam pmg-smtp-filter[489896]:[COLOR=rgb(184, 49, 47)] 1020406985B311B95A5: block mail to <xxxxxx> (rule: Block Spam (Level 20))[/COLOR]
2026-02-06T10:23:31.224335+01:00 antispam pmg-smtp-filter[489896]: 1020406985B311B95A5: processing time: 1.461 seconds (1.231, 0.188, 0)
2026-02-06T10:23:31.225197+01:00 antispam postfix/lmtp[490032]: 7F952A04AF: to=<xxxxxx>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.8, delays=0.32/0/0.04/1.5, dsn=2.7.0, status=sent (250 2.7.0 BLOCKED (1020406985B311B95A5))
2026-02-06T10:23:31.225980+01:00 antispam postfix/qmgr[800]: 7F952A04AF: removed
 
copy folder and all fiels from
/var/lib/pmg/templates
to
/etc/pmg/templates

Edit the files: /etc/pmg/templates/main.cf.in
at the smtpd_sender_restrictions part,
add below content:
check_sender_access regexp:/etc/postfix/Blocked_Sender_Domain

Edit the file: /etc/postfix/Blocked_Sender_Domain
add below content:
/<>/ REJECT Null sender address is not accpeted by our server!

Restart the postfix
 
  • Like
Reactions: itechniker