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 <wf...@niif.hu> wrote:

> soumya tr via Exim-users <exim-users@exim.org> writes:
>
> > On Fri, May 26, 2017 at 12:44 AM, soumya tr <soumya....@gmail.com>
> 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
<http://poornam.com>
"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/

Reply via email to