RE: [exim] Redirecting incoming mail

Góra strony
Delete this message
Reply to this message
Autor: Andrew Johnson
Data:  
Dla: exim-users
Temat: RE: [exim] Redirecting incoming mail
> -----Original Message-----
> From: Sartorelli, Kevin
> [mailto:Kevin.Sartorelli@openpolytechnic.ac.nz]
> Sent: Monday, May 23, 2005 4:36 AM
> To: exim-users@???
> Subject: [exim] Redirecting incoming mail
>
> How would one go about redirecting incoming mail from a certain user
> and deliver it to a different address to that originally specified?
> Pointers to documentation gratefully received as I can't spot it :-(


My system uses MySQL for a backend for everything, and I set up a table of
redirect users (Though an lsearch lookup on a flat file would also do the
same) such that if the user exists in the database/file the envelope
recipient gets re-written as the new user.

Then I setup a redirect router.

redir_redir:
  verify = false
  driver = redirect
  condition = ${if eq {$sender_address}\
                      {${lookup mysql {SELECT redir_from_email FROM redir
WHERE redir_from_email = '$sender_address' \
                        and domain_name = '$domain'}}}\
               {yes}{no}}
  data = ${lookup mysql {SELECT user_forward_to FROM redir WHERE
redir_from_email = '$sender_address' \
           and domain_name = '$domain'}}
  allow_fail



-Andy-

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.15 - Release Date: 22/05/2005