sieve-filter ignoring separator

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

sieve-filter ignoring separator

isakrubin
It seems like running sieve-filter from the console ignores the separator
setting, thus not letting me filter into folder names containing dots.

Normal delivery using lda handles it just fine, but not when using the
sieve-filter command.

Character not allowed in mailbox name: '.'

Is there anyway to override this or is patching and recompiling the source
my only option?

# dovecot --version
2.1.9

/Isak
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

Stephan Bosch-2
On 3/4/2013 9:21 PM, Isak Rubin wrote:

> It seems like running sieve-filter from the console ignores the separator
> setting, thus not letting me filter into folder names containing dots.
>
> Normal delivery using lda handles it just fine, but not when using the
> sieve-filter command.
>
> Character not allowed in mailbox name: '.'
>
> Is there anyway to override this or is patching and recompiling the source
> my only option?
>
> # dovecot --version
> 2.1.9

This Dovecot is very old, so is probably your Pigeonhole version. Recent
versions should work fine in this regard.

Regards,

Stephan.
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

isakrubin
Stephan Bosch-2 wrote
On 3/4/2013 9:21 PM, Isak Rubin wrote:
>
> # dovecot --version
> 2.1.9

This Dovecot is very old, so is probably your Pigeonhole version. Recent
versions should work fine in this regard.

Regards,

Stephan.
Upgraded to
# dovecot --version
2.2.rc3


still same issue :/


Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

Stephan Bosch-2
Op 3/22/2013 3:17 PM, isakrubin schreef:

> Stephan Bosch-2 wrote
>> On 3/4/2013 9:21 PM, Isak Rubin wrote:
>>> # dovecot --version
>>> 2.1.9
>> This Dovecot is very old, so is probably your Pigeonhole version. Recent
>> versions should work fine in this regard.
>>
>> Regards,
>>
>> Stephan.
> Upgraded to
> # dovecot --version
> 2.2.rc3
>
>
> still same issue :/

Ok, will look at this some time next week.

Regards,

Stephan.
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

Stephan Bosch-2
In reply to this post by isakrubin
On 3/22/2013 3:17 PM, isakrubin wrote:

> Stephan Bosch-2 wrote
>> On 3/4/2013 9:21 PM, Isak Rubin wrote:
>>> # dovecot --version
>>> 2.1.9
>> This Dovecot is very old, so is probably your Pigeonhole version. Recent
>> versions should work fine in this regard.
>>
>> Regards,
>>
>> Stephan.
> Upgraded to
> # dovecot --version
> 2.2.rc3
>
>
> still same issue :/

Could you show me your `dovecot -n` output?

Regards,

Stephan.
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

isakrubin
Here you go,

http://pastebin.com/LA0kJteM

Regards,
Isak



2013/4/3 Stephan Bosch <[hidden email]>

> On 3/22/2013 3:17 PM, isakrubin wrote:
>
>> Stephan Bosch-2 wrote
>>
>>> On 3/4/2013 9:21 PM, Isak Rubin wrote:
>>>
>>>> # dovecot --version
>>>> 2.1.9
>>>>
>>> This Dovecot is very old, so is probably your Pigeonhole version. Recent
>>> versions should work fine in this regard.
>>>
>>> Regards,
>>>
>>> Stephan.
>>>
>> Upgraded to
>> # dovecot --version
>> 2.2.rc3
>>
>>
>> still same issue :/
>>
>
> Could you show me your `dovecot -n` output?
>
> Regards,
>
> Stephan.
>
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

Stephan Bosch-2
In reply to this post by Stephan Bosch-2
Op 4/3/2013 1:56 PM, Isak Rubin schreef:
> Here you go

You're using the listescape plugin. Try putting that in the global
mail_plugins setting, e.g.:

# usually located in /etc/dovecot/conf.d/10-mail.conf
mail_plugins = listescape

protocol lda {
   mail_plugins = $mail_plugins sieve autocreate
}
protocol imap {
   mail_plugins = $mail_plugins  autocreate
}


Regards,

Stephan.
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

isakrubin
Thanks :)
Solved the filtering problem

but got a new problem.

Filtering now works as expected, but only to existing folders.

I tried moving the autocreate plugin to a global level but still does not
seem to work.


http://pastebin.com/ykvWQg3w



Regards
Isak




2013/4/3 Stephan Bosch <[hidden email]>

> Op 4/3/2013 1:56 PM, Isak Rubin schreef:
>
>> Here you go
>>
>
> You're using the listescape plugin. Try putting that in the global
> mail_plugins setting, e.g.:
>
> # usually located in /etc/dovecot/conf.d/10-mail.**conf
> mail_plugins = listescape
>
> protocol lda {
>   mail_plugins = $mail_plugins sieve autocreate
> }
> protocol imap {
>   mail_plugins = $mail_plugins  autocreate
> }
>
>
> Regards,
>
> Stephan.
>
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

Robert Schetterer-2
Am 03.04.2013 14:40, schrieb Isak Rubin:

> Thanks :)
> Solved the filtering problem
>
> but got a new problem.
>
> Filtering now works as expected, but only to existing folders.
>
> I tried moving the autocreate plugin to a global level but still does not
> seem to work.
>
>
> http://pastebin.com/ykvWQg3w
>
>
>
> Regards
> Isak
>

die you use

fileinto :create in the sieve rule ?

what is lda_mailbox_autocreate set ?

else read i.e

http://wiki2.dovecot.org/LDA

-m <mailbox>: Destination mailbox (default is INBOX). If the mailbox
doesn't exist, it will not be created (unless the lda_mailbox_autocreate
setting is set to yes). If message couldn't be saved to the mailbox for
any reason, it's delivered to INBOX instead.

    If Sieve plugin is used, this mailbox is used as the "keep" action's
mailbox. It's also used if there is no Sieve script or if the script
fails for some reason.

    Deliveries to namespace prefix will result in saving the mail to
INBOX instead. For example if you have "Mail/" namespace, this allows
you to specify dovecot-lda -m Mail/$mailbox where mail is stored to
Mail/$mailbox or to INBOX if $mailbox is empty.

    The mailbox name is specified the same as it's visible in IMAP
client. For example if you've a Maildir with .box.sub/ directory and
your namespace configuration is prefix=INBOX/, separator=/, the correct
way to deliver mail there is to use -m INBOX/box/sub


>
>
>
> 2013/4/3 Stephan Bosch <[hidden email]>
>
>> Op 4/3/2013 1:56 PM, Isak Rubin schreef:
>>
>>> Here you go
>>>
>>
>> You're using the listescape plugin. Try putting that in the global
>> mail_plugins setting, e.g.:
>>
>> # usually located in /etc/dovecot/conf.d/10-mail.**conf
>> mail_plugins = listescape
>>
>> protocol lda {
>>   mail_plugins = $mail_plugins sieve autocreate
>> }
>> protocol imap {
>>   mail_plugins = $mail_plugins  autocreate
>> }
>>
>>
>> Regards,
>>
>> Stephan.
>>
>



Best Regards
MfG Robert Schetterer

--
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

isakrubin
# egrep -rn lda_mailbox_autocreate  /etc/dovecot/conf.d/
/etc/dovecot/conf.d/15-lda.conf:41:lda_mailbox_autocreate = yes

if header :regex "From" "([a-zA-Z0-9._%+-]+)(@)([a-zA-Z0-9._%+-]+)" {
        set :lower "person" "${1}";
        set :lower "domain" "${3}";
        fileinto "INBOX/bydomain/${domain}/${person}";
        stop;
}

Robert: Autocreate works fine using lda, the issue here is when running
sieve filters manually using sieve-filter
When receiving mails they are sorted and created and everything works fine,
but I need to be able to manually execute sieve scripts on some folders,
and that's when it seems unable to autocreate.

But i guess lda_mailbox_autocreate is not used at all when running
sieve-filter manually, as i assume it just bypass the lda all together


Regards
Isak



2013/4/3 Robert Schetterer <[hidden email]>

