[Exim] Rewrite rules not applied to unqualified addresses in…

Góra strony
Delete this message
Reply to this message
Autor: Tore Anderson
Data:  
Dla: exim-users
Temat: [Exim] Rewrite rules not applied to unqualified addresses in headers?
Hi. I am trying to solve a problem where a stupid client send
unqualified addresses in the headers, such as:

    From: tore


I need to add a domain to these unqualified addresses, but leave the
already valid ones alone. So I thought this would be a perfect task
for the address rewriting facilities of Exim. My rewrite section
contains only the following rule:

     \N^([^@]+)$\N    $1@???    f


However, for some reason I can't quite understand, it doesn't work as
I want it to. A -d+rewrite SMTP daemon gives me this output:

    15694 >>Headers received:
    15694 From: foobar
    15694
    15694 rewrite_one_header: type=F:
    15694   From: foobar
    15694 search_tidyup called
    15694 >>Headers after rewriting and local additions:
    15694 F From: foobar


..I certainly can't see that it's attempting to apply my rewrite rule
at all. However, when I tried giving a fully qualified address, this
happened:

    15996 rewrite_one_header: type=F:
    15996   From: foobar@???
    15996 address match: subject=foobar@??? pattern=^([^@]+)$
    15996 foobar@??? in "^([^@]+)$"? no (end of list)
    15996 search_tidyup called
    15996 >>Headers after rewriting and local additions:
    15996 F From: foobar@???


That's more like it! It fails to rewrite the address, as expected,
but at least it's trying. So I thought the problem must be that the
unqualified address I first tried isn't considered an e-mail address
at all, and that using the "w" flag to the rewrite rule should remedy
this, by letting my rewrite rule work on the entire header instead of
just the address part. But no - the result is the exact same.

So I'm wondering: Is there any way to accomplish this with rewrite
rules at all, or must I resort to a system filter or some such? And if
it isn't, is that a bug?

--
Tore Anderson