Sieve variables draft support?

2007-08-01 Thread Dale Ghent

Hey all. Just curious, are there any plans re: implementing the  
variables extension to Cyrus's implementation of Sieve?

/dale

--
Dale Ghent
Specialist, UNIX and Storage Systems
UMBC - Office of Information Technology
ENG 201 - 410-443-1705




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: rename bunch of folders [auf Viren überprü ft]

2007-08-01 Thread Andrew Morgan
On Wed, 1 Aug 2007, Hans Moser wrote:

> Hans Moser schrieb:
>
>> Every user account here by default is created with a "Spam"-folder.
>> Now we like to rename all the users' Spam-folder to "Junk".
>> (Because Thunderbird by default uses the Junk-folder for this junk filter.)
>>
>> What is the best way to do this?
>> Has anyone a shell / perl script for this?
>>
>> If I do this outside IMAPd (i.e. by shell's mv command), I have to run
>> reconstruct to repair mailboxes.db, right?
> I was wrong here.
> If I do it this way, recontruct creates an Junk entry in mailboxes.db,
> but also recovers the (not more existing) folder Spam.
> So I have to edit mailboxes.db "by hand". :(

Don't mess around in the filesystem!  Use the IMAP interface to manipulate 
mailboxes.  Look at the perl module Mail::IMAPClient, in particular the 
"rename" function it provides.

Andy

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: rename bunch of folders [auf Viren überpr üft]

2007-08-01 Thread Robert Banz

On Aug 1, 2007, at 09:19, Hans Moser wrote:

> Hans Moser schrieb:
>
>> If I do this outside IMAPd (i.e. by shell's mv command), I have to  
>> run
>> reconstruct to repair mailboxes.db, right?
> First I remove the Spam dir in the file system.
> # rm -rf /var/imap/users/foo/Spam
>
> When I dump mailbox.db
> # /opt/mail/cyrus/ctl_mboxlist -d > file
> , edit dump file and delete the Spam folder row, restore mailbox.db
> # /opt/mail/cyrus/ctl_mboxlist -u < file
> and dump again
> # /opt/mail/cyrus/ctl_mboxlist -d
> , the row is still in.
>
> How do I get rid of the Spam folder?

If you're re-importing the entire mailboxes.db, you have to delete  
the database file itself and let it re-create it.

-u "updates" it, but doesn't remove things.

-rob

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: rename bunch of folders [auf Viren überprü ft]

2007-08-01 Thread Hans Moser
Hans Moser schrieb:

> If I do this outside IMAPd (i.e. by shell's mv command), I have to run
> reconstruct to repair mailboxes.db, right?
First I remove the Spam dir in the file system.
# rm -rf /var/imap/users/foo/Spam

When I dump mailbox.db
# /opt/mail/cyrus/ctl_mboxlist -d > file
, edit dump file and delete the Spam folder row, restore mailbox.db
# /opt/mail/cyrus/ctl_mboxlist -u < file
and dump again
# /opt/mail/cyrus/ctl_mboxlist -d
, the row is still in.

How do I get rid of the Spam folder?


Hans

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: rename bunch of folders [auf Viren überprüft]

2007-08-01 Thread Michael Menge

Hi,

i don't have a perl scritp for this, but it should be easy to edit one  
of the exapmple sripts to do this.




Quoting Hans Moser <[EMAIL PROTECTED]>:


Hans Moser schrieb:


Every user account here by default is created with a "Spam"-folder.
Now we like to rename all the users' Spam-folder to "Junk".
(Because Thunderbird by default uses the Junk-folder for this junk filter.)

What is the best way to do this?
Has anyone a shell / perl script for this?

If I do this outside IMAPd (i.e. by shell's mv command), I have to run
reconstruct to repair mailboxes.db, right?

I was wrong here.
If I do it this way, recontruct creates an Junk entry in mailboxes.db,
but also recovers the (not more existing) folder Spam.
So I have to edit mailboxes.db "by hand". :(

Hans

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






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: rename bunch of folders [auf Viren überprü ft]

2007-08-01 Thread Hans Moser
Hans Moser schrieb:

> Every user account here by default is created with a "Spam"-folder.
> Now we like to rename all the users' Spam-folder to "Junk".
> (Because Thunderbird by default uses the Junk-folder for this junk filter.)
> 
> What is the best way to do this?
> Has anyone a shell / perl script for this?
> 
> If I do this outside IMAPd (i.e. by shell's mv command), I have to run
> reconstruct to repair mailboxes.db, right?
I was wrong here.
If I do it this way, recontruct creates an Junk entry in mailboxes.db, 
but also recovers the (not more existing) folder Spam.
So I have to edit mailboxes.db "by hand". :(

Hans

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: Sieve vacation

2007-08-01 Thread Marco Colombo
Ethariel wrote:
> Hello,
> 
> I've installed cyrus-imapd (2.2.13 on MDV 2007). Sieve scripts are
> working fine except 'vacation'.
> User 1 has a vacation script with days: 1
> User 2 sents an email to user1 it receives an answer (the correct
> vacation message).
> Then after User2 can send email the same day or three days after, it
> will not receive anymore automatic answer.
> If I delete user1 script, and recreate a new one with another vacation
> alert, then it works fine for one more mail.
> 
> The Sieve draft describes 'Day' as the period between two answers, but
> this value can be bypass by 'SITE' value.
> Where do I check site value ? Or are they any known bugs in 2.2.13 Sieve
> implementation ?
> (I've searched the archive without success).
> 
> Thks to all
> 
> Ethariel

Hi,
I've been hit by the same problem, recently. I've positively verified
that sieve pushed an entry into the deliverdb (which is used to remember
 whom the autoresponse has already been sent to) with a timestamp of
(now + 3 days) instead of +1.

I've been digging through the source, both of 2.2.12 (which I'm running)
and of 2.3.8. The current minimum for :days seems to be hardcoded to 3 days.

I'm not totally sure this is intented, tho. It smells like an 'unwanted
feature'. Here's what I've found:

- in the sieve source, you've got a function named
sieve_register_vacation(), which take a C struct as an argument. This
struct has 4 member, of which two have inspiring names: min_response and
max_response. The relevant part of the code follows:

if (v->min_response == 0) v->min_response = 3;
if (v->max_response == 0) v->max_response = 90;

so, if the caller doesn't specify a min_response, the default is 3.
We're here inside the sieve parser, so this min_response is what
according to the RFC is a limit set by the implementation, and it's
totally fine, per spec, for the parser to accept an user script with
:days 1 but set it to the minimum value, 3.
You can see the source here:
https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/sieve/interp.c?rev=1.24

- in the same place you find the source of sievec, which is the
command-line compiler for sieve scripts. This program only parses and
compliles a sieve script, and never actually executes it. Sieve scripts
are executed by lmtpd (part of the cyrus imapd), as a step of the
delivery process. Inside sievec.c you find:

sieve_vacation_t vacation = {
0,  /* min response */
0,  /* max response */
(sieve_callback *) &foo,/* autorespond() */
(sieve_callback *) &foo /* send_response() */
};

The foo() function is a dummy one, the two callback are called only at
execution time, not at parse/compile time, of course. Note that as far
as sievec is concerned, it does not specify limits, so the library
defaults, 3 and 90, come into play.

- in the cyrus-imapd source, you find timsieved, which provides a way
for remote users to update their sieve scripts. It seems it does not use
sievec to compile the script, it links to the sieve library instead.
Unsurprisingly, you see:

sieve_vacation_t vacation = {
0,  /* min response */
0,  /* max response */
(sieve_callback *) &foo,/* autorespond() */
(sieve_callback *) &foo /* send_response() */
};

Scripts are compiled by timsieved exactly in the same way sievec does.
See:
https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/cyrus/timsieved/scripttest.c?rev=1.24

- now the fun starts. There's another place where you can find a sieve
parser. It's inside lmtpd. If I'm not mistaken, this parser is not used
to parse/compile scripts, as lmtpd now looks for pre-compiled scripts
only. Anyway there is it, and it also calls sieve_register_vacation(),
but now the struct is different:

/* vacation support */
sieve_vacation_t vacation = {
1,  /* min response */
31, /* max response */
&autorespond,   /* autorespond() */
&send_response, /* send_response() */
};

Now, I think this struct is not actually been used any more. But it's
interesting to note that here the min response is set to 1. This
overrides the library default, and becomes the new implementation minimum.

See:
https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/cyrus/imap/lmtp_sieve.c?rev=1.15

I'd hardly call this a bug, but suspect that originally the intended
behaviour of sieve inside lmtpd (that is, cyrus imapd), was to set the
minimum of :days to 1, and not 3. By moving to precompiled scripts, this
 setting has been lost, since all the other compilers now relay on the
library default, which is 3.

Of course I'm not much familiar with all the source, and I may be
missing something.

.TM.

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