Author Topic: Email quota problem  (Read 23 times)

maxiozzia

  • Newbie
  • *
  • Posts: 3
    • View Profile
Email quota problem
« on: March 07, 2019, 03:53:10 am »
I have installed a fresh ubuntu/ehcp system and all is working fine.

the only problem is that quota email is not working in postfix, for example if I set limit 1mb on a user email , after reaching limit mail are not bounced as I expect.

In postfix main.cf virtual maildir options are enabled:

virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes

in previous version I have patched postfix whith VDA patch but now (postfix version 3.3.0) isn't supported.

Anyone have suggestions to enable quota management?

earnolmartin

  • Administrator
  • Full Member
  • *****
  • Posts: 182
    • View Profile
Re: Email quota problem
« Reply #1 on: March 13, 2019, 05:23:33 pm »
Interesting.  I didn't know anything about this.  Which version of Ubuntu are you using?  18.04?

Have you tried applying this patch for 3.3.x? 

https://sourceforge.net/p/vda/bugs/2/

I assume these instructions should still work for patching it (obviously use the 3.3 patch instead of the 2.x one they are using). 

https://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu-9.10

If that works for you, could you please post the patched deb file or upload it here https://dragndropz.com in file mode (zip it first)?  I can have Ubuntu 18.04 automatically use that deb package so that the patch will work out of the box.

Let me know how that goes.

maxiozzia

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Email quota problem
« Reply #2 on: March 15, 2019, 10:56:36 am »
Thank you for your reply, I will try this patch asap and share the results.


maxiozzia

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Email quota problem
« Reply #3 on: March 17, 2019, 12:46:37 pm »
Problem solved whith the patch you have suggested and some other adjustments.

System ubuntu 18.04 default postfix 3.3.0

1 - updated postfix to 3.3.2 (but I think it work also on 3.3.0) here source: https://packages.ubuntu.com/disco/amd64/postfix/download

2 - patched using this commands:
- aptitude build-dep postfix
- cd /usr/src
- apt-get source postfix
- wget https://sourceforge.net/p/vda/bugs/2/attachment/vda_3.3.patch
- cd postfix-3.3.2
- patch -p0 < ../vda_3.3.patch
- dpkg-buildpackage  ( if return any errors add "-b" at the end)

3 - re-installed postfix and postfix-mysql packages:
- cd ..
- dpkg -i postfix_3.3.2-4_amd64.deb postfix-mysql_3.3.2-4_amd64.deb

4 - postfix adjustments:
- in main.cf changed "virtual_mailbox_extended = yes" to "virtual_maildir_extended = yes"

- changed /etc/postfix/mysql-virtual_mailbox_limit_maps.cf  :
user = ehcp
password = yourpassword
dbname = ehcp
query = SELECT quota*1048576 FROM emailusers WHERE email='%s'
hosts = 127.0.0.1


Now it seems email where bounced when reach quota limit.

here http://www.maxiozzia.it/src.rar you can download .deb files used and I suggest to add possibility to set via control panel the maximum quota that the user can assign for each new email account

Best regards

Max