Author Topic: Email quota problem  (Read 108 times)

maxiozzia

  • Newbie
  • *
  • Posts: 9
    • 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: 193
    • 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: 9
    • 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: 9
    • 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

earnolmartin

  • Administrator
  • Full Member
  • *****
  • Posts: 193
    • View Profile
Re: Email quota problem
« Reply #4 on: April 01, 2019, 07:40:56 pm »
Thanks for the information!  Would you be willing to test the panel on a fresh install of Ubuntu 18.04 once I get this fix added? 

I plan on using the default version of postfix though (so that you don't have to upgrade the postfix-mysql package either).  Would be great if you'd be willing to test it out on a test machine. 
« Last Edit: April 01, 2019, 08:10:45 pm by earnolmartin »

earnolmartin

  • Administrator
  • Full Member
  • *****
  • Posts: 193
    • View Profile
Re: Email quota problem
« Reply #5 on: April 01, 2019, 11:38:21 pm »
If you can, please test a fresh install of the EHCP dev version on an Ubuntu 18.04 test machine:

http://ehcpforce.tk/download.php#ehcpforceinstall-dev

See if the postfix quota works out of the box now?  Let me know.  :)


maxiozzia

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Email quota problem
« Reply #6 on: April 02, 2019, 08:49:46 am »
Yes I will test it, I will do it asap and report the result.

maxiozzia

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Email quota problem
« Reply #7 on: April 06, 2019, 06:50:22 am »
Hi earnolmartin,

I have just finished to test your work, all fine except for the "point 4" of my post:

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


Without this mod system don't create the "maildirsize" file in the virtual mailbox dir.

Adding this in the postfix main.cf all works fine.

Great work!

earnolmartin

  • Administrator
  • Full Member
  • *****
  • Posts: 193
    • View Profile
Re: Email quota problem
« Reply #8 on: April 08, 2019, 08:49:00 pm »
Thanks a lot for testing!  I really appreciate your help.

It should be fixed now.  It doesn't seem to hurt to have both commands in there, so maybe for older systems, the old one will work unless that entry has always been wrong.  Anyways, there's no harm in having both settings in the main.cf file according to my tests.

 ;D

maxiozzia

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Email quota problem
« Reply #9 on: May 10, 2019, 08:27:35 am »
sorry for late reply,

tested again and work perfectly.

Great work!!!

Thanks

earnolmartin

  • Administrator
  • Full Member
  • *****
  • Posts: 193
    • View Profile
Re: Email quota problem
« Reply #10 on: May 10, 2019, 12:14:03 pm »
No worries.  It looks like we'll have to apply the patch to the deb source for each major LTS version of Ubuntu.  The same patched package failed to install in 19.04, so for now, email quotas will only work in Ubuntu 18.04.