]> gitweb.fluxo.info Git - puppet-mail.git/commitdiff
Using dovecot as LDA
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 8 Aug 2010 20:51:29 +0000 (17:51 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 8 Aug 2010 20:51:29 +0000 (17:51 -0300)
files/dovecot/dovecot.conf
manifests/dovecot.pp
manifests/system.pp

index 761299a8edae3f256888ab7373f2f2f494cfdb88..19750bfabd2f470c887ee318626536ec228b55e9 100644 (file)
@@ -707,7 +707,7 @@ protocol managesieve {
 ## LDA specific settings
 ##
 
-protocol lda {
+protocol lda {
   # Address to use when sending rejection mails.
   # postmaster_address = postmaster@example.com
 
@@ -724,11 +724,11 @@ protocol managesieve {
   #sendmail_path = /usr/lib/sendmail
 
   # UNIX socket path to master authentication server to find users.
-  #auth_socket_path = /var/run/dovecot/auth-master
+  auth_socket_path = /var/run/dovecot/auth-master
 
   # Enabling Sieve plugin for server-side mail filtering
   # mail_plugins = cmusieve
-}
+}
 
 ##
 ## Authentication processes
@@ -969,7 +969,7 @@ auth default {
   #}
 
   # static settings generated from template <doc/wiki/UserDatabase.Static.txt>
-  #userdb static {
+  userdb static {
     # Template for the fields. Can return anything a userdb could normally
     # return. For example:
     #
@@ -983,7 +983,8 @@ auth default {
     # the args in which case the passdb lookup is skipped.
     #
     #args =
-  #}
+    args = uid=5000 gid=5000 home=/var/mail/virtual/%u allow_all_users=yes
+  }
 
   # SQL database <doc/wiki/AuthDatabase.SQL.txt>
   userdb sql {
@@ -1035,16 +1036,17 @@ auth default {
 
   # It's possible to export the authentication interface to other programs:
   socket listen {
-    #master {
+    master {
       # Master socket provides access to userdb information. It's typically
       # used to give Dovecot's local delivery agent access to userdb so it
       # can find mailbox locations.
-      #path = /var/run/dovecot/auth-master
-      #mode = 0600
+      path = /var/run/dovecot/auth-master
+      mode = 0600
       # Default user/group is the one who started dovecot-auth (root)
-      #user = 
-      #group = 
-    #}
+      user = vmail
+      group = mail
+    }
+
     client {
       # Assuming the default Postfix $queue_directory setting
       path = /var/spool/postfix/private/auth
index 4eca94149512d46ba22c0b44307e1c5885dfaf1f..0ced8e15e85f5148d85b97899d1b42b5d9179261 100644 (file)
@@ -8,7 +8,7 @@ class mail::dovecot {
   file { "/etc/dovecot/dovecot.conf":
     ensure => present,
     owner  => root,
-    group  => root,
+    group  => vmail,
     mode   => 0644,
     source => "puppet://$server/modules/mail/dovecot/dovecot.conf",
     notify => Service['dovecot'],
index 29bac3972d46547d9b082c150152086d1fa2d258..4f8f20c1f07e5089f026272e78740a3b631c7424 100644 (file)
@@ -1,7 +1,8 @@
 class mail::system {
-  $postfix_smtp_listen   = "all"
-  $postfix_use_amavisd   = "yes"
-  $postfix_mydestination = '$myhostname, localhost.$mydomain, localhost'
+  $postfix_smtp_listen     = "all"
+  $postfix_use_amavisd     = "yes"
+  $postfix_use_dovecot_lda = "yes"
+  $postfix_mydestination   = '$myhostname, localhost.$mydomain, localhost'
 
   case $postfix_mynetworks {
     '': { $postfix_mynetworks = "127.0.0.0/8" }
@@ -46,14 +47,19 @@ class mail::system {
 
   # Postfix configuration
   postfix::config {
-    "mydomain":             value => "$domain";
-    "myhostname":           value => "$fqdn";
-    "mydestination":        value => "$postfix_mydestination";
-    "mynetworks":           value => "$postfix_mynetworks";
-    "relay_domains":        value => "$domain";
-    "transport_maps":       value => "hash:/etc/postfix/transport";
-    "mailbox_command":      value => '/usr/bin/maildrop -d ${USER}';
-    "virtual_mailbox_base": value => '/var/mail/virtual';
+    "mydomain":                            value => "$domain";
+    "myhostname":                          value => "$fqdn";
+    "mydestination":                       value => "$postfix_mydestination";
+    "mynetworks":                          value => "$postfix_mynetworks";
+    "relay_domains":                       value => "$domain";
+    "transport_maps":                      value => "hash:/etc/postfix/transport";
+    "mailbox_command":                     value => '/usr/bin/maildrop -d ${USER}';
+    "virtual_mailbox_base":                value => '/var/mail/virtual';
+    "virtual_uid_maps":                    value => 'static:5000';
+    "virtual_gid_maps":                    value => 'static:5000';
+    "virtual_transport":                   value => 'dovecot';
+    "dovecot_destination_recipient_limit": value => '1';
+    "recipient_delimiter":                 value => '+';
   }
 
   postfix::hash { "/etc/postfix/virtual":
@@ -70,9 +76,24 @@ class mail::system {
 
   # Virtual mailboxes
   file { '/var/mail/virtual':
-    ensure => directory,
-    owner  => root,
-    group  => mail,
-    mode   => 0770,
+    ensure  => directory,
+    owner   => vmail,
+    group   => vmail,
+    mode    => 0750,
+    require => User['vmail'],
+  }
+
+  group { "vmail":
+    ensure => present,
+    gid    => 5000,
+  }
+
+  user { "vmail":
+    ensure   => present,
+    uid      => 5000,
+    gid      => "vmail",
+    password => "*",
+    home     => '/var/mail/virtual',
+    require  => Group['vmail'],
   }
 }