From b26cb694b92fd25c0afc8538a32be5ce39003ba7 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Fri, 4 May 2012 08:57:23 +0000 Subject: [PATCH] Correction template dovecot + configuration d'installation --- etc/alternc/postfix.cf | 8 +++++++- etc/alternc/templates/dovecot/dovecot-sql.conf | 4 ++-- install/alternc.install | 4 ++-- tools/postfix-add-policy | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/etc/alternc/postfix.cf b/etc/alternc/postfix.cf index 72ca1801..01bbe0c1 100644 --- a/etc/alternc/postfix.cf +++ b/etc/alternc/postfix.cf @@ -1,3 +1,4 @@ +# Postfix Configuration options # Used by alternc.install with postconf home_mailbox = Maildir/ smtpd_banner = $myhostname ESMTP @@ -5,6 +6,7 @@ header_checks = regexp:/etc/postfix/header_checks body_checks = regexp:/etc/postfix/body_checks local_destination_concurrency_limit = 8 default_destination_concurrency_limit = 10 +# TLS options smtpd_use_tls = yes smtpd_tls_dcert_file = /etc/alternc/apache.pem smtpd_tls_dkey_file = $smtpd_tls_dcert_file @@ -14,16 +16,20 @@ smtpd_tls_cert_file = $smtpd_tls_dcert_file smtpd_tls_loglevel = 0 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s -smtp_use_tls = yes smtp_tls_dcert_file = $smtpd_tls_dcert_file smtp_tls_dkey_file = $smtpd_tls_dcert_file smtp_tls_CApath = $smtpd_tls_CApath smtpd_tls_auth_only = yes +#SASL options smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = postfix smtpd_sasl_security_options = noanonymous enable_sasl_authentification = yes broken_sasl_auth_clients = yes +smtpd_sasl_type=dovecot +smtpd_sasl_path=private/auth +smtpd_sasl_auth_enable=yes +#Virtual Maping alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases virtual_alias_maps = proxy:mysql:/etc/postfix/myalias.cf diff --git a/etc/alternc/templates/dovecot/dovecot-sql.conf b/etc/alternc/templates/dovecot/dovecot-sql.conf index 7166da33..d4206960 100644 --- a/etc/alternc/templates/dovecot/dovecot-sql.conf +++ b/etc/alternc/templates/dovecot/dovecot-sql.conf @@ -116,11 +116,11 @@ default_pass_scheme = MD5 # user_query = SELECT dir AS home, user AS uid, group AS gid FROM users where userid = '%u' # user_query = SELECT home, 501 AS uid, 501 AS gid FROM users WHERE userid = '%u' # -user_query = SELECT mailbox.path AS home, domaines.compte AS uid, domaines.compte AS gid FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE address.address = '%n' +user_query = SELECT mailbox.path AS home, domaines.compte AS uid, 1998 AS gid FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE address.address = '%n' # If you wish to avoid two SQL lookups (passdb + userdb), you can use # userdb prefetch instead of userdb sql in dovecot.conf. In that case you'll # also have to return userdb fields in password_query prefixed with "userdb_" # string. For example: -password_query = SELECT user, password, userdb_home, userdb_uid, userdb_gid,userdb_quota_rule FROM dovecot_view where user= '%u'; +password_query = SELECT user, password, userdb_home, userdb_uid, 1998 AS userdb_gid,userdb_quota_rule FROM dovecot_view where user= '%u'; diff --git a/install/alternc.install b/install/alternc.install index 98592982..8dcb8ee7 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -290,9 +290,9 @@ if [ "$slave" = "1" ]; then else postfix_conf=/etc/alternc/postfix.cf fi -while read line ; do +grep -v '^\ *#' $postfix_conf |while read line ; do postconf -e "$line" -done < "$postfix_conf" +done # Conviguring delivery used bu Postfix FIXME change script name echo `/usr/bin/postfix-add-policy dovecot pipe DRhu vmail:vmail '/usr/bin/sudo /usr/lib/dovecot/deliver -f ${sender} -d ${recipient} '` diff --git a/tools/postfix-add-policy b/tools/postfix-add-policy index 91bc66bd..83c2f54f 100755 --- a/tools/postfix-add-policy +++ b/tools/postfix-add-policy @@ -52,7 +52,7 @@ Example: % sudo postfix-policy-add policyd noboby /usr/bin/policyd Adds the following to master.cf: -""" + makepolicy('policyd','method','flags', 'nobody', '/usr/bin/policyd') + """ +""" + makepolicy('policyd','method','flags', 'user', '/usr/bin/policyd') + """ To output this usage message: % postfix-add-policy """ @@ -89,7 +89,7 @@ if __name__ == '__main__': shutil.copy2('/etc/postfix/master.cf', \ '/etc/postfix/master.cf.working') # Add stuff in - stuff = makepolicy(policyname, user, method, flags, argv) + stuff = makepolicy(policyname, method, flags, user, argv) # Append stuff to the working copy: newmaster = open('/etc/postfix/master.cf.working', mode='a')