[Dovecot] Quota, maildir, MySQL,

Bart Dorlandt bdorlandt at nivo.nl
Tue Sep 16 18:48:43 EEST 2008


I've got it working in the meanwhile.
It will be documented on www.bamweb.nl
direct link: 
http://www.bamweb.nl/index.php?option=com_content&task=view&id=59&Itemid=1


Bart Dorlandt wrote:
> Hi everybody,
> 
> I am trying to work with quota. I use postfix and dovecot with a sql 
> backend. Below you'll find my configuration. Everything works except for 
> the quota part. It doesn't seem to see the quota and doesn't respond to 
> the sender that the client is over its quota.
> 
> versions:
> postfix-2.5.20070531-mysql
> dovecot-1.0.2-mysql
> 
> Thanks for the help in advance.
> 
> 
> My Settings:
> 
> # 1.0.2: /etc/dovecot.conf
> base_dir: /var/dovecot/
> log_path: /var/log/dovecot.log
> protocols: imap imaps pop3s
> listen(default): 127.0.0.1:143
> listen(imap): 127.0.0.1:143
> listen(pop3): *
> ssl_listen: *
> ssl_cert_file: /etc/ssl/dovecotcert.pem
> login_dir: /var/dovecot/login
> login_executable(default): /usr/local/libexec/dovecot/imap-login
> login_executable(imap): /usr/local/libexec/dovecot/imap-login
> login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
> login_user: _dovecot
> first_valid_uid: 2000
> last_valid_uid: 2000
> first_valid_gid: 2000
> last_valid_gid: 2000
> mail_location: maildir:/var/mail/vhosts/%d/%n
> maildir_copy_with_hardlinks: yes
> mbox_write_locks: fcntl
> mail_executable(default): /usr/local/libexec/dovecot/imap
> mail_executable(imap): /usr/local/libexec/dovecot/imap
> mail_executable(pop3): /usr/local/libexec/dovecot/pop3
> mail_plugins(default): quota imap_quota
> mail_plugins(imap): quota imap_quota
> mail_plugins(pop3): quota
> mail_plugin_dir(default): /usr/local/lib/dovecot/imap
> mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
> mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
> imap_client_workarounds(default): delay-newmail outlook-idle 
> netscape-eoh tb-extra-mailbox-sep
> imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh 
> tb-extra-mailbox-sep
> imap_client_workarounds(pop3): outlook-idle
> pop3_uidl_format(default):
> pop3_uidl_format(imap):
> pop3_uidl_format(pop3): %08Xu%08Xv
> pop3_client_workarounds(default):
> pop3_client_workarounds(imap):
> pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
> auth default:
>   mechanisms: plain login digest-md5
>   debug: yes
>   passdb:
>     driver: sql
>     args: /etc/dovecot-sql.conf
>   userdb:
>     driver: prefetch
>   userdb:
>     driver: sql
>     args: /etc/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: 432
>       user: vmail
>       group: vmail
> plugin:
>   quota: maildir:
> 
> 
> my /etc/dovecot-sql.conf:
> user_query = SELECT uid, gid, home, maildir as mail, 
> concat('maildir:storage=',quota) AS quota FROM users WHERE login = '%u'
> 
> password_query = SELECT password, uid AS userdb_uid, gid AS userdb_gid, 
> home AS userdb_home, maildir as userdb_mail, concat('maildir:storage=', 
> quota) AS userdb_quota FROM users WHERE login = '%u'
> 
> 
> My postfix config:
> # postconf -n
> alias_database = hash:/etc/postfix/aliases
> alias_maps = hash:/etc/postfix/aliases
> bounce_template_file = /etc/postfix/bounce.cf
> command_directory = /usr/local/sbin
> config_directory = /etc/postfix
> content_filter = smtp-amavis:[127.0.0.1]:10024
> daemon_directory = /usr/local/libexec/postfix
> disable_vrfy_command = yes
> html_directory = /usr/local/share/doc/postfix/html
> inet_interfaces = all
> inet_protocols = all
> invalid_hostname_reject_code = 554
> mail_owner = _postfix
> mailq_path = /usr/local/sbin/mailq
> manpage_directory = /usr/local/man
> maximal_queue_lifetime = 40d
> message_size_limit = 20480000
> multi_recipient_bounce_reject_code = 554
> mydestination = localhost.$mydomain, localhost
> mydomain = bamweb.nl
> myhostname = bama.bamweb.nl
> mynetworks = 127.0.0.0/8, 82.173.141.217/32
> myorigin = $myhostname
> newaliases_path = /usr/local/sbin/newaliases
> non_fqdn_reject_code = 554
> permit_mx_backup_networks = zoph.getmyip.com
> queue_directory = /var/spool/postfix
> readme_directory = /usr/local/share/doc/postfix/readme
> recipient_delimiter = +
> relay_domains = $mydestination, hash:/etc/postfix/relay_domains
> relay_domains_reject_code = 554
> relay_recipient_maps =
> sample_directory = /etc/postfix
> sendmail_path = /usr/local/sbin/sendmail
> setgid_group = _postdrop
> smtpd_banner = $myhostname ESMTP $mail_name
> smtpd_helo_required = yes
> smtpd_recipient_restrictions = permit_mynetworks, 
> permit_mx_backup,           reject_invalid_hostname, 
> check_relay_domains,           reject_non_fqdn_hostname, 
> reject_non_fqdn_sender,           reject_non_fqdn_recipient, 
> reject_unknown_sender_domain,           reject_unknown_recipient_domain, 
>           reject_unauth_destination,           reject_rbl_client 
> relays.ordb.org,           reject_rbl_client opm.blitzed.org, 
> reject_rbl_client list.dsbl.org,           reject_rbl_client 
> sbl.spamhaus.org,           reject_rbl_client cbl.abuseat.org, 
>  reject_rbl_client dul.dnsbl.sorbs.net,           reject_rbl_client 
> dev.null.dk,           reject_rbl_client virbl.dnsbl.bit.nl, 
> reject_rbl_client smtp.dnsbl.sorbs.net,           reject_rbl_client 
> socks.dnsbl.sorbs.net,           reject_rbl_client http.dnsbl.sorbs.net, 
>           reject_rbl_client web.dnsbl.sorbs.net, check_policy_service 
> inet:127.0.0.1:60000           permit
> strict_rfc821_envelopes = yes
> unknown_address_reject_code = 554
> unknown_client_reject_code = 554
> unknown_hostname_reject_code = 554
> unknown_local_recipient_reject_code = 554
> unknown_relay_recipient_reject_code = 554
> unknown_virtual_alias_reject_code = 554
> unknown_virtual_mailbox_reject_code = 554
> unverified_recipient_reject_code = 554
> unverified_sender_reject_code = 554
> virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf 
> mysql:/etc/postfix/mysql_virtual_email2email.cf
> virtual_gid_maps = static:2000
> virtual_mailbox_base = /var/mail/vhosts
> virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains.cf
> virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailboxes.cf
> virtual_minimum_uid = 2000
> virtual_uid_maps = static:2000
> 
> 

-- 
hartelijke groeten,

Bart Dorlandt
   M: 06-22231938
   T: 0294-254992
   F: 0294-254609
   bdorlandt at nivo.nl

http://www.nivo.nl/
   Nesland 1b Weesp
   Postbus 68
   1394 ZH Nederhorst den Berg

De informatie verzonden met deze e-mail is uitsluitend bestemd voor de 
geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of 
verstrekking van deze informatie aan derden is niet toegestaan. NiVo 
network architects aanvaardt geen aansprakelijkheid voor de juiste en 
volledige overbrenging van de inhoud van een verzonden e-mail, noch voor 
tijdige ontvangst daarvan.



More information about the dovecot mailing list