1

Topic: amavis cron job fail

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian Wheezy
- Related log if you're reporting an issue:
====

As of this morning I am beginning to see below in the log file:
rules: failed to run T_SPF_HELO_PERMERROR test, skipping:
Cron <amavis@iredmail> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync

    (Can't locate object method "check_for_spf_helo_permerror" via package "Mail::SpamAssassin::PerMsgStatus" at (eval 1168) line 19.
)
rules: failed to run T_SPF_TEMPERROR test, skipping:
    (Can't locate object method "check_for_spf_temperror" via package "Mail::SpamAssassin::PerMsgStatus" at (eval 1168) line 614.
)
rules: failed to run T_SPF_PERMERROR test, skipping:
    (Can't locate object method "check_for_spf_permerror" via package "Mail::SpamAssassin::PerMsgStatus" at (eval 1168) line 784.
)
rules: failed to run T_SPF_HELO_TEMPERROR test, skipping:
    (Can't locate object method "check_for_spf_helo_temperror" via package "Mail::SpamAssassin::PerMsgStatus" at (eval 1168) line 1129.
)

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: amavis cron job fail

Seems to be a known error.
http://www.mail-archive.com/users@spama … 91187.html

3

Re: amavis cron job fail

According to SpamAssassin commit log, this should be fixed (Revision 1658380 + 1658431):
http://svn.apache.org/viewvc/spamassass … m?view=log

4

Re: amavis cron job fail

I'll have to wait for the fix to propagate to Debian Stable.

5 (edited by mir 2015-02-10 01:41:37)

Re: amavis cron job fail

If you cannot wait for the fix to propagate this is how to fix it manually:
1) cd /usr/share/perl5/Mail/SpamAssassin/Plugin
2) patch -p0 SPF.pm < /tmp/patch1.patch
3) patch -p0 SPF.pm < /tmp/patch2.patch
4) patch -p0 SPF.pm < /tmp/patch3.patch

If you want the patches in files post your email to this thread.

/tmp/patch1.patch
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/SPF.pm    2013/06/03 16:30:33    1489055
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/SPF.pm    2015/01/30 14:34:01    1656028
@@ -59,11 +59,15 @@
   $self->register_eval_rule ("check_for_spf_none");
   $self->register_eval_rule ("check_for_spf_fail");
   $self->register_eval_rule ("check_for_spf_softfail");
+  $self->register_eval_rule ("check_for_spf_permerror");
+  $self->register_eval_rule ("check_for_spf_temperror");
   $self->register_eval_rule ("check_for_spf_helo_pass");
   $self->register_eval_rule ("check_for_spf_helo_neutral");
   $self->register_eval_rule ("check_for_spf_helo_none");
   $self->register_eval_rule ("check_for_spf_helo_fail");
   $self->register_eval_rule ("check_for_spf_helo_softfail");
+  $self->register_eval_rule ("check_for_spf_helo_permerror");
+  $self->register_eval_rule ("check_for_spf_helo_temperror");
   $self->register_eval_rule ("check_for_spf_whitelist_from");
   $self->register_eval_rule ("check_for_def_spf_whitelist_from");

@@ -258,6 +262,18 @@
   $scanner->{spf_softfail};
}

+sub check_for_spf_permerror {
+  my ($self, $scanner) = @_;
+  $self->_check_spf ($scanner, 0) unless $scanner->{spf_checked};
+  $scanner->{spf_permerror};
+}
+
+sub check_for_spf_temperror {
+  my ($self, $scanner) = @_;
+  $self->_check_spf ($scanner, 0) unless $scanner->{spf_checked};
+  $scanner->{spf_temperror};
+}
+
sub check_for_spf_helo_pass {
   my ($self, $scanner) = @_;
   $self->_check_spf ($scanner, 1) unless $scanner->{spf_helo_checked};
@@ -291,6 +307,18 @@
   $scanner->{spf_helo_softfail};
}

