[Exim] Forward files

Top Page
Delete this message
Reply to this message
Author: Steven Lobbezoo
Date:  
To: exim-users
Subject: [Exim] Forward files
--
[ Picked text/plain from multipart/alternative ]
Hi,

I've been expirementing a bit with using a .forward file.
I have the following:
----------------------------------------------------------------------------------------------------------------------------

# Exim filter


# just as a precaution:
if error_message then finish endif

# save message to right mailbox (from vmails file)

save ${if def:h_envelop-to: {\
    "$home/mail${lookup {${local_part:$h_envelop-to:}@${domain:$h_envelop-to:}} lsearch*@ {$home/vmails} {/$value}\
{${lookup {${domain:$h_envelop-to:}} lsearch {$home/vmails} {/$value} {}}}}\
/inbox"}{\
    "$home/mail${lookup {${local_part:$h_to:}@${domain:$h_to:}} lsearch*@ {$home/vmails} {/$value}\
{${lookup {${domain:$h_to:}} lsearch {$home/vmails} {/$value} {}}}}\
/inbox"}



# if nothing done, then save to me!
if not delivered then save $home/mail/inbox endif

--------------------------------------------------------------------------------------------------------------------------

This filter is reading virtual e-mails for parked domains to forward
them to a real e-mail adress in the real domain, under control of the
vmails file (simple pairs of vrt address and real address).
before, i only used the part with the h_to: with out any test if the
envelop-to: headerline exists.
That worked just fine.
Now, because we do often heave e-mails with a correct envelop-to: field,
and a fake to: field, i added the above test:
${if def:h_envelop-to: etc etc.
The test gives me an error message, that it does not recognisez the def:
construct.
I studied the docs, but could not find what i'ml doing wring.

Now, since there's a big lack of serious samples of filters (at least i
did not find them ;-)),
i took the liberty posting myb problem here. Hope someone can show me
where i went wrong.

Secondly: would it not be much nicer if one could assign variables like
myvar = .....
that would make programs a lot more readable.

Whatever, hope someone helps.

Steven



--