Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread soumya tr via Exim-users
On Wed, May 31, 2017 at 6:24 PM, Jeremy Harris  wrote:

> 1) Please do not top-post.  Again.
>
> 2) I read the mailing list; I do not need a separate copy of
> everything posted to it.  Please don't do that either.
>
> On 31/05/17 13:33, soumya tr via Exim-users wrote:
> > Ohh, I saw the virtual_aliases_nostar under DIRECTORS section, thus
> > addressed it as director.
> > I am using exim-4.87-6 (provided by cpanel)
>
> If you have a "directors" section in your config, I'm surprised it
> works with a version-4 Exim.  At all.
> --
> Jeremy
>
> --
> ## List details at https://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/
>

Sure.
-- 
## List details at https://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/


Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread Jeremy Harris
1) Please do not top-post.  Again.

2) I read the mailing list; I do not need a separate copy of
everything posted to it.  Please don't do that either.

On 31/05/17 13:33, soumya tr via Exim-users wrote:
> Ohh, I saw the virtual_aliases_nostar under DIRECTORS section, thus
> addressed it as director.
> I am using exim-4.87-6 (provided by cpanel)

If you have a "directors" section in your config, I'm surprised it
works with a version-4 Exim.  At all.
-- 
Jeremy

-- 
## List details at https://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/


Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread soumya tr via Exim-users
Hi Jeremy,

>> Woah.  Directors went out when Exim version 3 died.  What version are
you running?

Ohh, I saw the virtual_aliases_nostar under DIRECTORS section, thus
addressed it as director.
I am using exim-4.87-6 (provided by cpanel)

>> Does it have SRS support?
Yes, I enabled SRS. But it seems like thirdparty app (mandrill app) isn't
checking the SRS field. (I will be opening a case with them for this issue)

For now I thought of bypassing the thirdparty app (mandrill app) for all
forwarded mails. But that isn't working .

>> And please don't top-post.
Sure will not do (y)

On Wed, May 31, 2017 at 5:34 PM, Jeremy Harris  wrote:

> On 31/05/17 12:48, soumya tr via Exim-users wrote:
> > Suppose there is a forwarder set say,
> >
> > ma...@abc.com -(forwards all maila to) > ma...@def.com
> >
> > Now, if say sen...@gmail.com tries to send a mail to ma...@abc.com,
> then it
> > will be forwarded to ma...@def.com (as per the forwarder rules) . In my
> > exim conf the director which figures out this is:
>
> 
> Woah.  Directors went out when Exim version 3 died.  What version are
> you running?
>
> >
> > 
> > virtual_aliases_nostar:
> >   driver = redirect
> >   srs = forward
>
> Does it have SRS support?
>
> >
> >
> > On Wed, May 31, 2017 at 1:42 PM, Ferenc Wágner  wrote:
>
> And please don't top-post.
> --
> Jeremy
>
> --
> ## List details at https://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/




-- 
Regards,
Soumya
Linux Sytem Administrator
DirectI

"I like the dreams of the future better than the history of the past."
-- 
## List details at https://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/

Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread Jeremy Harris
On 31/05/17 12:48, soumya tr via Exim-users wrote:
> Suppose there is a forwarder set say,
> 
> ma...@abc.com -(forwards all maila to) > ma...@def.com
> 
> Now, if say sen...@gmail.com tries to send a mail to ma...@abc.com, then it
> will be forwarded to ma...@def.com (as per the forwarder rules) . In my
> exim conf the director which figures out this is:


Woah.  Directors went out when Exim version 3 died.  What version are
you running?

> 
> 
> virtual_aliases_nostar:
>   driver = redirect
>   srs = forward

Does it have SRS support?

> 
> 
> On Wed, May 31, 2017 at 1:42 PM, Ferenc Wágner  wrote:

And please don't top-post.
-- 
Jeremy

-- 
## List details at https://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/

Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread soumya tr via Exim-users
Hi Wagner,

Thanks for the response.

Suppose there is a forwarder set say,

ma...@abc.com -(forwards all maila to) > ma...@def.com

Now, if say sen...@gmail.com tries to send a mail to ma...@abc.com, then it
will be forwarded to ma...@def.com (as per the forwarder rules) . In my
exim conf the director which figures out this is:


virtual_aliases_nostar:
  driver = redirect
  srs = forward
  allow_defer
  allow_fail
  domains = !$primary_hostname
  require_files = "+/etc/valiases/$domain"
  address_data = ${lookup{$local_part@
$domain}lsearch{/etc/valiases/$domain}}
  data = $address_data
  file_transport = address_file
  pipe_transport = ${if
forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if
match{${extract{6}{:}{${lookup
passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe
  retry_use_local_part
  unseen


All the mails from my server route via a 3rd party server (Mandrillapp). At
mandrill app side they just reject such mails, because the from address for
such mails will be an outside domain (in the above case sen...@gmail.com).

So what I was trying to do is to set the envelop from header to
ma...@abc.com (actual header will be sen...@gmail.com). But that didn't
work.

Another option I was trying is to send all the forwarded mails via server
itself (instead of routing via different server). For this purpose, I tried
to add a header in virtual_aliases_nostar, and added a custom router to
check for the header and send :



fwded_route:
driver = accept
condition = ${if def:header_X-Fwded-Mail:}
transport = remote_smtp

virtual_aliases_nostar:
  driver = redirect
  srs = forward
  allow_defer
  allow_fail
  domains = !$primary_hostname
  require_files = "+/etc/valiases/$domain"
  address_data = ${lookup{$local_part@
$domain}lsearch{/etc/valiases/$domain}}
  data = $address_data
  condition = ${lookup{$local_part@$domain}lsearch{/etc/valiases/$domain}
{yes}{no}}
  headers_add = X-Fwded-mail: ${lookup{$local_part@
$domain}lsearch{/etc/valiases/$domain}}
  file_transport = address_file
  pipe_transport = ${if
forall{/bin/cagefs_enter:/usr/sbin/cagefsctl}{exists{$item}}{cagefs_virtual_address_pipe}{${if
match{${extract{6}{:}{${lookup
passwd{${lookup{$domain}lsearch{/etc/userdomains}{$value}}}{$value}{\N(jail|no)shell\N}{jailed_virtual_address_pipe}{virtual_address_pipe
  retry_use_local_part
  unseen


But the above settings doesn't work.

I am not sure if I am going in the right direction. Please assist.



On Wed, May 31, 2017 at 1:42 PM, Ferenc Wágner  wrote:

> soumya tr via Exim-users  writes:
>
> > On Fri, May 26, 2017 at 12:44 AM, soumya tr 
> wrote:
> >
> >> I have a forwarder set. All the outgoing mails relay via a3rd party mail
> >> app . In the 3rd party app I have mentioned the list of allowed domains
> >> that can send out mails.
> >>
> >> But as all the forwarder mails have from address as the actual from, 3rd
> >> party app is rejecting it. So I was thinking of changing the envelop
> header
> >> of the mail to that of actual recipient in the server.  Is it possible
> to
> >> achieve it via routers? Is there any other way I can handle this?
> >
> > Has anyone else faced any similar scenario?
>
> I don't know.  I tried to understand your description several times, but
> failed.  Others may experience a similar difficulty.  I suggest you
> rephrase your question using precise terminology and defining ambiguous
> terms like for example "allowed domain", "actual", "envelop header",
> "server" and so on.
> --
> Regards,
> Feri
>



-- 
Regards,
Soumya
Linux Sytem Administrator
DirectI

"I like the dreams of the future better than the history of the past."
-- 
## List details at https://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/

Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread Andrew C Aitchison

On Fri, 26 May 2017, soumya tr via Exim-users wrote:


Hi,

I have a forwarder set. All the outgoing mails relay via a3rd party mail
app . In the 3rd party app I have mentioned the list of allowed domains
that can send out mails.

But as all the forwarder mails have from address as the actual from, 3rd
party app is rejecting it. So I was thinking of changing the envelop header
of the mail to that of actual recipient in the server.  Is it possible to
achieve it via routers? Is there any other way I can handle this?


I aren't using the standard jargon (there is no good reason
why you should) and I'm finding your description a little
difficult to understand, but I think you have the right idea.

I *think* the 3rd paty app is rejecting these emails because
they fail SPF; the usual way to fix this is indeed to use the
incoming recipient address (although it is not commonly described
that way) - or something based on that - as the outgoing envelope
 From address. This is known as SRS and I think that would be correct
thing for you to do.

I'm afraid that I don't remember how to implement SRS in exim.

Good luck,

--
Andrew C Aitchison  Cambridge, UK

--
## List details at https://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/


Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread Jan Ingvoldstad via Exim-users
On Wed, May 31, 2017 at 10:12 AM, Ferenc Wágner  wrote:

> soumya tr via Exim-users  writes:
>
> > On Fri, May 26, 2017 at 12:44 AM, soumya tr 
> wrote:
> >
> >> I have a forwarder set. All the outgoing mails relay via a3rd party mail
> >> app . In the 3rd party app I have mentioned the list of allowed domains
> >> that can send out mails.
> >>
> >> But as all the forwarder mails have from address as the actual from, 3rd
> >> party app is rejecting it. So I was thinking of changing the envelop
> header
> >> of the mail to that of actual recipient in the server.  Is it possible
> to
> >> achieve it via routers? Is there any other way I can handle this?
> >
> > Has anyone else faced any similar scenario?
>
> I don't know.  I tried to understand your description several times, but
> failed.  Others may experience a similar difficulty.  I suggest you
> rephrase your question using precise terminology and defining ambiguous
> terms like for example "allowed domain", "actual", "envelop header",
> "server" and so on.
>
>
As it's a forwarder, he needs to setup SRS (sender rewriting scheme) in his
forwarder.
-- 
Jan
-- 
## List details at https://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/

Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-31 Thread Ferenc Wágner
soumya tr via Exim-users  writes:

> On Fri, May 26, 2017 at 12:44 AM, soumya tr  wrote:
>
>> I have a forwarder set. All the outgoing mails relay via a3rd party mail
>> app . In the 3rd party app I have mentioned the list of allowed domains
>> that can send out mails.
>>
>> But as all the forwarder mails have from address as the actual from, 3rd
>> party app is rejecting it. So I was thinking of changing the envelop header
>> of the mail to that of actual recipient in the server.  Is it possible to
>> achieve it via routers? Is there any other way I can handle this?
>
> Has anyone else faced any similar scenario?

I don't know.  I tried to understand your description several times, but
failed.  Others may experience a similar difficulty.  I suggest you
rephrase your question using precise terminology and defining ambiguous
terms like for example "allowed domain", "actual", "envelop header",
"server" and so on.
-- 
Regards,
Feri

-- 
## List details at https://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/


Re: [exim] Changing envelope from address to actual recipient address in forwarded mails

2017-05-30 Thread soumya tr via Exim-users
Hey,

Has anyone else faced any similar scenario?



On Fri, May 26, 2017 at 12:44 AM, soumya tr  wrote:

> Hi,
>
> I have a forwarder set. All the outgoing mails relay via a3rd party mail
> app . In the 3rd party app I have mentioned the list of allowed domains
> that can send out mails.
>
> But as all the forwarder mails have from address as the actual from, 3rd
> party app is rejecting it. So I was thinking of changing the envelop header
> of the mail to that of actual recipient in the server.  Is it possible to
> achieve it via routers? Is there any other way I can handle this?
>
> Thanks in advance.
>
> --
> Regards,
> Soumya
>



-- 
Regards,
Soumya
Linux Sytem Administrator
DirectI

"I like the dreams of the future better than the history of the past."
-- 
## List details at https://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] Changing envelope from address to actual recipient address in forwarded mails

2017-05-25 Thread soumya tr via Exim-users
Hi,

I have a forwarder set. All the outgoing mails relay via a3rd party mail
app . In the 3rd party app I have mentioned the list of allowed domains
that can send out mails.

But as all the forwarder mails have from address as the actual from, 3rd
party app is rejecting it. So I was thinking of changing the envelop header
of the mail to that of actual recipient in the server.  Is it possible to
achieve it via routers? Is there any other way I can handle this?

Thanks in advance.

-- 
Regards,
Soumya
-- 
## List details at https://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/