> Am 03.04.2013 14:40, schrieb Isak Rubin:
> > Thanks :)
> > Solved the filtering problem
> >
> > but got a new problem.
> >
> > Filtering now works as expected, but only to existing folders.
> >
> > I tried moving the autocreate plugin to a global level but still does not
> > seem to work.
> >
> >
> > http://pastebin.com/ykvWQg3w
> >
> >
> >
> > Regards
> > Isak
> >
>
> die you use
>
> fileinto :create in the sieve rule ?
>
> what is lda_mailbox_autocreate set ?
>
> else read i.e
>
> http://wiki2.dovecot.org/LDA
>
> -m <mailbox>: Destination mailbox (default is INBOX). If the mailbox
> doesn't exist, it will not be created (unless the lda_mailbox_autocreate
> setting is set to yes). If message couldn't be saved to the mailbox for
> any reason, it's delivered to INBOX instead.
>
>     If Sieve plugin is used, this mailbox is used as the "keep" action's
> mailbox. It's also used if there is no Sieve script or if the script
> fails for some reason.
>
>     Deliveries to namespace prefix will result in saving the mail to
> INBOX instead. For example if you have "Mail/" namespace, this allows
> you to specify dovecot-lda -m Mail/$mailbox where mail is stored to
> Mail/$mailbox or to INBOX if $mailbox is empty.
>
>     The mailbox name is specified the same as it's visible in IMAP
> client. For example if you've a Maildir with .box.sub/ directory and
> your namespace configuration is prefix=INBOX/, separator=/, the correct
> way to deliver mail there is to use -m INBOX/box/sub
>
>
> >
> >
> >
> > 2013/4/3 Stephan Bosch <[hidden email]>
> >
> >> Op 4/3/2013 1:56 PM, Isak Rubin schreef:
> >>
> >>> Here you go
> >>>
> >>
> >> You're using the listescape plugin. Try putting that in the global
> >> mail_plugins setting, e.g.:
> >>
> >> # usually located in /etc/dovecot/conf.d/10-mail.**conf
> >> mail_plugins = listescape
> >>
> >> protocol lda {
> >>   mail_plugins = $mail_plugins sieve autocreate
> >> }
> >> protocol imap {
> >>   mail_plugins = $mail_plugins  autocreate
> >> }
> >>
> >>
> >> Regards,
> >>
> >> Stephan.
> >>
> >
>
>
>
> Best Regards
> MfG Robert Schetterer
>
> --
> [*] sys4 AG
>
> http://sys4.de, +49 (89) 30 90 46 64
> Franziskanerstraße 15, 81669 München
>
> Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
> Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
> Aufsichtsratsvorsitzender: Joerg Heidrich
>
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

Robert Schetterer-2
Am 03.04.2013 14:59, schrieb Isak Rubin:

> # egrep -rn lda_mailbox_autocreate  /etc/dovecot/conf.d/
> /etc/dovecot/conf.d/15-lda.conf:41:lda_mailbox_autocreate = yes
>
> if header :regex "From" "([a-zA-Z0-9._%+-]+)(@)([a-zA-Z0-9._%+-]+)" {
>         set :lower "person" "${1}";
>         set :lower "domain" "${3}";
>         fileinto "INBOX/bydomain/${domain}/${person}";
>         stop;
> }
>
> Robert: Autocreate works fine using lda, the issue here is when running
> sieve filters manually using sieve-filter
> When receiving mails they are sorted and created and everything works fine,
> but I need to be able to manually execute sieve scripts on some folders,
> and that's when it seems unable to autocreate.
>
> But i guess lda_mailbox_autocreate is not used at all when running
> sieve-filter manually, as i assume it just bypass the lda all together
>


try fileinto :create  .....

http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples

i.e like

require ["variables","date","fileinto","mailbox"];

# Extract date info
if currentdate :matches "year" "*" { set "year" "${1}"; }
if currentdate :matches "month" "*" { set "month" "${1}"; }

# Archive Dovecot mailing list items by year and month.
# Create folder when it does not exist.
if header :is "list-id" "dovecot.dovecot.org" {
  fileinto :create "INBOX.Lists.${year}.${month}.dovecot";
}

