2012-04-29 01:35:59 -07:00
|
|
|
#!perl -w
|
2013-04-21 00:50:39 -04:00
|
|
|
|
2012-04-07 20:11:16 -04:00
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
dont_require_anglebrackets
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
accept addresses in MAIL FROM:/RCPT TO: commands without surrounding <>
|
|
|
|
|
2012-04-28 23:46:15 -04:00
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
RFC821 requires that email addresses presented during the SMTP conversation
|
|
|
|
be enclosed in angle brackets. Like this:
|
|
|
|
|
|
|
|
MAIL FROM:<user@example.com>
|
|
|
|
|
|
|
|
This plugin relaxes that requirement, accepting messages in this format:
|
|
|
|
|
|
|
|
MAIL FROM:user@example.com
|
|
|
|
|
2012-04-07 20:11:16 -04:00
|
|
|
=cut
|
|
|
|
|
2006-04-07 18:58:02 +00:00
|
|
|
sub hook_mail_pre {
|
2013-04-21 00:50:39 -04:00
|
|
|
my ($self, $transaction, $addr) = @_;
|
2006-04-07 18:58:02 +00:00
|
|
|
unless ($addr =~ /^<.*>$/) {
|
2013-04-21 00:50:39 -04:00
|
|
|
$addr = '<' . $addr . '>';
|
2013-12-18 00:16:41 -05:00
|
|
|
$self->adjust_karma(-2);
|
|
|
|
$self->log(LOGINFO, "fail, added MAIL angle brackets");
|
2006-04-07 18:58:02 +00:00
|
|
|
}
|
2014-09-17 20:28:51 -05:00
|
|
|
return OK, $addr;
|
2006-04-07 18:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub hook_rcpt_pre {
|
2013-04-21 00:50:39 -04:00
|
|
|
my ($self, $transaction, $addr) = @_;
|
2006-04-07 18:58:02 +00:00
|
|
|
unless ($addr =~ /^<.*>$/) {
|
2013-04-21 00:50:39 -04:00
|
|
|
$addr = '<' . $addr . '>';
|
2013-12-18 00:16:41 -05:00
|
|
|
$self->adjust_karma(-2);
|
|
|
|
$self->log(LOGINFO, "fail, added RCPT angle brackets");
|
2006-04-07 18:58:02 +00:00
|
|
|
}
|
2014-09-17 20:28:51 -05:00
|
|
|
return OK, $addr;
|
2006-04-07 18:58:02 +00:00
|
|
|
}
|