On Mon, 2006-07-10 at 00:02 +0200, Arnt Gulbrandsen wrote:
Alexey Melnikov writes:
3). Arnt has requested to allow for reject+redirect to be treated as
just reject. I am not sure I like that. Opinions?
My reason:
If an implementation takes some trouble (e.g. using the postfix content
filter interface), it can evaluate some clauses of a sieve script based
only on the information in MAIL FROM and/or RCPT TO. After RCPT TO,
such an implementation may know that one clause in the script directs
the interpreter to reject the message, but it does not know whether
other actions are to be run, because other tests cannot yet be
evaluated.
As I read the current draft, such an interpreter is not allowed to
reject the RCPT TO command, because it does not yet know whether the
script is valid: The script may also try to execute some action which
is incompatible with reject.
I don't think this is needed.
my take on it: a script which is run after RCPT TO needs to give a
unambiguous answer based on the information available. if the script
only does envelope tests, takes an action and then stops, that action is
valid. if a test which accesses headers or other unavailable
information is encountered before the explicit "stop", the result of the
script is "don't know", and the implementation must accept the RCPT TO.
after DATA, the script can be rerun with all tests.
to illustrate with an example:
MAIL FROM:<>
RCPT TO:<kjetilho+ietf(_at_)ifi(_dot_)uio(_dot_)no>
if my script is:
require ["envelope", "subaddress"];
if envelope :detail "To" "ietf" {
fileinto "INBOX.ietf"; stop;
} elsif not envelope :localpart "To" "kjetilho" {
reject "Unknown subaddress"; stop;
}
if header :contains "Subject" "[birdwatch]" {
fileinto "INBOX.lists.birdwatch"; stop;
}
...
the first test yields true, the execution stops, and the fileinto means
accept the RCPT TO. for RCPT
TO:<kjetilho+whatever(_at_)ifi(_dot_)uio(_dot_)no>, reject
is taken and RCPT TO is denied. for any other RCPT TO, execution goes
on to the header test, which can't be performed until after DATA.
therefore the result is "don't know" and the RCPT TO must be accepted.
--
Kjetil T.