On 26.09.2010 13:24, Michal Bruncko wrote:
Hello list

I am using postfix (v 2.7.0) with sender policy framework (postfix-policyd-spf-perl-2.001) and greylisting (postgrey-1.32) with following configuration:

smtpd_recipient_restrictions =
 ...
 check_policy_service unix:private/policy
 check_policy_service unix:/var/spool/postfix/postgrey/socket
 ...

where unix:private/policy is SPF socket and followed by greylist rule.

It is possible in some way to configure postfix, that SPF Passed mails will be automatically accepted with postfix without greylisting? And using greylist only for mails with other SPF result codes (none, softfail,..)? Current configuration only denies mails with SPF Fail and all other mails where being greylisted.

Use the attached patch for postfix-policyd-spf-perl-2.007, and you get what you want.


thanks

michal

--
Eugene
--- postfix-policyd-spf-perl.old        2010-10-01 21:18:35.000000000 +0400
+++ postfix-policyd-spf-perl    2010-10-01 21:26:52.000000000 +0400
@@ -272,13 +272,19 @@
         );
         return "DEFER_IF_PERMIT SPF-Result=$helo_local_exp";
     }
+    elsif ($attr->{sender} eq '' && $helo_result->is_code('pass')) {
+        syslog(
+            info => "%s: SPF %s: HELO/EHLO (Null Sender): %s",
+            $attr->{queue_id}, $helo_result, $attr->{helo_name}
+        );
+        return 'OK';
+    }
     elsif ($attr->{sender} eq '') {
         syslog(
             info => "%s: SPF %s: HELO/EHLO (Null Sender): %s",
             $attr->{queue_id}, $helo_result, $attr->{helo_name}
         );
-        return "PREPEND $helo_spf_header"
-            unless $cache->{added_spf_header}++;
+        return "DUNNO"
     }
     
     # -------------------------------------------------------------------------
@@ -339,9 +345,8 @@
     elsif ($mfrom_result->is_code('temperror')) {
         return "DEFER_IF_PERMIT SPF-Result=$mfrom_local_exp";
     }
-    else {
-        return "PREPEND $mfrom_spf_header"
-            unless $cache->{added_spf_header}++;
+    elsif($mfrom_result->is_code('pass')) {
+        return 'OK';
     }
     
     return;

Reply via email to