I've got local_acl_check_data to reject the typical spammer tactic of using the same address as From: and To:, but since some less-spammy sources, such as Yahoo Groups, do this, I'm using a whitelist as well. Here is the ACL:
# block spammers who use the same "from" and "to" address accept senders = ${if exists{CONFDIR/local_sender_whitelist}\ {CONFDIR/local_sender_whitelist}\ {}} deny condition = ${if eqi{${address:$h_from:}}{${address:$h_to:}}{true}{false}} log_message = rejecting spam with to:${address:$h_to:} and from:${address:$h_from:} message = Message identified as spam. If you think this is wrong, get in touch with postmaster Problem is, when I test with:
jcomeau@tektonic:~$ cat bin/testacl exim4 -bh 66.163.168.186 <<EOT helo tester mail from: [email protected] rcpt to: [email protected] data from: [email protected] to: [email protected] subject: should be ok this one should not reject . mail from: [email protected] rcpt to: [email protected] data from: [email protected] to: [email protected] subject: should reject this one should be rejected . quit EOT It works as expected: the first message is accepted because it found yahoogroups.com in the whitelist, and the second was rejected. But in real operation, the yahoogroups.com emails are rejected by that ACL along with the spammers. I'm using 4.72-6, and this has happened for all the versions I've been using for the last few years. I've run out of ideas.
As requested, the log of exim4 rejecting a message which should have passed:
jcomeau@tektonic:~$ grep -C2 Freecycle /var/log/exim4/rejectlog 2011-02-25 09:52:00 1Psz1U-00020g-79 H=n52c.bullet.mail.sp1.yahoo.com [66.163.168.186] F=<sentto-15991578-2122-1298645513-jc=example.com@returns.groups.yahoo.com> rejected after DATA: rejecting spam with to:[email protected] and from:[email protected] Envelope-from: <sentto-15991578-2122-1298645513-jc=example.com@returns.groups.yahoo.com> Envelope-to: <[email protected]> -- MIME-Version: 1.0 I Message-ID: Mailing-List: list [email protected]; contact [email protected] Delivered-To: mailing list [email protected] List-Id: <PetalumaFreecycle.yahoogroups.com> Precedence: bulk List-Unsubscribe: <mailto:[email protected]> Date: 25 Feb 2011 14:51:53 -0000 F From: [email protected] T To: [email protected] Subject: [Petaluma Freecycle] Digest Number 2122 X-Yahoo-Newman-Property: groups-digest-trad-m R Reply-To: "No Reply"<[email protected]> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
And here's what my testacl script shows for the first test:
>>> using ACL "acl_check_data" >>> processing "accept" >>> check senders = ${if exists{/etc/exim4/local_sender_whitelist}{/etc/exim4/local_sender_whitelist}{}} >>> yahoogroups.com in "yahoogroups.com"? yes (matched "yahoogroups.com") >>> [email protected] in "/etc/exim4/local_sender_whitelist"? yes (matched "yahoogroups.com" in /etc/exim4/local_sender_whitelist) >>> accept: condition test succeeded LOG: 1PuxAz-0005jZ-B0 <= [email protected] H=n52c.bullet.mail.sp1.yahoo.com (tester) [66.163.168.186] P=smtp S=380 250 OK id=1PuxAz-0005jZ-B0