[exim] Custom header rewrite on outgoing e-mail

Top Page
Delete this message
Reply to this message
Author: Chameeya Software Services Ltd
Date:  
To: exim-users
Subject: [exim] Custom header rewrite on outgoing e-mail

Hello;

I have setup exim on my Ubuntu server as I wanted some local delivery for my e-mails. I have it setup as smarthost and I use fetchmail and procmail to pull the mail from my e-mail host. My domain is "fake" and is strictly local. I have a hoster with my e-mail. A pretty common setup I'm sure.



I currently have two domains. Each user only has a single external address, they are either in one domain or the other. I also need to rewrite from the internal user name to the friendly external name.

My user directory is stored in LDAP so I can lookup in LDAP what a user's external e-mail address should be and rewrite the external address to that.



I tried to modify the following line in the master config file:

REMOTE_SMTP_HEADERS_REWRITE=*@+local_domains $1@DCreadhost frs : *@ETC_MAILNAME $1@DCreadhost frs


to


REMOTE_SMTP_HEADERS_REWRITE=*@+local_domains "${lookup ldap {ldap://localhost/ou=People,dc=cham,dc=local?mail?(&(uid=$local_part))}{$value}fail}" Ffrs



This gives me a series of errors:



Expansion of ${lookup ldap {ldap failed while rewriting: missing } at end of string
failed to open //localhost/ou=People,dc=mylocaldomain?mail?(&(uid=[EXTERNAL ADDR]))}{}fail}" when checking "//localhost/ou=People,dc=cham,dc=local?mail?(&(uid=salik))}{$value}fail}"": No such file or directory



I've checked this put putting the rewrite rule into the rewrite portion and running exim -brw and the rewrite works. But its not working in the transport.



So how can I get this to work. remember Exim is not receiving the e-mail. its just sending it and doing local delivery.



Thanks,

Salik.



Salik Rafiq

Director, Chameeya Software Services Ltd.
mailto: salik.rafiq@???
web: www.chameeya.com
mob: 07792071655



                      
_________________________________________________________________
Got a cool Hotmail story? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/