Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Rewrite a forwarded address from gmail

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


kevin.vadnais at uleth

Feb 9, 2010, 12:03 PM

Post #1 of 2 (445 views)
Permalink
Rewrite a forwarded address from gmail

We have some users which utilize some forwarding features from gmail, which
is causing some odd F=<> fields being sent to our exim servers. These
munged up from addresses fail our sender lookup validation, and the email
gets bounced. All of this is explained and understood.

The munged up addresses have valid characters in them.

i.e.

F=<joe.blow+caf_=some=mydomain.ca [at] mydomain<F=joe.blow+caf_=some=address.ca [at] uleth><joe.blow+caf_=some=mydomain.ca [at] mydomain>
>

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 [at] mydomain>

What would be some ideas for a good rewrite rule that would capture this
kind of scenario. I still want to validate the sender but my understanding
is that the rewrite rules occur before any of the acl's or other relays get
worked on. So, I shouldn't have to do any additional validation after this
rewrite rule executes as my other operations should continue as normal.

My ideal rule would look something like this

*+*@mydomain.ca $1 [at] mydomain Ff

I'm unclear if this will only look at the sender's field though. I don't
want to apply this rule to a RCPT or To field.

Am I totally out to lunch or should this work?

Thanks,


--

Kevin Vadnais
Systems Programmer
University of Lethbridge
--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


graeme at graemef

Feb 10, 2010, 12:16 AM

Post #2 of 2 (426 views)
Permalink
Re: Rewrite a forwarded address from gmail [In reply to]

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 [at] mydomain>

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


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.