On 01/05/2011 04:11 PM, Greg C wrote:
> On Wed, Jan 5, 2011 at 12:36 AM, JKL <ju...@kl...> wrote:
>> Dear everyone,
>>
>> Originally, I posted this question to the dovecot mailing list and
>> dovecot IRC. The postfixadmin IRC offered help, I still have run into
>> problems. IRC might well be less suited because there is a bit of
>> information in this Email. I followed the instructions in
>> DOCUMENTS/DOVECOT.txt for set-up dovecot for postfixadmin's use.
>>
>> Best regards, J.
>>
>>
>> *** SET-UP is:
>>
>> postfix -> dovecot LDA -> /var/vmail <- postfixadmin
>> mysql backupend
>>
>> *** VERSIONS are:
>> postfix 2.7.1-1
>> dovecot 1.2.15
>> postfixadmin version unknown - latest checked out from svn on the 3rd Jan 2011.
>> All packages are from the Debian Squeeze repos except postfixadmin.
>>
>> *** WHAT WORKS:
>> postfix delivers to dovecot.
>> postfixadmin is configured, and have created one domain test.info.
>>
>> *** WHAT IS BROKEN:
>> dovecot is mis-configured.
>> postfixadmin might well be mis-configured, but am unsure.
>>
>> I have followed the instructions in the
>> postfixadmin/DOCUMENTS/DOVECOT.TXT for the additional dovecot configuration.
>>
>>
>> *** ERROR MESSAGES
>> All Emails passed from postfix to dovecot generate:
>> Jan 4 20:35:02 logout dovecot: deliver(te...@te...): Unknown dict
>> module: quota
>> Jan 4 20:35:02 logout dovecot: deliver(te...@te...): Fatal: Quota
>> root storage=200000 proxy init() failed
>> Jan 4 20:57:18 logout dovecot: IMAP(te...@te...):
>> mkdir(/var/mail/vmail/test.info/te...@te.../cur) failed: Permission
>> denied (euid=5000(vmail) egid=5000(vmail) missing +w perm: /var/mail)
>>
>> *** POSTFIXADMIN CONFIG
>> config.php.ini
>> $CONF['configured'] = true;
>> $CONF['setup_password'] = 'xxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
>> $CONF['postfix_admin_url'] = 'http://www.test.info/postfixadmin';
>> $CONF['postfix_admin_path'] = dirname(__FILE__);
>> $CONF['default_language'] = 'en';
>> $CONF['database_type'] = 'mysql';
>> $CONF['database_host'] = 'localhost';
>> $CONF['database_user'] = 'postfixadmin';
>> $CONF['database_password'] = 'xxxxxxxxxxxxxxxxxxxxx';
>> $CONF['database_name'] = 'mailxxxx';
>> $CONF['database_prefix'] = '';
>> $CONF['database_tables'] = array (
>> $CONF['admin_email'] = 'pos...@ch...d';
>> $CONF['smtp_server'] = 'localhost';
>> $CONF['smtp_port'] = '25';
>> $CONF['encrypt'] = 'md5crypt';
>> $CONF['authlib_default_flavor'] = 'md5raw';
>> $CONF['dovecotpw'] = "/usr/sbin/dovecotpw";
>> $CONF['min_password_length'] = 5;
>> $CONF['generate_password'] = 'NO';
>> $CONF['show_password'] = 'NO';
>> $CONF['page_size'] = '10';
>> $CONF['default_aliases'] = array (
>> $CONF['domain_path'] = 'YES';
>> $CONF['domain_in_mailbox'] = 'NO';
>> $CONF['maildir_name_hook'] = 'NO';
>> $CONF['aliases'] = '10';
>> $CONF['mailboxes'] = '10';
>> $CONF['maxquota'] = '10';
>> $CONF['quota'] = 'YES';
>> $CONF['quota_multiplier'] = '1024000';
>> $CONF['transport'] = 'NO';
>> $CONF['transport_options'] = array (
>> $CONF['transport_default'] = 'virtual';
>> $CONF['vacation'] = 'NO';
>> $CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
>> $CONF['vacation_control'] ='YES';
>> $CONF['vacation_control_admin'] = 'YES';
>> $CONF['alias_control'] = 'NO';
>> $CONF['alias_control_admin'] = 'NO';
>> $CONF['special_alias_control'] = 'NO';
>> $CONF['alias_goto_limit'] = '0';
>> $CONF['alias_domain'] = 'YES';
>> $CONF['backup'] = 'YES';
>> $CONF['sendmail'] = 'YES';
>> $CONF['logging'] = 'YES';
>> $CONF['fetchmail'] = 'YES';
>> $CONF['fetchmail_extra_options'] = 'NO';
>> $CONF['show_header_text'] = 'NO';
>> $CONF['header_text'] = ':: Postfix Admin ::';
>> $CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main";
>> $CONF['show_footer_text'] = 'YES';
>> $CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
>> $CONF['footer_link'] = 'http://change-this-to-your.domain.tld';
>> $CONF['welcome_text'] = <<<EOM
>> $CONF['emailcheck_resolve_domain']='YES';
>> $CONF['show_status']='NO';
>> $CONF['show_status_key']='NO';
>> $CONF['show_status_text']=' ';
>> $CONF['show_undeliverable']='NO';
>> $CONF['show_undeliverable_color']='tomato';
>> $CONF['show_undeliverable_exceptions']=array("unixmail.domain.ext","exchangeserver.domain.ext","gmail.com");
>> $CONF['show_popimap']='NO';
>> $CONF['show_popimap_color']='darkgrey';
>> $CONF['show_custom_domains']=array("subdomain.domain.ext","domain2.ext");
>> $CONF['show_custom_colors']=array("lightgreen","lightblue");
>> $CONF['recipient_delimiter'] = "";
>> $CONF['create_mailbox_subdirs_prefix']='INBOX.';
>> $CONF['used_quotas'] = 'YES';
>> $CONF['new_quota_table'] = 'YES';
>> $CONF['theme_logo'] = 'images/logo-default.png';
>> $CONF['theme_css'] = 'css/default.css';
>> $CONF['xmlrpc_enabled'] = false;
>>
>>
>> ** DOVECOT -n
>> # 1.2.15: /etc/dovecot/dovecot.conf
>> # OS: Linux 2.6.32-xxxxxxxx-xxxxx x86_64 Debian squeeze/sid
>> log_timestamp: %Y-%m-%d %H:%M:%S
>> disable_plaintext_auth: no
>> login_dir: /var/run/dovecot/login
>> login_executable: /usr/lib/dovecot/imap-login
>> login_chroot: no
>> first_valid_uid: 106
>> mail_privileged_group: mail
>> mail_location: maildir:/var/mail/vmail/%d/%u/
>> mbox_write_locks: fcntl dotlock
>> lda:
>> log_path:
>> auth_socket_path: /var/run/dovecot/auth-master
>> postmaster_address: pos...@te...
>> mail_plugins: sieve quota
>> auth default:
>> mechanisms: plain login
>> passdb:
>> driver: pam
>> passdb:
>> driver: sql
>> args: /etc/dovecot/dovecot-sql.conf
>> userdb:
>> driver: passwd
>> userdb:
>> driver: static
>> args: uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes
>> userdb:
>> driver: sql
>> args: /etc/dovecot/dovecot-sql.conf
>> socket:
>> type: listen
>> client:
>> path: /var/spool/postfix/private/auth
>> mode: 432
>> user: postfix
>> group: postfix
>> master:
>> path: /var/run/dovecot/auth-master
>> mode: 384
>> user: vmail
>> plugin:
>> quota: dict:storage=200000 proxy::quota
>> quota: dict:storage=200000 proxy::quota:w
>> dict:
>> quota: mysql:/etc/dovecot/dovecot-dict-quota.conf
>>
>>
>> *** MYSQL DOVECOT FILES
>> # grep -v '^ *\(#.*\)\?$' dovecot-sql.conf
>> connect = host=localhost dbname=xxxxx user=xxxxx password=xxxxx
>> driver = mysql
>> default_pass_scheme = MD5-CRYPT
>> password_query = SELECT username AS user,password FROM mailbox WHERE
>> username = '%u' AND active='1'
>> user_query = SELECT CONCAT('/var/vmail/', maildir) AS home, 106 AS uid,
>> 110 AS gid,
>> CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE
>> username = '%u' AND active='1'
>> ## Note: 106:110 = postfix:avahi For some reason squeeze drops postfix
>> into avahi group: To Fix.
>>
>>
>> *** DICT QUOTA
>> # cat /etc/dovecot/dovecot-dict-quota.conf
>> driver = mysql
>> connect = host=localhost dbname=xxxxx user=xxxxx password=xxxxx
>> default_pass_scheme = MD5-CRYPT
>> table = quota
>> select_field = current
>> where_field = path
>> username_field = username
>>
>>
>> *** /VAR/VMAIL directory
>> # ls -la /var/vmail
>> total 28
>> drwxrwx--- 3 vmail vmail 4096 Jan 4 20:53 .
>> drwxr-xr-x 15 root root 4096 Jan 3 12:19 ..
>> -rw-r--r-- 1 root root 0 Jan 3 15:14 auth_socket_path
>> -rw-r--r-- 1 root root 173 Dec 31 12:15 globalsieverc
>> -rw-r--r-- 1 root root 0 Jan 3 15:14 info_log_path
>> -rw-r--r-- 1 root root 0 Jan 3 15:14 log_path
>> drwx------ 2 root root 16384 Jan 4 15:28 lost+found
>> -rw-r--r-- 1 root root 0 Jan 3 15:14 mail_plugins
>> -rw-r--r-- 1 root root 0 Jan 3 15:14 postmaster_address
>>
>> *** VMAIL user
>> vmail:x:5000:5000::/var/vmail:/bin/sh (soon to be changed to /bin/false
>> after testing completed)
>> dovecot:x:109:114:Dovecot mail server,,,:/usr/lib/dovecot:/bin/false
>> postfix:x:106:110::/var/spool/postfix:/bin/false
>>
>>
>>
>
> Change mail_location to /var/vmail or create /var/mail/vmail owned by
> user vmail and store/retrieve mail from there.
>
> The dovecot-dict-quota.conf appears to be using v1.0/1.1 style config,
> see http://wiki.dovecot.org/Quota/Dict and change to v1.2+ style.
>
After following the document and making some changes:
Jan 5 16:39:23 logout dovecot: deliver(te...@te...):
msgid=<4D2...@si...>: saved mail to INBOX
Jan 5 16:39:23 logout dovecot: deliver(te...@te...): dict quota:
Quota update failed, it's now desynced
Jan 5 16:39:23 logout dovecot: dict: sql dict: commit failed: Unknown
column 'bytes' in 'field list'
The changes I made were these:
MYSQL:
GRANT update on xxxxx.quota to 'xxxxx'@'localhost';
# dovecot.conf
plugin {
quota = dict:user::proxy::quotadict
quota_rule = *:storage=10M:messages=1000
}
# cat dovecot-dict-quota.conf
connect = host=localhost dbname=xxxxx user=xxxxx password=xxxxx
map {
pattern = priv/quota/storage
table = quota
username_field = username
value_field = bytes
}
map {
pattern = priv/quota/messages
table = quota
username_field = username
value_field = messages
}
I know that I have to add a new columns into the quota table, as noted
in the Wiki so I dropped the old quota table and created this one as per
wiki (for v2):
mysql> describe quota;
+----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| username | varchar(255) | NO | PRI | NULL | |
| bytes | bigint(20) | NO | | 0 | |
| messages | int(11) | NO | | 0 | |
+----------+--------------+------+-----+---------+-------+
The old grant is still there so did not add it again:
mysql> SHOW GRANTS FOR 'mailuser'@'localhost';
+-----------------------------------------------------------------------------------------------------------------+
| Grants for mailuser@localhost
|
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'xxxxx'@'localhost' IDENTIFIED BY PASSWORD
'*abcdefghijklmoop' |
| GRANT SELECT ON `xxxxxx`.* TO 'xxxxx'@'localhost'
|
| GRANT UPDATE ON `xxxxx`.`quota` TO 'xxxx'@'localhost'
|
+-----------------------------------------------------------------------------------------------------------------+
However, these messages are logged for dovecot:
Jan 5 17:18:25 logout dovecot: deliver(te...@te...):
msgid=<4D2...@te...>: saved mail to INBOX
Jan 5 17:18:25 logout dovecot: dict: mysql: Connected to localhost (test)
Jan 5 17:18:25 logout dovecot: dict: sql dict: commit failed: INSERT
command denied to user 'mailuser'@'localhost' for table 'quota'
A bit weird. What did I misplace?
|