Dominic Malolepszy
2012-Aug-23 06:48 UTC
[Dovecot] Dovecot generate file when over quota detected
Hi, I am curious if Dovecot can add an empty file into a Maildir folder as soon as a mailbox has exceeded 100% capacity, and later when it detects the quota has fallen below 100% unlink the file. The idea is the Dovecot LDA would deliver the message and if this caused the mailbox to reach 100%+, add a file into the maibox say "username/Maildir/overquota". Interactions via Dovecot IMAP/POP3 that lower the mailbox usage, for example the user popping, or deleting mail from the mailbox would trigger Dovecot to unlink the file. This means that an MTA can efficiently check for the existence of this 'overquota' file and return a "user at domain.com Mailbox full" TEMPFAIL error early during the SMTP transaction prior to accepting any data. Dominic
Timo Sirainen
2012-Aug-31 13:40 UTC
[Dovecot] Dovecot generate file when over quota detected
On 23.8.2012, at 9.48, Dominic Malolepszy wrote:> I am curious if Dovecot can add an empty file into a Maildir folder as soon as a mailbox has exceeded 100% capacity, and later when it detects the quota has fallen below 100% unlink the file. The idea is the Dovecot LDA would deliver the message and if this caused the mailbox to reach 100%+, add a file into the maibox say "username/Maildir/overquota". Interactions via Dovecot IMAP/POP3 that lower the mailbox usage, for example the user popping, or deleting mail from the mailbox would trigger Dovecot to unlink the file.Quota warning scripts can do that. http://wiki2.dovecot.org/Quota/Configuration#Quota_warnings
Dominic Malolepszy
2012-Aug-31 14:23 UTC
[Dovecot] Dovecot generate file when over quota detected
On 31/08/2012 11:40 PM, Timo Sirainen wrote:> On 23.8.2012, at 9.48, Dominic Malolepszy wrote: > >> I am curious if Dovecot can add an empty file into a Maildir folder as soon as a mailbox has exceeded 100% capacity, and later when it detects the quota has fallen below 100% unlink the file. The idea is the Dovecot LDA would deliver the message and if this caused the mailbox to reach 100%+, add a file into the maibox say "username/Maildir/overquota". Interactions via Dovecot IMAP/POP3 that lower the mailbox usage, for example the user popping, or deleting mail from the mailbox would trigger Dovecot to unlink the file. > Quota warning scripts can do that. http://wiki2.dovecot.org/Quota/Configuration#Quota_warnings > >They appear to trigger during maildelivers say via the LDA, however IMAP mailbox interactions (say deleting an email or copying an email) do not trigger them. I ended up having this patched into the quota plugin and works a treat.
Timo Sirainen
2012-Aug-31 14:26 UTC
[Dovecot] Dovecot generate file when over quota detected
On 31.8.2012, at 17.23, Dominic Malolepszy wrote:> On 31/08/2012 11:40 PM, Timo Sirainen wrote: >> On 23.8.2012, at 9.48, Dominic Malolepszy wrote: >> >>> I am curious if Dovecot can add an empty file into a Maildir folder as soon as a mailbox has exceeded 100% capacity, and later when it detects the quota has fallen below 100% unlink the file. The idea is the Dovecot LDA would deliver the message and if this caused the mailbox to reach 100%+, add a file into the maibox say "username/Maildir/overquota". Interactions via Dovecot IMAP/POP3 that lower the mailbox usage, for example the user popping, or deleting mail from the mailbox would trigger Dovecot to unlink the file. >> Quota warning scripts can do that. http://wiki2.dovecot.org/Quota/Configuration#Quota_warnings >> >> > They appear to trigger during maildelivers say via the LDA, however IMAP mailbox interactions (say deleting an email or copying an email) do not trigger them. I ended up having this patched into the quota plugin and works a treat.The quota plugin, including quota warnings, works identically in LDA and IMAP. So I wonder what your patch does. Of course in IMAP a mail deletion is often a copy+mark as deleted with the expunge happening sometimes later.