my $forwardto = $ENV{MAPS_FORWARDTO} || 'adefaria@gmail.com';
# For some reason I'm not parsing messages correctly but it only seems to
# happen when the message is piped in from the MTA. This routine will
# temporarily save the messages in a file.
my $forwardto = $ENV{MAPS_FORWARDTO} || 'adefaria@gmail.com';
# For some reason I'm not parsing messages correctly but it only seems to
# happen when the message is piped in from the MTA. This routine will
# temporarily save the messages in a file.
while (!eof *$msgfile) {
my ($sender, $sender_long, $reply_to, $subject, $data) = ReadMsg (*$msgfile);
while (!eof *$msgfile) {
my ($sender, $sender_long, $reply_to, $subject, $data) = ReadMsg (*$msgfile);
- # Special sender handling:
- if ($sender !~ /.+\@.+/) {
- verbose "Sender not found in message or invalid";
- next;
- } # if
+ # Discard any email with an invalid email address
+ next unless Email::Valid->address($sender);
'user=s' => \$userid,
'verbose' => sub { set_verbose },
'debug' => sub { set_debug },
'user=s' => \$userid,
'verbose' => sub { set_verbose },
'debug' => sub { set_debug },