2012-04-29 10:35:59 +02:00
|
|
|
#!perl -w
|
2013-04-21 06:50:39 +02:00
|
|
|
|
2012-04-08 02:11:16 +02:00
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
dont_require_anglebrackets
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
accept addresses in MAIL FROM:/RCPT TO: commands without surrounding <>
|
|
|
|
|
2012-04-29 05:46:15 +02: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-08 02:11:16 +02:00
|
|
|
=cut
|
|
|
|
|
2006-04-07 20:58:02 +02:00
|
|
|
sub hook_mail_pre {
|
2013-04-21 06:50:39 +02:00
|
|
|
my ($self, $transaction, $addr) = @_;
|
2006-04-07 20:58:02 +02:00
|
|
|
unless ($addr =~ /^<.*>$/) {
|
2012-05-18 10:25:09 +02:00
|
|
|
$self->log(LOGINFO, "added MAIL angle brackets");
|
2013-04-21 06:50:39 +02:00
|
|
|
$addr = '<' . $addr . '>';
|
2013-04-30 04:06:47 +02:00
|
|
|
$self->adjust_karma(-1);
|
2006-04-07 20:58:02 +02:00
|
|
|
}
|
|
|
|
return (OK, $addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub hook_rcpt_pre {
|
2013-04-21 06:50:39 +02:00
|
|
|
my ($self, $transaction, $addr) = @_;
|
2006-04-07 20:58:02 +02:00
|
|
|
unless ($addr =~ /^<.*>$/) {
|
2012-05-18 10:25:09 +02:00
|
|
|
$self->log(LOGINFO, "added RCPT angle brackets");
|
2013-04-21 06:50:39 +02:00
|
|
|
$addr = '<' . $addr . '>';
|
2013-04-30 04:06:47 +02:00
|
|
|
$self->adjust_karma(-1);
|
2006-04-07 20:58:02 +02:00
|
|
|
}
|
|
|
|
return (OK, $addr);
|
|
|
|
}
|