+sub check_for_spf_helo_permerror {
+  my ($self, $scanner) = @_;
+  $self->_check_spf ($scanner, 1) unless $scanner->{spf_helo_checked};
+  $scanner->{spf_helo_permerror};
+}
+
+sub check_for_spf_helo_temperror {
+  my ($self, $scanner) = @_;
+  $self->_check_spf ($scanner, 1) unless $scanner->{spf_helo_checked};
+  $scanner->{spf_helo_temperror};
+}
+
sub check_for_spf_whitelist_from {
   my ($self, $scanner) = @_;
   $self->_check_spf_whitelist($scanner) unless $scanner->{spf_whitelist_from_checked};
@@ -524,6 +552,8 @@
     $scanner->{spf_helo_none} = 0;
     $scanner->{spf_helo_fail} = 0;
     $scanner->{spf_helo_softfail} = 0;
+    $scanner->{spf_helo_permerror} = 0;
+    $scanner->{spf_helo_temperror} = 0;
     $scanner->{spf_helo_failure_comment} = undef;
   } else {
     # SPF on envelope sender (where possible)
@@ -533,6 +563,8 @@
     $scanner->{spf_none} = 0;
     $scanner->{spf_fail} = 0;
     $scanner->{spf_softfail} = 0;
+    $scanner->{spf_permerror} = 0;
+    $scanner->{spf_temperror} = 0;
     $scanner->{spf_failure_comment} = undef;
   }

@@ -679,6 +711,9 @@
     elsif ($result eq 'none') { $scanner->{spf_helo_none} = 1; }
     elsif ($result eq 'fail') { $scanner->{spf_helo_fail} = 1; }
     elsif ($result eq 'softfail') { $scanner->{spf_helo_softfail} = 1; }
+    elsif ($result eq 'permerror') { $scanner->{spf_helo_permerror} = 1; }
+    elsif ($result eq 'temperror') { $scanner->{spf_helo_temperror} = 1; }
+    elsif ($result eq 'error') { $scanner->{spf_helo_temperror} = 1; }

     if ($result eq 'fail') {    # RFC 4408 6.2
       $scanner->{spf_helo_failure_comment} = "SPF failed: $comment";
@@ -689,6 +724,8 @@
     elsif ($result eq 'none') { $scanner->{spf_none} = 1; }
     elsif ($result eq 'fail') { $scanner->{spf_fail} = 1; }
     elsif ($result eq 'softfail') { $scanner->{spf_softfail} = 1; }
+    elsif ($result eq 'temperror') { $scanner->{spf_temperror} = 1; }
+    elsif ($result eq 'error') { $scanner->{spf_temperror} = 1; }

     if ($result eq 'fail') {    # RCF 4408 6.2
       $scanner->{spf_failure_comment} = "SPF failed: $comment";

/tmp/patch2.patch
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/SPF.pm    2015/01/30 14:34:01    1656028
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/SPF.pm    2015/02/09 12:17:46    1658380
@@ -228,6 +228,15 @@
   $conf->{parser}->register_commands(\@cmds);
}

+
+=item has_check_for_spf_errors
+
+Adds capability check for "if can()" for check_for_spf_permerror, check_for_spf_temperror, check_for_spf_helo_permerror and check_for_spf_helo_permerror

+=cut
+
+sub has_check_for_spf_errors { 1 }
+
# SPF support
sub check_for_spf_pass {
   my ($self, $scanner) = @_;

/tmp/patch3.patch
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/SPF.pm    2015/02/09 12:17:46    1658380
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/SPF.pm    2015/02/09 15:15:56    1658431
@@ -733,6 +733,7 @@
     elsif ($result eq 'none') { $scanner->{spf_none} = 1; }
     elsif ($result eq 'fail') { $scanner->{spf_fail} = 1; }
     elsif ($result eq 'softfail') { $scanner->{spf_softfail} = 1; }
+    elsif ($result eq 'permerror') { $scanner->{spf_permerror} = 1; }
     elsif ($result eq 'temperror') { $scanner->{spf_temperror} = 1; }
     elsif ($result eq 'error') { $scanner->{spf_temperror} = 1; }

6

Re: amavis cron job fail

Or get the patches via wget:

patch1: wget http://svn.apache.org/viewvc/spamassass … view=patch
patch2: wget http://svn.apache.org/viewvc/spamassass … view=patch
patch3: wget http://svn.apache.org/viewvc/spamassass … view=patch