[ingo] Generating Full From Header Sieve Script
Jan Schneider
jan at horde.org
Fri Dec 12 12:03:42 UTC 2014
Zitat von Robert Susmilch <robert at rootunlimited.com>:
> Hello,
>
> I've been pulling my hair out trying to figure this out. I want to
> generate a dovecot sieve filter based on the plain text From name.
>
> For example, if I create a rule to match "From contains Doe" in ingo
> filter web page in horde I expect it to filter out any From header
> that contains a last name "Doe" in it.
>
> This does not work, it only matches the email address, not the plain
> text name. So a From header like "From: John Doe
> <john1966 at yahoo.com>" will filter on the search "John" but not "Doe"
> since "Doe" appears only in the plain text name and not the actual
> email address.
>
> Ingo generates something like this
>
> if address :all :comparator "i;ascii-casemap" :contains "From" "Doe" {
> fileinto "JohnDoe";
> }
>
> If I create a filter from ISPConfig I get
>
> if header :regex ["from"] [".*Doe"] {
> fileinto "JohnDoe";
> stop;
> }
Then why do you use a regexp test in Ingo?
> If I replace the "address :all" with "header" like this it works as
> expected from any address
>
> if header :comparator "i;ascii-casemap" :contains "From" "Doe" {
> fileinto "JohnDoe";
> stop;
> }
>
> This question was asked over two years ago with no response, see
> http://marc.info/?l=ingo&m=134753061816855&w=2
>
> Any ideas on how to either get this to work in this manner? It would
> make creating simple rules such as anything from say a family last
> name get filtered into one folder simply by searching the last name,
> versus applying many different email addresses to the filter.
>
> Thanks,
> Robert
>
> Here's the other email from two years ago below
> ---------------------------------------------------------------
> Hi list,
>
> I have a small problem with the Ingo generated sieve script.
> I am trying to filter by the plaintext name in the From header field (not
> a mail address!).
>
> Ingo generates the following if-condition:
>
> if address :all :comparator "i;ascii-casemap" :contains "From" "Some
> Name" {
>
> which does not match if I have incoming mail with a header line like this:
>
> From: Some Name <email at address>
>
> What works is the following sieve line:
>
> if header :comparator "i;ascii-casemap" :contains "From" "Some Name" {
>
> However I can't get Ingo to generate something like this. Even if I use
> the custom header field with "From" it is just transformed back into a
> normal "From" rule.
>
> Bye
> Sebastian
> --
> ingo mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: ingo-unsubscribe at lists.horde.org
--
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject
More information about the ingo
mailing list