[Dovecot] Sieve script problem (don't know if is it possible to do this)

Yanko Hernández Álvarez yhdezalvarez at gmail.com
Thu Nov 14 22:25:47 EET 2013


> Am 14.11.2013 19:17, schrieb Yanko Hernández Álvarez:
>> Hello:
>>
>> I'm loosing my mind trying to classify my outgoing messages with
>> sieve-test (2.0.9, centos 6.4). It came to the point I think it's
>> not even possible with a sieve script.
>>
>> I need to classify my outgoing messages in three folders:
>
> stop here , filter outgoing mail is not possible yet with sieve, at my
> current info level, but it may come in future ( but thats  a different
> story )
>
> but your mail client may do copy in different imap folders at send
> time, or your mailserver may do some kind of sort/copy with i.e bcc
> feature etc

Well my email only filters/classifies at receive time (IMAP check),
not sending (SMTP), so I'm scr... on that front.

> equal stuff was asked before on the list i think , search archive
>
> however if i dont unterstand you in the right way, and you want to
> sort incomming mail feel free to ask again

Incomming mail is a piece of cake, there is only one sender (in
opposition to several recipients) so simple rules and "if" nesting is
enough (pseudocode):
----
if from dept.example.com
  copy to dept;
else if from *.example.com or example.com
  copy to company
else
  copy to restoftheworld;
----
and it works, because there is only one address (the sender)... The
problem appears when there are many addresses (many recipients) and
the requirement to leave a copy in every folder that applies...

I used to have a a very long and inefficient bash script -bash, you
know- in "cron.hourly" that classified sent emails and moved them to
the right folder.

Now I want to do the same using sieve-test instead -faster, native
code, more declarative code,...- , and get rid of the ugly bash
script, but so far, without success. :-(

But if you want, you can see it as incoming mail filtering problem.
Just ignore the "From" address and use only the recipients addresses
("To") to do the classification and the problem stays just the same

kind regards
   Yanko


More information about the dovecot mailing list