diff --git a/bureau/class/m_mail_localbox.php b/bureau/class/m_mail_localbox.php index cf0f6938..e104ba0d 100644 --- a/bureau/class/m_mail_localbox.php +++ b/bureau/class/m_mail_localbox.php @@ -62,7 +62,6 @@ Class m_mail_localbox{ global $db, $err; $err->log("localbox","set_localbox"); $path="mail/"; - //if(!$db->query("select distinct left(ad.address,1) as letter,d.domaine from address ad,where ad.id = $mail_id ;")); if(!$db->query("select distinct left(ad.address,1) as letter,ad.address ,d.domaine from address ad, domaines d where ad.domain_id = d.id and ad.id = $mail_id order by letter;")); if(! $db->next_record()){ @@ -70,7 +69,7 @@ Class m_mail_localbox{ } $path="/var/alternc/mail/".$db->f('letter')."/".$db->f('address')."_".$db->f('domaine'); //FIXME faire un touch de la maildir si dovecot ne sait pas le faire. - if(!$db->query("INSERT into mailbox (address_id,path) values ($mail_id,'$path');")); + if(!$db->query("INSERT into mailbox (address_id,path,quota) values ($mail_id,'$path',50);")); } diff --git a/debian/alternc.postinst b/debian/alternc.postinst index a906c185..1049b5b4 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -56,7 +56,7 @@ case "$1" in fi chown -R vmail:vmail /var/alternc/mail chmod u+w /var/alternc/mail - + chmod -R g+w /var/alternc/mail # build local.sh if it does not exist if [ ! -f $CONFIGFILE ]; then diff --git a/debian/changelog b/debian/changelog index 27efc753..fc4f98c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +alternc (1.1+nmu3) stable; urgency=low + + * Templating full configuration of postfix & dovecot + * bugfixes in mysql database configuration + * adding default quota (to use with dovecot) in local mailbox creation + + -- Squidly Wed, 02 May 2012 14:51:49 +0200 + alternc (1.1+nmu2) stable; urgency=low * Templating of dovecot and postfix diff --git a/etc/alternc/templates/dovecot/dovecot-dict-quota.conf b/etc/alternc/templates/dovecot/dovecot-dict-quota.conf index c7767bef..8a21ed7f 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=%%dbuser%% password=%%dbpwd%% +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 fe017c2c..dbaedafe 100644 --- a/etc/alternc/templates/dovecot/dovecot-sql.conf +++ b/etc/alternc/templates/dovecot/dovecot-sql.conf @@ -67,7 +67,7 @@ connect = host=%%dbhost%% dbname=%%dbname%% user=%%db_mail_user%% password=%%db_ # List of supported schemes is in # http://wiki.dovecot.org/Authentication/PasswordSchemes # -default_pass_scheme = PLAIN-MD5 +default_pass_scheme = MD5 # passdb query to retrieve the password. It can return fields: # password - The user's password. This field must be returned. diff --git a/etc/alternc/templates/dovecot/dovecot.conf b/etc/alternc/templates/dovecot/dovecot.conf index 7c98d330..2109a28d 100644 --- a/etc/alternc/templates/dovecot/dovecot.conf +++ b/etc/alternc/templates/dovecot/dovecot.conf @@ -1195,6 +1195,7 @@ plugin { # userdb. It's also possible to give mailbox-specific limits, for example: # quota_rule = *:storage=1048576 quota_rule = *:storage=100M + quota_rule2 = Trash:storage=10M # quota_rule2 = Trash:storage=102400 # User has now 1GB quota, but when saving to Trash mailbox the user gets # additional 100MB. @@ -1212,9 +1213,9 @@ plugin { # exceeded limit is excecuted, so put the highest limit first. # Note that % needs to be escaped as %%, otherwise "% " expands to empty. # quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 - # quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 # quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80 - quota_warning = storage=80%% /usr/local/bin/quota-warning.sh 80 + quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 + quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80 #quota = maildir quota = dict:user::proxy::quotadict diff --git a/etc/alternc/templates/postfix/mydomain.cf b/etc/alternc/templates/postfix/mydomain.cf index c1c8da40..f916ef40 100644 --- a/etc/alternc/templates/postfix/mydomain.cf +++ b/etc/alternc/templates/postfix/mydomain.cf @@ -6,5 +6,4 @@ user = %%db_mail_user%% password = %%db_mail_pwd%% hosts =%%dbhost%% dbname = %%dbname%% -query = select domaines.domaine from domaines join address on address.id=domaines.id where concat(address.address,'@',domaines.domaine)='%s' and gesmx=1; - +query = select domaines.domaine from domaines where domaine='%s' and gesmx=1; diff --git a/install/alternc.install b/install/alternc.install index 42d89f3d..2b8f41d6 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -42,7 +42,7 @@ if [ -e /etc/bind/named.conf ]; then fi if [ -d /etc/postfix ]; then CONFIG_FILES="$CONFIG_FILES etc/postfix/myalias.cf etc/postfix/myrelay.cf - etc/postfix/mydomain.cf etc/postfix/mygid.cf + etc/postfix/mydomain.cf etc/postfix/mygid.cf etc/postfix/myquota.cf etc/postfix/myvirtual.cf etc/postfix/sasl/smtpd.conf" fi if [ -e /etc/proftpd/proftpd.conf ]; then @@ -56,6 +56,10 @@ if [ -e /etc/default/saslauthd ]; then CONFIG_FILES="$CONFIG_FILES etc/default/saslauthd" fi +if [ -e /etc/dovecot/dovecot.conf ]; then + CONFIG_FILES="$CONFIG_FILES etc/dovecot/dovecot.conf etc/dovecot/dovecot-sql.conf etc/dovecot/dovecot-dict-quota.conf" +fi + INSTALLED_CONFIG_TAR="/var/backups/alternc/etc-installed.tar.gz" ####################################################################### @@ -264,7 +268,7 @@ for file in body_checks header_checks; do done # Attribute the correct rights to critical postfix files -if [ -e /etc/postfix/myalias.cf -o -e /etc/postfix/mydomain.cf -o -e /etc/postfix/mygid.cf -o -e /etc/postfix/myvirtual.cf -o -e /etc/postfix/myrelay.cf ]; then +if [ -e /etc/postfix/myalias.cf -o -e /etc/postfix/mydomain.cf -o -e /etc/postfix/mygid.cf -o -e /etc/postfix/myvirtual.cf -o -e /etc/postfix/myrelay.cf -o -e /etc/postfix/myquota.cf ]; then chown root:postfix /etc/postfix/my* chmod 640 /etc/postfix/my* fi diff --git a/install/mysql.sql b/install/mysql.sql index 2092256c..bdb187dd 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -245,8 +245,7 @@ CREATE TABLE IF NOT EXISTS `address` ( `expire_date` datetime DEFAULT NULL, -- Expiration date, used for temporary addresses. `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. PRIMARY KEY (`id`), - UNIQUE INDEX `domain_id_idx` (`domain_id`), - UNIQUE KEY `address` (`address`) + UNIQUE INDEX `fk_domain_id` (`domain_id`,`address`) ) COMMENT = 'This is the main address table. It represents an address as in RFC2822'; --