]> gitweb.fluxo.info Git - puppet-postfix.git/commitdiff
added postfix::amavis, no relayhost needed for postfix::mta
authorVarac <varacanero@zeromail.org>
Thu, 17 Dec 2009 15:37:53 +0000 (16:37 +0100)
committerVarac <varacanero@zeromail.org>
Thu, 17 Dec 2009 15:37:53 +0000 (16:37 +0100)
README
manifests/classes/postfix-amavis.pp [new file with mode: 0644]
manifests/classes/postfix-mta.pp
manifests/classes/postfix.pp
templates/master.cf.debian-etch.erb

diff --git a/README b/README
index 964125f5f8aed33f9703b637831fcc009110c5f4..c2b58e958c61230c1a906cda2d01522d4b4b8c3c 100644 (file)
--- a/README
+++ b/README
@@ -4,6 +4,10 @@ This module will help install and configure postfix.
 
 A couple of classes will preconfigure postfix for common needs.
 
+Config
+------
+- set $postfix_amavis="true" to include postfix::amavis
+
 == Example:
 
   include postfix
diff --git a/manifests/classes/postfix-amavis.pp b/manifests/classes/postfix-amavis.pp
new file mode 100644 (file)
index 0000000..47ba532
--- /dev/null
@@ -0,0 +1,7 @@
+class postfix::amavis {    
+               include amavisd-new
+                postfix::config { 
+                                  "content_filter": value => "smtp-amavis:[localhost]:10024"; }
+
+}
+
index 9046bad4c91843abcf1408153d40848f05b2da7d..ff94c91e1f5e2c324c9f5ef853c265586b0723b1 100644 (file)
@@ -32,9 +32,9 @@
 #
 class postfix::mta {
 
-  case $postfix_relayhost {
-    "":   { fail("Required \$postfix_relayhost variable is not defined.") }
-  }
+  #case $postfix_relayhost {
+  #  "":   { fail("Required \$postfix_relayhost variable is not defined.") }
+  #}
 
   case $postfix_mydestination {
     "": { $postfix_mydestination = "\$myorigin" }
index 8c4173ebeabd78b3413f43dc59888a839468394e..a413664a0bf47251e16f71eb05965a873c2cd1d0 100644 (file)
@@ -41,6 +41,13 @@ class postfix {
     "":   { $root_mail_recipient = "nobody" }
   }
 
+  case $postfix_amavis {
+    "":                { $postfix_amavis = "false" }
+    "true":    { include postfix::amavis }
+  }
+
+  
+
 
   package { ["postfix", "mailx"]:
     ensure => installed
@@ -81,7 +88,7 @@ class postfix {
     mode => "0644",
     content => $operatingsystem ? {
       Redhat => template("postfix/master.cf.redhat5.erb"),
-      Debian => template("postfix/master.cf.debian-etch.erb"),
+      Debian,Ubuntu => template("postfix/master.cf.debian-etch.erb"),
     },
     seltype => $postfix_seltype,
     notify  => Service["postfix"],
index 674682c2e818b82db8d41794c504f68a0a79d958..aa5f34f25c663a68310795d7bf3330d50afba3b3 100644 (file)
@@ -75,3 +75,32 @@ mailman   unix  -       n       n       -       -       pipe
   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
   ${nexthop} ${user}
 
+
+# Amavis 
+<% if (postfix_amavis == "true" ) -%>
+
+## http://www.freespamfilter.org/FC4.html#_Toc110999176
+
+smtp-amavis  unix    -    -    y    -    2    smtp
+ -o smtp_data_done_timeout=1200
+ -o smtp_send_xforward_command=yes
+ -o disable_dns_lookups=yes
+127.0.0.1:10025 inet    n    -    y    -    -    smtpd
+ -o content_filter=
+ -o local_recipient_maps=
+ -o relay_recipient_maps=
+ -o smtpd_restriction_classes=
+ -o smtpd_helo_restrictions=
+ -o smtpd_sender_restrictions=
+ -o smtpd_recipient_restrictions=permit_mynetworks,reject
+ -o mynetworks=127.0.0.0/8
+ -o strict_rfc821_envelopes=yes
+ -o smtpd_error_sleep_time=0
+ -o smtpd_soft_error_limit=1001
+ -o smtpd_hard_error_limit=1000
+ -o receive_override_options=no_header_body_checks
+<% else -%>
+# Amavis not configured
+<% end -%>
+