Quota issue in Ubutu/Postfix

Discussion in 'HOWTO-Related Questions' started by blinden, Sep 14, 2010.

  1. blinden

    blinden New Member

    I've tried searching for a long time, and everything seem to lead me nowhere. I'm using this guide:

    http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu-10.04

    which has worked WONDERFULLY, thank you very much, every single thing is working flawlessly except my mailbox quotas. I've read and reread the section on quotas, and did the section 3 "Apply The Quota Patch To Postfix" part.

    The funny thing is, I did it last week following the same tutorial, and it worked, but that was a proof of concept run for me and I used really weak passwords and settings, so I wanted to redo it and hopefully go live with it.

    The only difference is, I didn't install squirrel mail this time, I went straight to roundcube. I briefly reviewed the squirrel mail section, just to see if there were any items in that step that may pertain to the quotas, but I saw none

    I've looked at every postfix config file and I don't see anything anywhere that would create this issue. Unless there is a separate config file for this postfix vda that I did not see.

    Thanks for any help, I can't believe how comprehensive the writeups are here, truly amazing, hopefully this week we can have one less windows mail server in the world.
     
  2. blinden

    blinden New Member

    Little further information as I'm now sextiple checking my configs, everything still looks good

    I have the correct data in the mysql-virtual_mailbox_limit_maps.cf

    Code:
    query = SELECT quota FROM users WHERE email='%s'
    and the like, has the correct db information, so it shouldn't be a connection issue, as well as the mysql logs don't show any issues

    the main.cf file seems to be correct, but I've been playing around with it a bit

    the line that reads

    Code:
    mailbox_size_limit = 0
    I tried changing that to a fixed number, just to see what would happen, nothing changed, I tried commenting it out as well, no change, I did remove the 'proxy: from in front of all the lines that call the postfix .cf files, but other then that, all the lines read exactly as I pulled them from the how-to.

    man, I hope I can't sort this out, everything else is working flawlessly, but we have a few users that would definitely go nuts, have a few people bouncing off the current size restriction on a daily basis so I need to have this hard limit in here or it will get ridiculous real quick so I can't go live with it
     
  3. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Can you post your main.cf?

    Are there any errors in your mail log?
     
  4. blinden

    blinden New Member

    Unfortunately I'm out of the office sick today, however, the main.cf is a carbon copy from your howto (which is amazingly complete and easy to follow). There were no errors in any of the logs that I found.

    I definitely had this working the first time around, I have a feeling it has something to do with the way the VDA patch is applying for some reason. Would it mess anything up if I just uninstalled the postfix package and tried to reinstall it?
     
  5. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Get well soon!

    No, you can try that.
     
  6. blinden

    blinden New Member

    Back in the office!

    got the main.cf for review

    Code:
    myhostname = xxx
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = xxx, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8
    #mailbox_size_limit = 524288000
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    transport_maps = mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The mailbox you are attempting to send to is full."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbo$
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    message_size_limit = 31457280
    didn't see anything wonky there, if there is, I'll be mad because I've stared at that file for days. (one line I'm not sure about is "proxy read maps", it cutoff though, it is full in the actual file)

    Checking through all the logs I can think to check and don't see anything that would be related to the quota. I feel like it would either be the VDA patch itself nto applying correctly, or communication to the quota maps, but I think I would see something in the logs about trying to access the quota maps if that were the case, that seems to be working okay, or not trying at all.
     
    Last edited: Sep 16, 2010
  7. blinden

    blinden New Member

    Well, good news and badnews.

    Good news, I got it working, bad news, I don't have any idea what changed.

    I removed and reinstalled postfix, no change, so I did a few other things, simple stuff like deleted and recreated the mailbox_limit_maps.cf and such, and no changes, then I created a new account, and it worked, all new accounts now have quotas, but the old ones do not, which I do not care about because they are simply test accounts on a couple test domains. So, unfortunately, I have nothing to report as far as what actually fixed the problem.

    Thanks for your time Falko, and any others who read and thought about my posts.
     
  8. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Sometimes computers just don't act logical... :D
     
  9. blinden

    blinden New Member

    Well, today when I got to work, the old accounts now have quotas... so, even less logical, but, issue closed, server going live monday morning after some tough weekend testing of a couple test domains!
     
  10. blinden

    blinden New Member

    Here's a stupid question. Does doing an update of postfix break the VDA patch?

    Quotas are now showign yesterday's stats, but not applying any new space taken as of this morning when I did some updates to the system.

    edit:

    nothing makes sense to me anymore...

    I created a new email account with a 10meg quota and sent it an email with a ~5 meg attachment just to see wh atwould happen, it shows up as counting against the quota, of 48MB? I must have done something to really irritate the quota gods at some point in my life.
     
    Last edited: Sep 17, 2010
  11. blinden

    blinden New Member

    Well... I think I got somewhere, still doing this weird 48meg default quota size, but I found in the mail.info file, everytime I go to create a new account (I have about 15 accounts now that I've created with the purpose of testing this quota issue) I get this error message

    postfix/virtual[3450]: warning: connect to mysql server 127.0.0.1: Access denied for user 'dbuser'@'localhost' (using password: YES)

    at the exact same time I get a followup message:

    postfix/virtual[2019]: 2DE0738054C: to=<test@domain.tld>, relay=virtual, delay=0.04, delays=0.01/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)

    The mail does, in fact, come through, but I think this sql error is why it's not reading the quota information properly from the DB and getting this 50meg number from I don't know where.

    EDIT--
    Well, that was stupid, this morning when I first got in and started working, I moved a couple files around, namely the .cf files in the /etc/postfix directory, and their group got changed from postfix to root. Everything IS indeed working now as planned, but I still don't know where that 48meg default was coming from for the mailbox size when it couldn't connect to the SQLdb
     
    Last edited: Sep 17, 2010

Share This Page