Kjetil Torgrim Homme writes:
On Tue, 2006-07-11 at 18:58 +0200, Arnt Gulbrandsen wrote:
I want my code to send fewer bounces, as we all do, right? So I want
to reject using SMTP, not by sending a DSN/MDN.
I think we all want this to be possible.
It occured to me that if I provide a postffix content filter
interface to the sieve interpreter, then postfix can do SMTP
rejections. The sieve interpreter must run the user's regular
active script, skip any clauses that can't be evaluated (and don't
contain stop), and see whether a reject is executed. (In my code,
this happens to be fairly simple.) Done.
thanks for the explanation. so your implementation will actually stop
at the first occurence of stop, even if it is inside a test block?
consider this script:
require "fileinto";
if header "Subject" "foo" {
fileinto "INBOX.foo";
stop;
}
reject "go away";
if I read your explanation correctly, this will never reject SMTP
time, correct?
Never at RCPT TO time. (DATA ... CRLF.CRLF time is another question; I
haven't looked at whether I could do that yet, but another
implementation might be able to.)
this may give more expressibility than my suggestion, but I haven't
found an example yet, unless you allow reject after a fileinto to be
a no-op, as you say. how do you figure the following script should be
handled?
require "fileinto";
if header "Subject" "foo" {
fileinto "INBOX.foo";
} else {
keep;
}
reject "go away";
My code (such as it is) would not be able to make a decision before
DATA. I'll withhold opinion about whether it should be possible at all
in this case.
IMO, the important bit is that a script which checks the envelope and
then does other checks works gracefully: Fail at RCPT TO if the
implementation can do that, at CRLF.CRLF if ditto and all recipients
agree, and sends a DSN/MDN/whatever if all else fails.
Arnt