/[notice-sender]/trunk/Nos.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/Nos.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 49 by dpavlin, Tue May 24 16:44:34 2005 UTC revision 50 by dpavlin, Tue May 24 17:04:01 2005 UTC
# Line 490  sub inbox_message { Line 490  sub inbox_message {
490                  }                  }
491          }          }
492    
493          warn "can't find hash in e-mail $to\n" unless ($hash);          #warn "can't find hash in e-mail $to\n" unless ($hash);
494    
495          my $sent = $self->{'loader'}->find_class('sent');          my $sent = $self->{'loader'}->find_class('sent');
496    
497          # will use null if no matching message_id is found          # will use null if no matching message_id is found
498          my $sent_msg = $sent->search( hash => $hash )->first;          my $sent_msg;
499            $sent_msg = $sent->search( hash => $hash )->first if ($hash);
500    
501          my ($message_id, $user_id) = (undef, undef);    # init with NULL          my ($message_id, $user_id) = (undef, undef);    # init with NULL
502    
# Line 503  sub inbox_message { Line 504  sub inbox_message {
504                  $message_id = $sent_msg->message_id || carp "no message_id";                  $message_id = $sent_msg->message_id || carp "no message_id";
505                  $user_id = $sent_msg->user_id || carp "no user_id";                  $user_id = $sent_msg->user_id || carp "no user_id";
506          } else {          } else {
507                  warn "can't find sender with hash $hash\n";                  #warn "can't find sender with hash $hash\n";
508                    my $users = $self->{'loader'}->find_class('users');
509                    my $from = $m->header('From');
510                    $from = $1 if ($from =~ m/<(.*)>/);
511                    my $this_user = $users->search( email => $from )->first;
512                    $user_id = $this_user->id if ($this_user);
513          }          }
514    
515    
# Line 514  sub inbox_message { Line 520  sub inbox_message {
520                  my $bounce = eval { Mail::DeliveryStatus::BounceParser->new(                  my $bounce = eval { Mail::DeliveryStatus::BounceParser->new(
521                          $arg->{'message'}, { report_non_bounces=>1 },                          $arg->{'message'}, { report_non_bounces=>1 },
522                  ) };                  ) };
523                  warn "can't check if this message is bounce!" if ($@);                  #warn "can't check if this message is bounce!" if ($@);
524                    
525                  $is_bounce++ if ($bounce && $bounce->is_bounce);                  $is_bounce++ if ($bounce && $bounce->is_bounce);
526          }          }

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26