Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:spamd [2022/07/10 21:54] – [Plugin] darron | tools:spamd [2022/07/12 13:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 56: | Line 56: | ||
< | < | ||
- | : | ||
#! / | #! / | ||
# | # | ||
# By | # By | ||
- | # | + | # |
# | # | ||
- | # See: | + | # See |
# | # | ||
# | # | ||
- | # | + | # |
# | # | ||
# / | # / | ||
- | # | ||
# | # | ||
- | # | ||
# | # | ||
# | # | ||
Line 102: | Line 99: | ||
my($self, $permsgstatus) = @_; | my($self, $permsgstatus) = @_; | ||
- | $path = $permsgstatus-> | + | $from = $permsgstatus-> |
my @to = split /@/, $permsgstatus-> | my @to = split /@/, $permsgstatus-> | ||
my $name = $to[0]; | my $name = $to[0]; | ||
my $host = $to[1]; | my $host = $to[1]; | ||
- | if ($name && $host) { | + | if ($from && |
- | | + | |
- | if ((rindex | + | if ((index $from, "mail-$name=$host\@mail\." |
- | info(" | + | info(" |
return 1; | return 1; | ||
} | } | ||
- | | + | |
- | if ((rindex $path, $s, 0) == 0) { | + | if ((rindex $from, " |
- | info(" | + | info(" |
return 1; | return 1; | ||
} | } | ||
} | } | ||
- | | + | |
} | } | ||
1; | 1; | ||
+ | |||
+ | # vim: shiftwidth=4 tabstop=4 noexpandtab | ||
</ | </ | ||
+ | |||
+ | ===Spam=== | ||
+ | |||
+ | Here is a PHP command line tool to send test spam. | ||
+ | |||
+ | Change Host, Sender and addAddress as appropriate. | ||
+ | |||
+ | < | ||
+ | #! / | ||
+ | <?php | ||
+ | /* DEBIAN BUSTER */ | ||
+ | require_once ' | ||
+ | require_once ' | ||
+ | require_once ' | ||
+ | require_once ' | ||
+ | require_once ' | ||
+ | |||
+ | use PHPMailer\PHPMailer\PHPMailer; | ||
+ | use PHPMailer\PHPMailer\SMTP; | ||
+ | use PHPMailer\PHPMailer\Exception; | ||
+ | |||
+ | $mail = new PHPMailer(true); | ||
+ | |||
+ | $mail-> | ||
+ | $mail-> | ||
+ | $mail-> | ||
+ | $mail-> | ||
+ | |||
+ | $mail-> | ||
+ | |||
+ | $mail-> | ||
+ | $mail-> | ||
+ | $mail-> | ||
+ | |||
+ | $mail-> | ||
+ | $mail-> | ||
+ | $mail-> | ||
+ | |||
+ | try { | ||
+ | $mail-> | ||
+ | } | ||
+ | catch (Exception $e) { | ||
+ | echo $e-> | ||
+ | } | ||
+ | /* | ||
+ | * vim: shiftwidth=4 tabstop=4 softtabstop=4 expandtab | ||
+ | */ | ||
+ | ?> | ||
+ | </ | ||
+ |