~ubuntu-branches/ubuntu/utopic/spamassassin/utopic-updates

« back to all changes in this revision

Viewing changes to lib/Mail/SpamAssassin/Plugin/VBounce.pm

  • Committer: Package Import Robot
  • Author(s): Noah Meyerhans
  • Date: 2014-02-14 22:45:15 UTC
  • mfrom: (0.8.1) (0.6.2) (5.1.22 sid)
  • Revision ID: package-import@ubuntu.com-20140214224515-z1es2twos8xh7n2y
Tags: 3.4.0-1
* New upstream version! (Closes: 738963, 738872, 738867)
* Scrub the environment when switching to the debian-spamd user in
  postinst and cron.daily. (Closes: 738951)
* Enhancements to postinst to better manage ownership of
  /var/lib/spamassassin, via Iain Lane <iain.lane@canonical.com>
  (Closes: 738974)

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
 
93
93
sub have_any_bounce_relays {
94
94
  my ($self, $pms) = @_;
95
 
  return (defined $pms->{conf}->{whitelist_bounce_relays} &&
96
 
      (scalar values %{$pms->{conf}->{whitelist_bounce_relays}} != 0));
 
95
  return $pms->{conf}->{whitelist_bounce_relays} &&
 
96
         %{$pms->{conf}->{whitelist_bounce_relays}} ? 1 : 0;
97
97
}
98
98
 
99
99
sub check_whitelist_bounce_relays {
100
100
  my ($self, $pms) = @_;
101
101
 
 
102
  return 0  if !$self->have_any_bounce_relays($pms);
 
103
 
102
104
  my $body = $pms->get_decoded_stripped_body_text_array();
103
105
  my $res;
104
106
 
118
120
  # fixed, otherwise we'll miss some messages due to their MIME structure
119
121
 
120
122
  my $pristine = $pms->{msg}->get_pristine_body();
 
123
 
 
124
  # triage, avoids expensive loop through large mail with attachments
 
125
  return 0  if $pristine !~ /Received:/i;
 
126
 
121
127
  my $found_received = 0;
122
128
  my $fullhdr = '';
123
129
  foreach my $line ($pristine =~ /^(.*)$/gm) {