400 |
my $hash = $auth->generate_hash( $to_email ); |
my $hash = $auth->generate_hash( $to_email ); |
401 |
|
|
402 |
my $from_addr; |
my $from_addr; |
403 |
my $from_email_only = $from . "+" . $hash . ( $domain ? '@' . $domain : ''); |
my $email_hash = "+" . $hash . ( $domain ? '@' . $domain : ''); |
404 |
|
my $from_email_only = $from . $email_hash; |
405 |
|
my $from_bounce = $from . '-bounce' . $email_hash; |
406 |
|
|
407 |
$from_addr .= '"' . $u->list_id->from_addr . '" ' if ($u->list_id->from_addr); |
$from_addr .= '"' . $u->list_id->from_addr . '" ' if ($u->list_id->from_addr); |
408 |
$from_addr .= '<' . $from_email_only . '>'; |
$from_addr .= '<' . $from_email_only . '>'; |
409 |
my $to = '"' . $u->user_id->name . '" <' . $to_email . '>'; |
my $to = '"' . $u->user_id->name . '" <' . $to_email . '>'; |
410 |
|
|
411 |
my $m_obj = Email::Simple->new($msg) || croak "can't parse message"; |
my $m_obj = Email::Simple->new($msg) || croak "can't parse message"; |
412 |
|
|
413 |
$m_obj->header_set('Return-Path', $from_email_only) || croak "can't set Return-Path: header"; |
$m_obj->header_set('Return-Path', $from_bounce) || croak "can't set Return-Path: header"; |
414 |
$m_obj->header_set('Sender', $from_email_only) || croak "can't set Return-Path: header"; |
$m_obj->header_set('Sender', $from_bounce) || croak "can't set Sender: header"; |
415 |
$m_obj->header_set('Errors-To', $from_email_only) || croak "can't set Return-Path: header"; |
$m_obj->header_set('Errors-To', $from_bounce) || croak "can't set Errors-To: header"; |
416 |
$m_obj->header_set('From', $from_addr) || croak "can't set From: header"; |
$m_obj->header_set('From', $from_addr) || croak "can't set From: header"; |
417 |
$m_obj->header_set('To', $to) || croak "can't set To: header"; |
$m_obj->header_set('To', $to) || croak "can't set To: header"; |
418 |
|
|
466 |
|
|
467 |
my $to = $m->header('To') || die "can't find To: address in incomming message\n"; |
my $to = $m->header('To') || die "can't find To: address in incomming message\n"; |
468 |
|
|
469 |
|
my $return_path = $m->header('Return-Path') || ''; |
470 |
|
|
471 |
my @addrs = Email::Address->parse( $to ); |
my @addrs = Email::Address->parse( $to ); |
472 |
|
|
473 |
die "can't parse To: $to address\n" unless (@addrs); |
die "can't parse To: $to address\n" unless (@addrs); |
483 |
} |
} |
484 |
} |
} |
485 |
|
|
486 |
croak "can't find hash in e-mail $to\n" unless ($hash); |
warn "can't find hash in e-mail $to\n" unless ($hash); |
487 |
|
|
488 |
my $sent = $self->{'loader'}->find_class('sent'); |
my $sent = $self->{'loader'}->find_class('sent'); |
489 |
|
|
502 |
|
|
503 |
my $is_bounce = 0; |
my $is_bounce = 0; |
504 |
|
|
505 |
{ |
if ($arg->{'bounce'} || $return_path eq '<>' || $return_path eq '') { |
506 |
no warnings; |
no warnings; |
507 |
my $bounce = eval { Mail::DeliveryStatus::BounceParser->new( |
my $bounce = eval { Mail::DeliveryStatus::BounceParser->new( |
508 |
$arg->{'message'}, { report_non_bounces=>1 }, |
$arg->{'message'}, { report_non_bounces=>1 }, |