Re: [exim] Yet another address rewrite question

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: exim-users
Subject: Re: [exim] Yet another address rewrite question
christoph.kliemt@??? <christoph.kliemt@???> (So 22 Nov 2015 13:30:13 CET):
> Hi,
>
> i need to do a (sender-) rewrite like explained in FAQ 801
> https://github.com/Exim/exim/wiki/Q0801
>
> *@*.your.domain $1@???
>
> This relies on a "hardcoded" domain name; what i'd like to have is
> something like this:
>
> *@*.${domain_without_hostname} $1@${domain_without_hostname}
>
> So my question is: how to strip off the hostname from an address (in
> this case the sender) using exims build-in stuff.


How does a domain look like *with* hostname?


    address    host | domain
    foo@???     a | b.c
                    | a.b.c
               a.b  | c     


If you want to stripp off the first part of the "domain"

    begin rewrite
    \N^(.*)@.*?\.(.*)\N  $1@$2


    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -