Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:spamd [2022/07/10 22:03] – [Spam] darrontools:spamd [2022/07/12 13:25] (current) – external edit 127.0.0.1
Line 56: Line 56:
  
 <code> <code>
-:...skipping... 
 #! /usr/bin/perl #! /usr/bin/perl
 # #
 # By # By
-#       Darron M Broad 2022+#       Darron M Broad, July 2022
 # #
-# See:+# See
 #       https://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_Plugin.html #       https://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_Plugin.html
 #       https://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_Logger.html #       https://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_Logger.html
-#       https://spamassassin.apache.org/full/3.3.x/doc/Mail_SpamAssassin_PerMsgStatus.html+#       https://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_PerMsgStatus.html
 # #
 # /etc/spamassassin/local.cf: # /etc/spamassassin/local.cf:
-# 
 #       loadplugin LocalPlugin /etc/spamassassin/local/plugin.pm #       loadplugin LocalPlugin /etc/spamassassin/local/plugin.pm
-# 
 #       header          LOCAL_FAKE_LIST eval:check_for_fake_list() #       header          LOCAL_FAKE_LIST eval:check_for_fake_list()
 #       score           LOCAL_FAKE_LIST 100 #       score           LOCAL_FAKE_LIST 100
Line 102: Line 99:
         my($self, $permsgstatus) = @_;         my($self, $permsgstatus) = @_;
  
-        $path = $permsgstatus->get("EnvelopeFrom");+        $from = $permsgstatus->get("EnvelopeFrom");
         my @to = split /@/, $permsgstatus->get("To:addr"); # x@y.z         my @to = split /@/, $permsgstatus->get("To:addr"); # x@y.z
         my $name = $to[0];         my $name = $to[0];
         my $host = $to[1];         my $host = $to[1];
-        if ($name && $host) { +        if ($from && $name && $host) { 
-                $s = "mail-$name=$host\@mail\."; +                # *mail-user=host@mail.* 
-                if ((rindex $path, $s, 0) == 0) { +                if ((index $from"mail-$name=$host\@mail\.") > 0) { 
-                        info("LocalPlugin: SPAM $path");+                        info("LocalPlugin: SPAM $from");
                         return 1;                         return 1;
                 }                 }
-                $s = "newsletter-$name=$host\@mail\."; +                newsletter-user=host@mail.* 
-                if ((rindex $path, $s, 0) == 0) { +                if ((rindex $from"newsletter-$name=$host\@mail\.", 0) == 0) { 
-                        info("LocalPlugin: SPAM $path");+                        info("LocalPlugin: SPAM $from");
                         return 1;                         return 1;
                 }                 }
Line 125: Line 122:
 # vim: shiftwidth=4 tabstop=4 noexpandtab # vim: shiftwidth=4 tabstop=4 noexpandtab
 </code> </code>
- 
  
 ===Spam=== ===Spam===