>
> Regards
> Isak
>
>
>
> 2013/4/3 Robert Schetterer <[hidden email]>
>
>> Am 03.04.2013 14:40, schrieb Isak Rubin:
>>> Thanks :)
>>> Solved the filtering problem
>>>
>>> but got a new problem.
>>>
>>> Filtering now works as expected, but only to existing folders.
>>>
>>> I tried moving the autocreate plugin to a global level but still does not
>>> seem to work.
>>>
>>>
>>> http://pastebin.com/ykvWQg3w
>>>
>>>
>>>
>>> Regards
>>> Isak
>>>
>>
>> die you use
>>
>> fileinto :create in the sieve rule ?
>>
>> what is lda_mailbox_autocreate set ?
>>
>> else read i.e
>>
>> http://wiki2.dovecot.org/LDA
>>
>> -m <mailbox>: Destination mailbox (default is INBOX). If the mailbox
>> doesn't exist, it will not be created (unless the lda_mailbox_autocreate
>> setting is set to yes). If message couldn't be saved to the mailbox for
>> any reason, it's delivered to INBOX instead.
>>
>>     If Sieve plugin is used, this mailbox is used as the "keep" action's
>> mailbox. It's also used if there is no Sieve script or if the script
>> fails for some reason.
>>
>>     Deliveries to namespace prefix will result in saving the mail to
>> INBOX instead. For example if you have "Mail/" namespace, this allows
>> you to specify dovecot-lda -m Mail/$mailbox where mail is stored to
>> Mail/$mailbox or to INBOX if $mailbox is empty.
>>
>>     The mailbox name is specified the same as it's visible in IMAP
>> client. For example if you've a Maildir with .box.sub/ directory and
>> your namespace configuration is prefix=INBOX/, separator=/, the correct
>> way to deliver mail there is to use -m INBOX/box/sub
>>
>>
>>>
>>>
>>>
>>> 2013/4/3 Stephan Bosch <[hidden email]>
>>>
>>>> Op 4/3/2013 1:56 PM, Isak Rubin schreef:
>>>>
>>>>> Here you go
>>>>>
>>>>
>>>> You're using the listescape plugin. Try putting that in the global
>>>> mail_plugins setting, e.g.:
>>>>
>>>> # usually located in /etc/dovecot/conf.d/10-mail.**conf
>>>> mail_plugins = listescape
>>>>
>>>> protocol lda {
>>>>   mail_plugins = $mail_plugins sieve autocreate
>>>> }
>>>> protocol imap {
>>>>   mail_plugins = $mail_plugins  autocreate
>>>> }
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Stephan.
>>>>
>>>
>>
>>
>>
>> Best Regards
>> MfG Robert Schetterer
>>
>> --
>> [*] sys4 AG
>>
>> http://sys4.de, +49 (89) 30 90 46 64
>> Franziskanerstraße 15, 81669 München
>>
>> Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
>> Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
>> Aufsichtsratsvorsitzender: Joerg Heidrich
>>
>



Best Regards
MfG Robert Schetterer

--
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich
Reply | Threaded
Open this post in threaded view
|

Re: sieve-filter ignoring separator

isakrubin
Thanks!

I had :create on 90% of the filters but it was missing on a few, added it
on the rest and now everything is working perfectly.

Thanks a lot for the help

Regards
Isak



2013/4/3 Robert Schetterer <[hidden email]>

