I think a tag of SENDERDOMAIN would be handy to have so it can be used
with askdns and other rules which can make use of tags.

This would help address the following bug, which could be implemented
with a simple rule:

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7080

As well as the following mailing list posts:

http://spamassassin.1065346.n5.nabble.com/DMARC-policy-check-with-AskDNS-posible-td109426.html
http://spamassassin.1065346.n5.nabble.com/dnssec-dane-td110982.html#a112729
- My post

I'd suggest the following diff - is this in the best place and method to
accomplish this?

Index: lib/Mail/SpamAssassin/PerMsgStatus.pm
===================================================================
--- lib/Mail/SpamAssassin/PerMsgStatus.pm    (revision 1636308)
+++ lib/Mail/SpamAssassin/PerMsgStatus.pm    (working copy)
@@ -2864,6 +2864,9 @@
 ok:
   $envf =~ s/^<*//gs;                # remove <
   $envf =~ s/>*\s*$//gs;        # remove >, whitespace, newlines
+  my $fromdom = $envf;
+  $fromdom =~ s/.*\@//;
+  $self->set_tag('SENDERDOMAIN', $fromdom);
   return $envf;
 }

--
Paul Stead
Systems Engineer
Zen Internet

Reply via email to