Autore: W B Hacker Data: To: exim users Oggetto: Re: [exim] ACL rewrite
Searcher wrote: > Thanks for the reply Bill,
>
> The problem here is that I need to rewrite the headers for multiple
> recipients so the only way how to separate them (AFAIK) is to get in emails
> one by one and check the rcpt_to value.
>
> Since I can't touch the headers yet I need to set some flags or variables,
> understood
>
> Could you please provide some simple syntax for doing so? Checking rcpt_to
> against a list of users and adding a flag at SMTP time and checking this
> flag at DATA (or later) time and modifying the headers? Or just point me to
> some papers which deal with this thing specifically (I found few but maybe
> you know more readable ones)
>
> Can I perhaps use this new variable even in the rewrite part?
>
> Thank you either way
>
'Later' is the operative word.
Routers are the first 'as shipped' place that Exim processes traffic in
a 'fully' recipient-unique manner. smtp protocol doesn't support it any
earlier (unless you have courier-mta at BOTH ENDS of session, but that
is not Exim relevant).
As per-recipient information is already available in another header, you
can add a single 'flag' header OR acl_m variable value that *when
combined* with the recipient identity (AND ALSO perhaps another
lookup...) provides the unique trigger you seek.
You can use a complex conditional/lookup in a single router, ELSE a
longish chain of single-purpose routers that trigger only when their
simpler condition is met.
But I say again - the specific end result you seek (still not explained
to us) has probably already been done, and more than once, and in more
than one way.
We can't get very far in pointing you to a fitting example if all you
give us is a 'hint' at how you want to set up the first step...
What do you need to accomplish as an END result?
Bill
>
> Searcher wrote:
>> Hi there,
>>
>> how would I go about an ACL SMTP time header rewrite?
>> I need to check RCPT TO, that's not in the headers so can't use regular
>> rewrite/31_exim4-config_rewriting
>>
>> Thanks
>> -src-
>>
>>
>
> At RCPT TO you don't yet have any headers....
>
> Prior to DATA, all an smtp session has is a 'negotiation' situation.
>
> Your MTA and the distant sender are introducing themselves, exchanging
> credentials, describing what is available and what is wanted (connect,
> helo, mail_from, rcpt_to).
>
> Ever see two dogs meeting for the first time?
>
> Much the same.
>
> You can *prepare* headers to be substituted or appended later, and can
> set flags to cause whatever you have prepped to be actioned. Or NOT.
>
> But DATA is the earliest you are transferred the message and its headers
> and attachments (if any).
>
> That said, a flag, value, or string carried in an acl_m variable might
> serve you better than header alteration.
>
> Bill
>
>