2014-11-03 11:51, Paul Stead wrote:
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?

--- 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;
 }

I agree that would make a trivial yet useful addition to functionality.
It probably does not help with PR #7080, but may be useful with other
mentioned applications. Will add something along these lines, thanks!

  Mark

Reply via email to