[Dovecot] dovecot-lda, sieve, maildir
I'm unable to get dovecot-lda with sieve filtering to deliver into maildir folders. The examples on the wiki explicitly say "mbox", so I'm wondering, does the dovecot-lda sieve implementation not support filtering into maildir folders?
-frank
Frank Cusack wrote:
I'm unable to get dovecot-lda with sieve filtering to deliver into maildir folders. The examples on the wiki explicitly say "mbox", so I'm wondering, does the dovecot-lda sieve implementation not support filtering into maildir folders?
-frank Maildirs work fine, example:
require "fileinto";
# SPAM if header :comparator "i;ascii-casemap" :is "X-DSPAM-Result" "Spam" { fileinto "SPAM"; stop; }
# Subfolder if address :all :comparator "i;ascii-casemap" :contains "From" "someone@example.com" { fileinto "INBOX.Somefolder"; stop; }
On 7/3/06, Peter Fern <dovecot@obfusc8.org> wrote:
Maildirs work fine, example:
require "fileinto";
# SPAM if header :comparator "i;ascii-casemap" :is "X-DSPAM-Result" "Spam" { fileinto "SPAM"; stop; }
Not sure if your doing more work than needed here...
if header :contains ["X-DSPAM-Result"] "Spam" { fileinto "Spam"; stop; }
This does exactly the same as what yours does, and I'm not sure how it would compare in resources or not, but it's certainly easier to write! ;-)
Tim
Linux Counter user #273956
Timothy White wrote:
On 7/3/06, Peter Fern <dovecot@obfusc8.org> wrote:
Maildirs work fine, example:
require "fileinto";
# SPAM if header :comparator "i;ascii-casemap" :is "X-DSPAM-Result" "Spam" { fileinto "SPAM"; stop; }
Not sure if your doing more work than needed here...
if header :contains ["X-DSPAM-Result"] "Spam" { fileinto "Spam"; stop; }
This does exactly the same as what yours does, and I'm not sure how it would compare in resources or not, but it's certainly easier to write! ;-)
Tim Well, for that matter:
if header :is "X-DSPAM-Result" "Spam" { fileinto "Spam"; stop; }
Is probably more efficient, I use horde INGO for filter generation and it automatically adds the us-ascii casemap comparator for handling other encodings like UTF-8, though I believe us-ascii is meant to be the default anyway.
On July 3, 2006 11:56:00 AM +1000 Peter Fern <dovecot@obfusc8.org> wrote:
Frank Cusack wrote:
I'm unable to get dovecot-lda with sieve filtering to deliver into maildir folders. The examples on the wiki explicitly say "mbox", so I'm wondering, does the dovecot-lda sieve implementation not support filtering into maildir folders?
-frank Maildirs work fine, example:
hmm, not for me. Here's the entirety of my .dovecot.sieve:
require ["fileinto", "vacation"];
# test if address :is "from" "user@list.org" { fileinto "fcusack/inbox"; }
If I start from scratch and create ~/Mail, I can send a test message which gets filed correctly (new subdir fcusack is created with new mbox file inbox).
If I start from scratch and create ~/Maildir, the same message is created in ~/Maildir/new. Even if I create ~/Maildir/.fcusack.inbox the message is not filed there.
Any ideas what might be wrong?
-frank
On July 3, 2006 11:55:38 PM -0700 Frank Cusack <fcusack@fcusack.com> wrote:
On July 3, 2006 11:56:00 AM +1000 Peter Fern <dovecot@obfusc8.org> wrote:
Frank Cusack wrote:
I'm unable to get dovecot-lda with sieve filtering to deliver into maildir folders. The examples on the wiki explicitly say "mbox", so I'm wondering, does the dovecot-lda sieve implementation not support filtering into maildir folders?
-frank Maildirs work fine, example:
hmm, not for me. Here's the entirety of my .dovecot.sieve:
require ["fileinto", "vacation"];
# test if address :is "from" "user@list.org" { fileinto "fcusack/inbox"; }
If I start from scratch and create ~/Mail, I can send a test message which gets filed correctly (new subdir fcusack is created with new mbox file inbox).
If I start from scratch and create ~/Maildir, the same message is created in ~/Maildir/new. Even if I create ~/Maildir/.fcusack.inbox the message is not filed there.
Any ideas what might be wrong?
And of course, as soon as I sent the last email I figured it out. Using '.' instead of '/' as folder separator fixed it. Why does Maildir require a different folder separator? Isn't this a bug?
-frank
Frank Cusack wrote:
On July 3, 2006 11:55:38 PM -0700 Frank Cusack <fcusack@fcusack.com> wrote:
On July 3, 2006 11:56:00 AM +1000 Peter Fern <dovecot@obfusc8.org> wrote:
Frank Cusack wrote:
I'm unable to get dovecot-lda with sieve filtering to deliver into maildir folders. The examples on the wiki explicitly say "mbox", so I'm wondering, does the dovecot-lda sieve implementation not support filtering into maildir folders?
-frank Maildirs work fine, example:
hmm, not for me. Here's the entirety of my .dovecot.sieve:
require ["fileinto", "vacation"];
# test if address :is "from" "user@list.org" { fileinto "fcusack/inbox"; }
If I start from scratch and create ~/Mail, I can send a test message which gets filed correctly (new subdir fcusack is created with new mbox file inbox).
If I start from scratch and create ~/Maildir, the same message is created in ~/Maildir/new. Even if I create ~/Maildir/.fcusack.inbox the message is not filed there.
Any ideas what might be wrong?
And of course, as soon as I sent the last email I figured it out. Using '.' instead of '/' as folder separator fixed it. Why does Maildir require a different folder separator? Isn't this a bug?
-frank
If you look at maildirs on disk, they are actually structured .folder.subfolder.subsubfolder, so it makes sense to me... procmail and sieve both require you to name your destinations as they appear on disk, so I certainly wouldn't consider it a bug. The example you give should be altered to:
# test if address :is "from" "user@list.org" { fileinto "fcusack"; }
rather than:
# test if address :is "from" "user@list.org" { fileinto "fcusack.inbox"; }
since .fcusack.inbox would actually give you the following tree structure:
INBOX fcusack inbox
Read up a little on Maildirs...
On Jul 4, 2006, at 9:57 AM, Frank Cusack wrote:
And of course, as soon as I sent the last email I figured it out.
Using '.' instead of '/' as folder separator fixed it. Why does Maildir
require a different folder separator? Isn't this a bug?
Create a namespace with a '/' separator if you want to change it. The
default is '.' because that's what the separator is on the disk.
On July 4, 2006 1:24:46 PM +0300 Timo Sirainen <tss@iki.fi> wrote:
On Jul 4, 2006, at 9:57 AM, Frank Cusack wrote:
And of course, as soon as I sent the last email I figured it out. Using '.' instead of '/' as folder separator fixed it. Why does Maildir require a different folder separator? Isn't this a bug?
Create a namespace with a '/' separator if you want to change it. The default is '.' because that's what the separator is on the disk.
Why does it work for mbox? Because for mbox the on-disk separator is '/'? That seems like a bug (UI issue). My .sieve shouldn't be sensitive to the specifics of the mailbox format.
-frank
On July 4, 2006 11:27:18 AM -0700 Frank Cusack <fcusack@fcusack.com> wrote:
On July 4, 2006 1:24:46 PM +0300 Timo Sirainen <tss@iki.fi> wrote:
On Jul 4, 2006, at 9:57 AM, Frank Cusack wrote:
And of course, as soon as I sent the last email I figured it out. Using '.' instead of '/' as folder separator fixed it. Why does Maildir require a different folder separator? Isn't this a bug?
Create a namespace with a '/' separator if you want to change it. The default is '.' because that's what the separator is on the disk.
Why does it work for mbox? Because for mbox the on-disk separator is '/'? That seems like a bug (UI issue). My .sieve shouldn't be sensitive to the specifics of the mailbox format.
One last thing, I thought '/' was the default, from this comment in the default dovecot.conf:
# Hierarchy separator to use. You should use the same separator for all # namespaces or some clients get confused. '/' is usually a good one. #separator = /
-frank
On Jul 4, 2006, at 9:33 PM, Frank Cusack wrote:
Create a namespace with a '/' separator if you want to change it.
The default is '.' because that's what the separator is on the disk.Why does it work for mbox? Because for mbox the on-disk separator
is '/'?
Yes.
That seems like a bug (UI issue). My .sieve shouldn't be
sensitive to the specifics of the mailbox format.
I mostly agree, but I'm not sure if it still would be a good idea to
change it. With Maildir++ layout the separator really is '.' and
that's how Courier also shows it. Changing it might break some
existing software.
And now that '.' has been the default with Dovecot for a long time,
there's no way to change it without breaking existing installations,
so I couldn't really change it even if I wanted to. You can change it
anyway by defining the namespace..
One last thing, I thought '/' was the default, from this comment in
the default dovecot.conf:# Hierarchy separator to use. You should use the same separator
for all # namespaces or some clients get confused. '/' is usually a good
one. #separator = /
Well, I'll change it to:
# Hierarchy separator to use. You should use the same separator
for all
# namespaces or some clients get confused. '/' is usually a good
one.
# The default however depends on the underlying mail storage format.
#separator =
On Jul 4, 2006, at 9:53 PM, Timo Sirainen wrote:
That seems like a bug (UI issue). My .sieve shouldn't be
sensitive to the specifics of the mailbox format. .. You can change it anyway by defining the namespace..
Actually now that I think of it, this is false. Deliver doesn't
unfortunately understand namespaces currently, and it's not a small
job to fix that, so I think this won't get fixed before v1.0.
Actually now that I think of it, this is false. Deliver doesn't unfortunately understand namespaces currently, and it's not a small job to fix that, so I think this won't get fixed before v1.0.
Heh. Ran into that this weekend. Had to butcher the web sieve file generator to strip out INBOX. from fileinto names. (just migrated from cyrus and needed folder names to remain consistent for users).
On July 4, 2006 9:53:48 PM +0300 Timo Sirainen <tss@iki.fi> wrote:
Well, I'll change it to:
# Hierarchy separator to use. You should use the same separator for all # namespaces or some clients get confused. '/' is usually a good one. # The default however depends on the underlying mail storage format. #separator =
sounds good. -frank
participants (5)
-
Frank Cusack
-
Jason Fesler
-
Peter Fern
-
Timo Sirainen
-
Timothy White