I am having problems getting sieve to operate properly. This version of
sieve and cyrus are from the FreeBSD Release 4.4 ports tree
ports/mail/cyrus-imapd cvsuped on 8-Nov-01.

See the attached file for a full description of the problem.  The
sieveshell parser/interpreter code seems to be a bit flakey.  There is
also one huge security hole where the password is echoed to the screen.

Cheers:
-arc

Arley Carter                            [EMAIL PROTECTED]
Tradewinds Technologies, Inc.           www.twinds.com
Winston-Salem, NC  USA                  Network Engineering & Security  
336-817-9554


telnet to sieve server from regular user acct.
$ telnet localhost sieve
Trying 127.0.0.1...
Connected to localhost.marine.twinds.com.
Escape character is '^]'.
"IMPLEMENTATION" "Cyrus timsieved v1.0.0"
"SASL" "LOGIN PLAIN DIGEST-MD5 CRAM-MD5"
"SIEVE" "fileinto reject envelope vacation imapflags notify subaddress regex"
OK

logout
Ok "Logout Complete"
Connection closed by foreign host.

install sieve script example1

Example from rfc 3028 pg 33
require ["fileinto"];
if header :is "From:" "The SANS Institute <[EMAIL PROTECTED]>"
        {
        fileinto "sans";
        }


$ sieveshell localhost
connecting to localhost
Please enter your password: XXXXXXXXXX  Echoes password to screen - BAD! 
> put example1
> 
# pwd
/var/imap/sieve/a/arc
tuna# ls -l
total 1
-rw-------  1 cyrus  mail  135 Nov 13 10:05 example1.script

Then when test is run against a message containing that header:

tuna# test /var/spool/imap/user/arc/1. /var/imap/sieve/a/arc/default
test: /var/imap/sieve/a/arc/default: unexpected operator

Or:

tuna# test /var/spool/imap/user/arc/1. /var/imap/sieve/a/arc/example1.script
test: /var/imap/sieve/a/arc/example1.script: unexpected operator

Then: 
> delete example1
Bad protocol from MANAGESIEVE server: expected string
$ 

While I was cruising the source for clues to source of this problem I came 
across this inconsistency in the source for the operator reject. I don't know i
it directly relates to this error but it appears to be odd. The variables 
reject and REJCT are defined.  Does REJCT serve a different purpose than
reject? Or is this a source for the "unexpected operator" error?

In the sieve subdirectory in /usr/ports/mail/cyrus-imapd:
grep reject *.c *.h 

addr-lex.c:#define REJECT reject_used_but_not_detected
interp.c:    i->redirect = i->discard = i->reject = i->fileinto = i->keep = NULL;
interp.c:static const char *sieve_extensions = "fileinto reject envelope vacation"
interp.c:int sieve_register_reject(sieve_interp_t *interp, sieve_callback *f)
interp.c:    interp->reject = f;

message.c:/* reject message m with message msg
message.c:int do_reject(action_list_t *a, char *msg)
message.c: * incompatible with: reject
message.c: * incompatible with: reject
message.c: * incompatible with: reject
message.c: * incompatible with: reject
message.c: * incompatible with: reject
message.c: * incompatible with: reject
message.c: * incompatible with: reject
message.c: * incompatible with: reject
script.c:    } else if (!strcmp("reject", req)) {
script.c:       if (s->interp.reject) {
script.c:           s->support.reject = 1;
script.c:           res = do_reject(actions, c->u.str);
script.c:           if (!s->interp.reject)
script.c:           ret = s->interp.reject(&a->u.rej,
sieve.c:{ if (!parse_script->support.reject) {
sieve.c:                                     yyerror("reject not required");
test.c:int reject(void *ac, void *ic, void *sc, void *mc, const char **errmsg)
test.c:    sieve_reject_context_t *rc = (sieve_reject_context_t *) ac;
test.c:    printf("rejecting message '%s' with '%s'\n", m->name, rc->msg);
test.c:    res = sieve_register_reject(i, &reject);
test.c: printf("sieve_register_reject() returns %d\n", res);
interp.h:    sieve_callback *redirect, *discard, *reject, *fileinto, *keep;
message.h:      sieve_reject_context_t rej;
message.h:int do_reject(action_list_t *m, char *msg);
script.h:       int reject    : 1;
sieve_interface.h:typedef struct sieve_reject_context {
sieve_interface.h:} sieve_reject_context_t;
sieve_interface.h:int sieve_register_reject(sieve_interp_t *interp, sieve_callback 
*f);

 grep REJCT *.c *.h |more
script.c:       case REJCT:
sieve-lex.c:return REJCT;
sieve.c:#define REJCT   262
sieve.c:"STRING","IF","ELSIF","ELSE","REJCT","FILEINTO","FORWARD","KEEP","STOP",
"DISCARD",
sieve.c:                                   yyval.cl = new_command(REJCT); yyval.
cl->u.str = yyvsp[0].sval; ;
tree.c: case REJCT:
sieve.h:#define REJCT   262


Reply via email to