Mysql – Postfix & Dovecot: Mailbox Quota Configurations

dovecotemail-serverMySQLpostfix

I'm running Postfix 2.11, Dovecot 2.2.9 and MySQL 5.6.27 under Ubuntu 14.04.3.

I've configured Postfix to support virtual mailboxes but it seems that there're some problems with the quota settings.

~$ sudo service postfix reload
 * Reloading Postfix configuration...
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_limit_message=Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_limit_override=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_overquota_bounce=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_extended=yes
   ...done.

However, although the parameters are ignored by Postfix, the quota limitation is still functioning normally because I have also configured it in Dovecot. If I send an email to a mailbox without any space left, I'll get:

<full@example.com>: host mail.example.com[private/dovecot-lmtp] said: 552
    5.2.2 <full@example.com> Quota exceeded (mailbox for user is full) (in
    reply to end of DATA command)

I'm really confused now. Here're two questions:

  1. Why the parameters are ignored by Postfix?
  2. I know that sending and receiving emails are handled by Postfix, then if the quota settings for Postfix are not correct, how can Dovecot refuse the email during the receiving procedure?

postconf output

http://pastebin.com/rB6UF03u

Best Answer

Postfix doesn't support quotas out of the box, there are a few different ways to set it up. I would recommend using Dovecot to manage the quotas if it's already working. You can find more information on how to set up quotas on this page: http://www.postfix.org/addon.html#quota

Answers to your questions:

  1. Those parameters are for the VDA patch, which probably isn't applied on your system: http://vda.sourceforge.net/

  2. Sometimes postfix is configured to query Dovecot, or pass the emails to Dovecot before making a decision whether to accept / bounce. Post the output of the postconf command if you want an exact answer.

Edit: Based on your config, this parameter:

virtual_transport = lmtp:unix:private/dovecot-lmtp

Is telling postfix to pass emails for virtual mailboxes to dovecot for delivery. It does this using lmtp (search for it). Then dovecot receives the email and decides how to handle it based on its configuration. Note this doesn't apply to local user mailboxes such as root, just the virtual mailboxes.