2

I implemented warning maildrop when quota exceeded. This worked correctly except for one detail.

The drawback is that sending mail notice is sent only time... I mean for example if the mailbox has been exceeded by more than 80 %, as I have configured , sends e- mail notification when exceeded, up there all right.

The problem is that if the mailbox is exceeded, even after 24 hrs no resend alert.

I noticed that when a mailbox exceeds the limit a file is created called quotawarn in the folder for the mailbox exceeded /home/vmail/domain/mailbox/quotawarn. If I delete that file, immediately the notice is sent. So that seems to come out there the topic.

I noticed in the documentation and understand that should function as says here, meaning that the warning limit is exceeded resend after 24 hrs, but this does not work.

Any idea ? thanks

masegaloeh
  • 18,236
  • 10
  • 57
  • 106

1 Answers1

1

Put the solution by Sam Varshavchik from cross-posted question in courier-maildrop mailing list

The timestamp of the existing quotawarn file gets used to determine when the 24 hours since the last warning messages has elapsed.

Check the timestamp of the quotawarn file.

Additionally, in order for the warning to work, of course, all mail must be delivered using maildrop or deliverquota. If you have something else that's delivering mail, it is going to ignore quotawarn; that goes without saying.


In other words here the pseudocode to check this case

if there is incoming email
    if postfix deliver it via maildrop or deliverquota
        if quota threshold > 0
            if size of maildir > quota threshold
                if there is quotawarn file
                    if modified time of quotawarn + 86400 < now
                        write blank string to quotawarn file
                        put warning email into user mailbox
masegaloeh
  • 18,236
  • 10
  • 57
  • 106