Re: quota check befor sieve script?
On Jan 29, 2008 3:16 PM, Michael Menge <[EMAIL PROTECTED]> wrote: > Quoting Alain Spineux <[EMAIL PROTECTED]>: > > > On Jan 29, 2008 9:06 AM, Michael Menge > > <[EMAIL PROTECTED]> wrote: > > > >> Is there a way to only send the over quota bounces if the message hits > >> a keep, fileinto or implicite keep action or to accept the email if it > >> hits a forward or discarde action and to ignore the keep and fileinto > >> actions in case of overquota? > > > > Sieve script need often mail header data to make its check. > > This means the mail was already accepted by LMTP when sieve script run. > > This means probably "no" to your question. > > I havent looked at the LMTP protokoll, but i think it is like the SMTP > protokoll if I'm correct we can reject a message in the DATA stage, > after we have recieved the message. A problem may be with messages to > more then one user. > The sending server don't know which user caused the "over quota". No because lmtpd return an "accept" or "reject" address by address something like 250 [EMAIL PROTECTED] 250 [EMAIL PROTECTED] ... > > On the other hand there is the option lmtp_strict_quota which means > that lmtpd knows the size, but as far as i know from SMTP the size is > not part of the envelope but the data. > > > > > Anyway your question is not without interest, > > but add such a feature add some problemes like what to do at > > each retry of the SMTP ? Run the same sieve script again and again > > on the same > > piece of mail until the quota let it in? > > On, i would only return an 4xx or 5xx error if the message was not discarded > and not forwarded and if quota was exceeded. This would mean that > discarded and forwarded messages would be only seen once, and messages > that would only be stored in a folder may cause an over quota bounce. > > But this may cause that local copies of forwarded messages may be > lost, as the message would only be forwarded. Same applies to > discarded messages, but i don't > see a reason why anyone would discard a mail in one rule and safe it > in an other. You must extend sieve with LMTP return code.This is to the script writer to choose what to do when this append, and witch code to return to LMTP. > > The other way would be to remember all actions to be performed on a > message and if the message will be stored (fileinto, keep) and the > quota is exceeded then bounce and perform no action. If the message is > not stored the message does not exceede the quota and the actions can > be performed. If you have forwarded the mail but were not able to deliver it, you must remember for next LMTP retry to not forward it again ! > > > > > M.Menge Tel.: (49) 7071/29-70316 > Universitaet Tuebingen Fax.: (49) 7071/29-5912 > Zentrum fuer Datenverarbeitung mail: > [EMAIL PROTECTED] > Waechterstrasse 76 > 72074 Tuebingen > -- Alain Spineux aspineux gmail com May the sources be with you Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
Re: quota check befor sieve script?
Quoting Alain Spineux <[EMAIL PROTECTED]>: On Jan 29, 2008 9:06 AM, Michael Menge <[EMAIL PROTECTED]> wrote: Is there a way to only send the over quota bounces if the message hits a keep, fileinto or implicite keep action or to accept the email if it hits a forward or discarde action and to ignore the keep and fileinto actions in case of overquota? Sieve script need often mail header data to make its check. This means the mail was already accepted by LMTP when sieve script run. This means probably "no" to your question. I havent looked at the LMTP protokoll, but i think it is like the SMTP protokoll if I'm correct we can reject a message in the DATA stage, after we have recieved the message. A problem may be with messages to more then one user. The sending server don't know which user caused the "over quota". On the other hand there is the option lmtp_strict_quota which means that lmtpd knows the size, but as far as i know from SMTP the size is not part of the envelope but the data. Anyway your question is not without interest, but add such a feature add some problemes like what to do at each retry of the SMTP ? Run the same sieve script again and again on the same piece of mail until the quota let it in? On, i would only return an 4xx or 5xx error if the message was not discarded and not forwarded and if quota was exceeded. This would mean that discarded and forwarded messages would be only seen once, and messages that would only be stored in a folder may cause an over quota bounce. But this may cause that local copies of forwarded messages may be lost, as the message would only be forwarded. Same applies to discarded messages, but i don't see a reason why anyone would discard a mail in one rule and safe it in an other. The other way would be to remember all actions to be performed on a message and if the message will be stored (fileinto, keep) and the quota is exceeded then bounce and perform no action. If the message is not stored the message does not exceede the quota and the actions can be performed. M.Menge Tel.: (49) 7071/29-70316 Universitaet Tuebingen Fax.: (49) 7071/29-5912 Zentrum fuer Datenverarbeitung mail: [EMAIL PROTECTED] Waechterstrasse 76 72074 Tuebingen smime.p7s Description: S/MIME krytographische Unterschrift Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
Re: quota check befor sieve script?
On Jan 29, 2008 9:06 AM, Michael Menge <[EMAIL PROTECTED]> wrote: > Hi, > > i don't know if this is a bug or a feature, but it seems that lmtpd > checks quota befor a e-mail is parsed by the sieve script. This causes > over quota bounces for > messages that would have been discarded or redirected. > > Is there a way to only send the over quota bounces if the message hits > a keep, fileinto or implicite keep action or to accept the email if it > hits a forward or discarde action and to ignore the keep and fileinto > actions in case of overquota? Sieve script need often mail header data to make its check. This means the mail was already accepted by LMTP when sieve script run. This means probably "no" to your question. Anyway your question is not without interest, but add such a feature add some problemes like what to do at each retry of the SMTP ? Run the same sieve script again and again on the same piece of mail until the quota let it in? Regards. > > regards > > Michael Menge > > > M.Menge Tel.: (49) 7071/29-70316 > Universitaet Tuebingen Fax.: (49) 7071/29-5912 > Zentrum fuer Datenverarbeitung mail: > [EMAIL PROTECTED] > Waechterstrasse 76 > 72074 Tuebingen > > > Cyrus Home Page: http://cyrusimap.web.cmu.edu/ > Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki > List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html > -- Alain Spineux aspineux gmail com May the sources be with you Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
Re: quota check befor sieve script?
Michael Menge wrote: > Hi, > > i don't know if this is a bug or a feature, but it seems that lmtpd > checks quota befor a e-mail is parsed by the sieve script. This causes > over quota bounces for > messages that would have been discarded or redirected. > > Is there a way to only send the over quota bounces if the message hits > a keep, fileinto or implicite keep action or to accept the email if it > hits a forward or discarde action and to ignore the keep and fileinto > actions in case of overquota? I understand your concern, but the problem is that by definition, if a Sieve script fails, the message MUST be delivered to the intended mailbox. However, if the mailbox is over quota, we can't do this. The simplest way to handle the situation is to do the quota check before processing the script, regardless of the final disposition. If you want to look at the code and find a better way, I'll be happy to look at a patch. -- Kenneth Murchison Systems Programmer Project Cyrus Developer/Maintainer Carnegie Mellon University Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html