summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-08-08 17:51:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-08-08 17:51:29 -0300
commit681787bc89c90be80806c70f7d6cbb2c15fbc82d (patch)
tree7c875a36c579cbd474d5a3abd0096aa491d6300e
parent4dab103414b87ef8daf6df195bcd9feba41205ea (diff)
downloadpuppet-mail-681787bc89c90be80806c70f7d6cbb2c15fbc82d.tar.gz
puppet-mail-681787bc89c90be80806c70f7d6cbb2c15fbc82d.tar.bz2
Using dovecot as LDA
-rw-r--r--files/dovecot/dovecot.conf24
-rw-r--r--manifests/dovecot.pp2
-rw-r--r--manifests/system.pp51
3 files changed, 50 insertions, 27 deletions
diff --git a/files/dovecot/dovecot.conf b/files/dovecot/dovecot.conf
index 761299a..19750bf 100644
--- a/files/dovecot/dovecot.conf
+++ b/files/dovecot/dovecot.conf
@@ -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
diff --git a/manifests/dovecot.pp b/manifests/dovecot.pp
index 4eca941..0ced8e1 100644
--- a/manifests/dovecot.pp
+++ b/manifests/dovecot.pp
@@ -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'],
diff --git a/manifests/system.pp b/manifests/system.pp
index 29bac39..4f8f20c 100644
--- a/manifests/system.pp
+++ b/manifests/system.pp
@@ -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'],
}
}