--- trunk/Nos.pm 2005/05/24 16:44:34 49 +++ trunk/Nos.pm 2005/05/24 17:04:01 50 @@ -490,12 +490,13 @@ } } - warn "can't find hash in e-mail $to\n" unless ($hash); + #warn "can't find hash in e-mail $to\n" unless ($hash); my $sent = $self->{'loader'}->find_class('sent'); # will use null if no matching message_id is found - my $sent_msg = $sent->search( hash => $hash )->first; + my $sent_msg; + $sent_msg = $sent->search( hash => $hash )->first if ($hash); my ($message_id, $user_id) = (undef, undef); # init with NULL @@ -503,7 +504,12 @@ $message_id = $sent_msg->message_id || carp "no message_id"; $user_id = $sent_msg->user_id || carp "no user_id"; } else { - warn "can't find sender with hash $hash\n"; + #warn "can't find sender with hash $hash\n"; + my $users = $self->{'loader'}->find_class('users'); + my $from = $m->header('From'); + $from = $1 if ($from =~ m/<(.*)>/); + my $this_user = $users->search( email => $from )->first; + $user_id = $this_user->id if ($this_user); } @@ -514,7 +520,7 @@ my $bounce = eval { Mail::DeliveryStatus::BounceParser->new( $arg->{'message'}, { report_non_bounces=>1 }, ) }; - warn "can't check if this message is bounce!" if ($@); + #warn "can't check if this message is bounce!" if ($@); $is_bounce++ if ($bounce && $bounce->is_bounce); }