Re: [exim] Rewrite a forwarded address from gmail

Pàgina inicial
Delete this message
Reply to this message
Autor: Graeme Fowler
Data:  
A: exim-users
Assumpte: Re: [exim] Rewrite a forwarded address from gmail
On Tue, 2010-02-09 at 13:03 -0700, Vadnais, Kevin wrote:
> Where joe.blow is the sender username I want to validate, and "some" is the
> destination address. The RCPT field of this message is correct, so I'm not
> too worried about it. I need the F field to read F=<joe.blow@???>


I do this a different way, by having a router which un-munges the
address (we outsourced our student email to Google recently so this is
very valid for forwarded mail):

staff_and_student_system_aliases_google_forwarder:
  driver = redirect
  domains = OURDOMAINS
  data = ${lookup mysql{\
                        select target from map where lhs =\
                       '${quote_mysql:${sg\
                                          {$local_part}\
                                          {\N\+caf_=.+\N}\
                                          {}\
                                       }\
                         }'\
                       }\
           {$value}fail}
  file_transport = address_file
  pipe_transport = address_pipe
  allow_defer


The regex replace in the middle there strips the "+caf..." part from the
address, and the OURDOMAINS macro limits this to, well, our domains.

No rewriting necessary.

Graeme