fbdee49965
added max_size on config, so it's likely to get noticed, since even 1M is probably too low for most sites. This should likely default to the same as databytes?
43 lines
927 B
Perl
43 lines
927 B
Perl
#!perl -w
|
|
|
|
=head1 NAME
|
|
|
|
dont_require_anglebrackets
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
accept addresses in MAIL FROM:/RCPT TO: commands without surrounding <>
|
|
|
|
=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
|
|
|
|
=cut
|
|
|
|
sub hook_mail_pre {
|
|
my ($self, $transaction, $addr) = @_;
|
|
unless ($addr =~ /^<.*>$/) {
|
|
$self->log(LOGINFO, "added MAIL angle brackets");
|
|
$addr = '<' . $addr . '>';
|
|
$self->adjust_karma(-1);
|
|
}
|
|
return (OK, $addr);
|
|
}
|
|
|
|
sub hook_rcpt_pre {
|
|
my ($self, $transaction, $addr) = @_;
|
|
unless ($addr =~ /^<.*>$/) {
|
|
$self->log(LOGINFO, "added RCPT angle brackets");
|
|
$addr = '<' . $addr . '>';
|
|
$self->adjust_karma(-1);
|
|
}
|
|
return (OK, $addr);
|
|
}
|