Re: [exim] Discard mail to certain recipients if the subject…

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Александр Кириллов
Fecha:  
A: Evgeniy Berdnikov
Cc: exim-users
Asunto: Re: [exim] Discard mail to certain recipients if the subject matches a string
YEAP! That was it! Thanks Eugene!

# exim -bem /path/to/sample.mail '$rh_subject'
Return-path taken from "Return-path:" header line
=?UTF-8?Q?[Test_-?=
=?UTF-8?Q?_=D0=9F=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D0=B0_#240]?=
=?UTF-8?Q?_=D0=97=D0=B0=D0=B4=D0=B0=D1=87=D0=B0_=D0=B4=D0=BB=D1=8F?=
=?UTF-8?Q?_=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8_-_Commit_by_Alexander?=
=?UTF-8?Q?_Kirillov_[r45]?=

# exim -bem /path/to/sample.mail '$h_subject'
Return-path taken from "Return-path:" header line
[Test - Поддержка #240] Задача для
=?UTF-8?Q?_=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8_-_Commit_by_Alexander?=
Kirillov [r45]

# exim -bem /path/to/sample.mail '$bh_subject'
Return-path taken from "Return-path:" header line
[Test - Поддержка #240] Задача для
=?UTF-8?Q?_=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8_-_Commit_by_Alexander?=
Kirillov [r45]

Does it look like an exim bug?


2017-04-06 22:20 GMT+03:00 Evgeniy Berdnikov <bd4@???>:

> On Thu, Apr 06, 2017 at 09:32:04PM +0300, Александр Кириллов via
> Exim-users wrote:
> > I've tried nearly anything I could think of:
> >
> > Commit by
> > Commit\ by
> > Commit\sby
> > Commit\\ by
> > Commit\\sby
> > Commit[ ]by
> > "Commit by"
> > \NCommit by\N
> >
> > Nothing worked and I'm writing regular expressions in various languages
> for
> > 20+ years. I've failed miserably on this one. )
>
> The simplest way to play with Exim's regular expressions is to run it
> with "-be" option:
>
> # exim4 -be '${if match{Commit by}{Commit by}{OK}fail}'
> OK
> # exim4 -be '${if match{Commit by}{Commit[ ]by}{OK}fail}'
> OK
>
> > I understand your point about anchors but all outgoing mail comes to this
> > relay from an incident tracker system so the subjects are quite rigid
> and I
> > feel pretty sure this simple match will work well.
> >
> > Given the fact that I can't write a regexp matching a single space I
> don't
> > really want to explore anything more complex till I get the answer to
> this
> > one.
>
> Your can extract header line from a sample mail (stored in file) as
>
> # exim -bem /path/to/sample.mail '$h_subject'
>
> optionally with "-d+expand" option. If subject is RFC2047-encoded,
> try to start with $rh_subject and $bh_subject.
> --
> Eugene Berdnikov
>
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>