Re: [Exim] Replacing envelope sender

Top Page
Delete this message
Reply to this message
Author: David Saez
Date:  
To: exim-users, Philip Hazel
Subject: Re: [Exim] Replacing envelope sender
Hi !!

> > I'm trying to replace the envelope sender by one extracted from the
> > header From: line when the envelope sender is 'apache@???' so I
> > configured the remote smtp transport like this:
> >
> > remote_smtp:
> >   driver = smtp
> >   return_path = ${if and { {eq{$return_path}{apache@???}} \
> >                            {def:h_from:} } {${address:$h_from:}}{fail} }

>
> Or consider doing the rewriting when the message arrives, using a global
> rewriting rule. Rewriting in a transport is usually used when you want
> it to apply only to certain copies of a message (those that use this
> transport). If you want it to apply everywhere, a global rewriting rule
> is what you need.


If I do:

apache@??? ${if{def:h_from:}{${address:$h_from:}}{fail}} Fq

I get:

[axil /]# /usr/local/exim/bin/exim -brw apache@???
  sender: apache@???
    from: apache@???
      to: apache@???
      cc: apache@???
     bcc: apache@???
reply-to: apache@???
2003-03-31 21:23:10 Expansion of
${if{def:h_from:}{${address:$h_from:}}{fail}} failed while rewriting:
condition name expected, but found "{def:h_from:}{${"
env-from: apache@???
  env-to: apache@???


If I do (which should just not do any rewrite):

apache@??? "${if def:h_from:{${address:$h_from:}}{fail}}" Fq

I get:

  sender: apache@???
    from: apache@???
      to: apache@???
      cc: apache@???
     bcc: apache@???
reply-to: apache@???
2003-03-31 21:25:43 Rewrite of apache@??? yielded unqualified address
"fail"
env-from: apache@???
  env-to: apache@???


But finally:

apache@??? "${if def:h_from:{${address:$h_from:}}{apache@???}}" Fq

works ok, maybe this rule will be useful to other administrators who are
tired of getting bounces to emails sent by php scripts from users that
use the php mail function.

--
Thanx & best regards ...

Self-made man: A horrible example of unskilled labor.

----------------------------------------------------------------
   David Saez Padros                http://www.ols.es
   On-Line Services 2000 S.L.       e-mail  david@???
   Pintor Vayreda 1                 telf    +34 902 50 29 75
   08184 Palau-Solita i Plegamans   movil   +34 670 35 27 53
----------------------------------------------------------------