[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Exim4 redirect question



Anthony Campbell wrote:
On 27 Dec 2009, Eduardo M KALINOWSKI wrote:
Anthony Campbell wrote:
I receive emails from a-user@msn.com. I would like to redirect these
(and only these) to a-differentuser@gmail.com.

Is this possible with exim4? From reading the docs I think it should be
possible to do so using redirect but I cannot find an example of a
suitable script. Can anyone provide such an example and indicate where
it should go?
This is possible with filters. See
http://www.exim.org/exim-html-current/doc/html/filter.html for the syntax.

Your ~/.forward file can be an exim filter. I don't know if this is
configured by default in Debian's exim, but it's just a simple setting
in the config file:
http://www.exim.org/exim-html-current/doc/html/spec_html/index.html#toc0207

It's also possible to use a system filter, but that would affect all users.



I'd already found those. There's a lot of information but I couldn't see
an example of the (probably very simple) kind of script I would need to
put in ~/.forward.

Anthony



Somthing like the following in the .forward file of the account which receives that e-mail

# Exim Filter
if error_message then finish endif
if $h_to: contains "a-user@msn.com" then
   deliver a-differentuser@gmail.com
   finish
endif


I actually do something like this but also deliver it to the original account. In which case change the clause to

if $h_to: contains "a-user@msn.com" then
   unseen deliver a-differentuser@gmail.com
   save "$home/Maildir/.MailtoAuser/"
   finish
endif


Also if you want to apply other rules - don't include the finish.





--
Alan Chandler
http://www.chandlerfamily.org.uk


Reply to: