From 4ed5bd918fa0b8e00e57e3e1fa5dffeb95e8c79c Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Thu, 3 May 2012 13:46:04 +0000 Subject: [PATCH] bugfix+correction droits templatisation --- debian/alternc.postinst | 2 +- debian/rules | 1 + etc/alternc/alternc-sudoers | 1 + etc/alternc/templates/dovecot/dovecot-dict-quota.conf | 2 +- etc/alternc/templates/dovecot/dovecot-sql.conf | 2 +- etc/alternc/templates/dovecot/dovecot.conf | 2 +- install/alternc.install | 2 +- tools/postfix-add-policy | 2 +- 8 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/alternc.postinst b/debian/alternc.postinst index 1049b5b4..e1244837 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -52,7 +52,7 @@ case "$1" in addgroup --gid 1998 vmail fi if ! getent passwd vmail; then - adduser -g vmail -u 1998 vmail -d /var/alternc/mail -m + useradd -g vmail -u 1998 vmail -d /var/alternc/mail -m fi chown -R vmail:vmail /var/alternc/mail chmod u+w /var/alternc/mail diff --git a/debian/rules b/debian/rules index dbe2eb7d..b57b1ff9 100755 --- a/debian/rules +++ b/debian/rules @@ -79,6 +79,7 @@ install: build install tools/get_domains_by_account debian/alternc/usr/bin install tools/get_account_by_domain debian/alternc/usr/bin install tools/alternc_get_path debian/alternc/usr/bin + install tools/postfix-add-policy debian/alternc/usr/bin install src/alternc_reload debian/alternc/usr/bin install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/ diff --git a/etc/alternc/alternc-sudoers b/etc/alternc/alternc-sudoers index b827f7bd..7209af72 100644 --- a/etc/alternc/alternc-sudoers +++ b/etc/alternc/alternc-sudoers @@ -1 +1,2 @@ alterncpanel ALL = NOPASSWD : /usr/bin/quota, /usr/sbin/setquota +vmail ALL = NOPASSWD : /usr/lib/dovecot/deliver diff --git a/etc/alternc/templates/dovecot/dovecot-dict-quota.conf b/etc/alternc/templates/dovecot/dovecot-dict-quota.conf index 8a21ed7f..ddc159e2 100644 --- a/etc/alternc/templates/dovecot/dovecot-dict-quota.conf +++ b/etc/alternc/templates/dovecot/dovecot-dict-quota.conf @@ -1,5 +1,5 @@ -connect host=%%dbhost%% dbname=%%dbname%% user=%%db_mail_user%% password=%%db_mail_pwd%% +connect=host=%%dbhost%% dbname=%%dbname%% user=%%db_mail_user%% password=%%db_mail_pwd%% #connect = host=localhost dbname=mails user=testuser password=pass # CREATE TABLE quota ( diff --git a/etc/alternc/templates/dovecot/dovecot-sql.conf b/etc/alternc/templates/dovecot/dovecot-sql.conf index dbaedafe..7166da33 100644 --- a/etc/alternc/templates/dovecot/dovecot-sql.conf +++ b/etc/alternc/templates/dovecot/dovecot-sql.conf @@ -116,7 +116,7 @@ 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' # -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, 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' # 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 diff --git a/etc/alternc/templates/dovecot/dovecot.conf b/etc/alternc/templates/dovecot/dovecot.conf index 2109a28d..22160101 100644 --- a/etc/alternc/templates/dovecot/dovecot.conf +++ b/etc/alternc/templates/dovecot/dovecot.conf @@ -311,7 +311,7 @@ mail_location = maildir:~/Maildir # used only with INBOX when either its initial creation or dotlocking fails. # Typically this is set to "mail" to give access to /var/mail. #mail_privileged_group = -mail_privileged_group = mail +mail_privileged_group = vmail # Grant access to these supplementary groups for mail processes. Typically # these are used to set up access to shared mailboxes. Note that it may be diff --git a/install/alternc.install b/install/alternc.install index 2b8f41d6..98592982 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -295,7 +295,7 @@ while read line ; do done < "$postfix_conf" # Conviguring delivery used bu Postfix FIXME change script name -echo `/usr/bin/postfix-add-policy2 dovecot pipe DRhu vmail:vmail '/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} '` +echo `/usr/bin/postfix-add-policy dovecot pipe DRhu vmail:vmail '/usr/bin/sudo /usr/lib/dovecot/deliver -f ${sender} -d ${recipient} '` # Bug #1215: configure mydestination when $FQDN is not in OLDDESTINATION=`postconf mydestination | awk -F '=' '{print $2}'` diff --git a/tools/postfix-add-policy b/tools/postfix-add-policy index adc4b744..91bc66bd 100755 --- a/tools/postfix-add-policy +++ b/tools/postfix-add-policy @@ -39,7 +39,7 @@ def makepolicy(name, method, flags, user, argv): # Added using postfix-add-policy script: """ policy = ("""%s unix - n n - 0 %s - %s user=%s argv=%s + flags=%s user=%s argv=%s """ % (name, method, flags, user, argv)) additions = header + policy return (additions)