qpsmtpd/plugins/dont_require_anglebrackets
Ask Bjørn Hansen a23d4b3da9 Fix 01-syntax test failures
Exclude some tests with dependencies.

Remove -T from perl line in plugins
This makes it harder to test with PERL5LIB/perlbrew etc
2012-04-29 01:36:01 -07:00

39 lines
736 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 =~ /^<.*>$/) {
$addr = "<".$addr.">";
}
return (OK, $addr);
}
sub hook_rcpt_pre {
my ($self,$transaction, $addr) = @_;
unless ($addr =~ /^<.*>$/) {
$addr = "<".$addr.">";
}
return (OK, $addr);
}