Badmailfromto whitespace (#273)
* Fix Can't call method 'notes' on unblessed reference in plugins/logging/file. * Allow white space rather than just a single tab character in the badmailfromto configuration file.
This commit is contained in:
parent
494dc95b72
commit
4e8cb7baf5
@ -8,7 +8,7 @@ badmailfromto - checks the badmailfromto config
|
|||||||
|
|
||||||
Much like the similar badmailfrom, this plugin references both the
|
Much like the similar badmailfrom, this plugin references both the
|
||||||
FROM: and TO: lines, and if they both are present in the badmailfromto
|
FROM: and TO: lines, and if they both are present in the badmailfromto
|
||||||
config file (a tab delimited list of FROM/TO pairs), then the message is
|
config file (a whitespace-delimited list of FROM/TO pairs), then the message is
|
||||||
blocked as if the recipient (TO) didn't exist. This is specifically designed
|
blocked as if the recipient (TO) didn't exist. This is specifically designed
|
||||||
to not give the impression that the sender is blocked (good for cases of
|
to not give the impression that the sender is blocked (good for cases of
|
||||||
harassment).
|
harassment).
|
||||||
@ -54,7 +54,7 @@ sub hook_rcpt {
|
|||||||
};
|
};
|
||||||
|
|
||||||
foreach ($self->qp->config("badmailfromto")) {
|
foreach ($self->qp->config("badmailfromto")) {
|
||||||
my ($from, $to) = m/^\s*(\S+)\t(\S+).*/;
|
my ($from, $to) = m/^\s*(\S+)\s+(\S+).*/;
|
||||||
if ( lc($from) eq $sender && lc($to) eq $recipient ) {
|
if ( lc($from) eq $sender && lc($to) eq $recipient ) {
|
||||||
return DENY, "mail to $recipient not accepted here";
|
return DENY, "mail to $recipient not accepted here";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user