> Am 03.04.2013 14:59, schrieb Isak Rubin:
> > # egrep -rn lda_mailbox_autocreate  /etc/dovecot/conf.d/
> > /etc/dovecot/conf.d/15-lda.conf:41:lda_mailbox_autocreate = yes
> >
> > if header :regex "From" "([a-zA-Z0-9._%+-]+)(@)([a-zA-Z0-9._%+-]+)" {
> >         set :lower "person" "${1}";
> >         set :lower "domain" "${3}";
> >         fileinto "INBOX/bydomain/${domain}/${person}";
> >         stop;
> > }
> >
> > Robert: Autocreate works fine using lda, the issue here is when running
> > sieve filters manually using sieve-filter
> > When receiving mails they are sorted and created and everything works
> fine,
> > but I need to be able to manually execute sieve scripts on some folders,
> > and that's when it seems unable to autocreate.
> >
> > But i guess lda_mailbox_autocreate is not used at all when running
> > sieve-filter manually, as i assume it just bypass the lda all together
> >
>
>
> try fileinto :create  .....
>
> http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples
>
> i.e like
>
> require ["variables","date","fileinto","mailbox"];
>
> # Extract date info
> if currentdate :matches "year" "*" { set "year" "${1}"; }
> if currentdate :matches "month" "*" { set "month" "${1}"; }
>
> # Archive Dovecot mailing list items by year and month.
> # Create folder when it does not exist.
> if header :is "list-id" "dovecot.dovecot.org" {
>   fileinto :create "INBOX.Lists.${year}.${month}.dovecot";
> }
>
> >
> > Regards
> > Isak
> >
> >
> >
> > 2013/4/3 Robert Schetterer <[hidden email]>
> >
> >> Am 03.04.2013 14:40, schrieb Isak Rubin:
> >>> Thanks :)
> >>> Solved the filtering problem
> >>>
> >>> but got a new problem.
> >>>
> >>> Filtering now works as expected, but only to existing folders.
> >>>
> >>> I tried moving the autocreate plugin to a global level but still does
> not
> >>> seem to work.
> >>>
> >>>
> >>> http://pastebin.com/ykvWQg3w
> >>>
> >>>
> >>>
> >>> Regards
> >>> Isak
> >>>
> >>
> >> die you use
> >>
> >> fileinto :create in the sieve rule ?
> >>
> >> what is lda_mailbox_autocreate set ?
> >>
> >> else read i.e
> >>
> >> http://wiki2.dovecot.org/LDA
> >>
> >> -m <mailbox>: Destination mailbox (default is INBOX). If the mailbox
> >> doesn't exist, it will not be created (unless the lda_mailbox_autocreate
> >> setting is set to yes). If message couldn't be saved to the mailbox for
> >> any reason, it's delivered to INBOX instead.
> >>
> >>     If Sieve plugin is used, this mailbox is used as the "keep" action's
> >> mailbox. It's also used if there is no Sieve script or if the script
> >> fails for some reason.
> >>
> >>     Deliveries to namespace prefix will result in saving the mail to
> >> INBOX instead. For example if you have "Mail/" namespace, this allows
> >> you to specify dovecot-lda -m Mail/$mailbox where mail is stored to
> >> Mail/$mailbox or to INBOX if $mailbox is empty.
> >>
> >>     The mailbox name is specified the same as it's visible in IMAP
> >> client. For example if you've a Maildir with .box.sub/ directory and
> >> your namespace configuration is prefix=INBOX/, separator=/, the correct
> >> way to deliver mail there is to use -m INBOX/box/sub
> >>
> >>
> >>>
> >>>
> >>>
> >>> 2013/4/3 Stephan Bosch <[hidden email]>
> >>>
> >>>> Op 4/3/2013 1:56 PM, Isak Rubin schreef:
> >>>>
> >>>>> Here you go
> >>>>>
> >>>>
> >>>> You're using the listescape plugin. Try putting that in the global
> >>>> mail_plugins setting, e.g.:
> >>>>
> >>>> # usually located in /etc/dovecot/conf.d/10-mail.**conf
> >>>> mail_plugins = listescape
> >>>>
> >>>> protocol lda {
> >>>>   mail_plugins = $mail_plugins sieve autocreate
> >>>> }
> >>>> protocol imap {
> >>>>   mail_plugins = $mail_plugins  autocreate
> >>>> }
> >>>>
> >>>>
> >>>> Regards,
> >>>>
> >>>> Stephan.
> >>>>
> >>>
> >>
> >>
> >>
> >> Best Regards
> >> MfG Robert Schetterer
> >>
> >> --
> >> [*] sys4 AG
> >>
> >> http://sys4.de, +49 (89) 30 90 46 64
> >> Franziskanerstraße 15, 81669 München
> >>
> >> Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
> >> Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
> >> Aufsichtsratsvorsitzender: Joerg Heidrich
> >>
> >
>
>
>
> Best Regards
> MfG Robert Schetterer
>
> --
> [*] sys4 AG
>
> http://sys4.de, +49 (89) 30 90 46 64
> Franziskanerstraße 15, 81669 München
>
> Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
> Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
> Aufsichtsratsvorsitzender: Joerg Heidrich
>