transport table - and regular expression for dynamic generated e-mails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

transport table - and regular expression for dynamic generated e-mails

Zalezny Niezalezny
Hi,

I would like to route some dynamic generated E-mails to some server.

My E-mail looks as follow:

Original E-mail: [hidden email]

I have a problem with routing that E-mail:
Dynamic generate E-mail: [hidden email]
Domain: example.com


/etc/postfix/transport file looks as follow:


[hidden email]      relay:some.server.relay
/^testmail-.*@example\.com/       relay:some.second.server
example.com                        relay:some.domain



Unfortunately E-mail

[hidden email]

 is routed to some.domain. (routing for example.com).



How to send that message to some.second.server.


I appreciate Your support.


With kind regards

Zalezny
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: transport table - and regular expression for dynamic generated e-mails

Zalezny Niezalezny
HI

You mean /etc/postfix/transport in main.cf ?


Zalezny

On Tue, Mar 28, 2017 at 10:02 AM, Wolfe, Robert <[hidden email]> wrote:
Do  you have a transport mapping file set up  by any chance?

From: Zalezny Niezalezny [mailto:[hidden email]]
To: Postfix users [mailto:[hidden email]]
Sent: Tue, 28 Mar 2017 02:59:07 -0500
Subject: transport table - and regular expression for dynamic generated e-mails


Hi,

I would like to route some dynamic generated E-mails to some server.

My E-mail looks as follow:

Original E-mail: [hidden email]

I have a problem with routing that E-mail:
Dynamic generate E-mail: [hidden email]
Domain: example.com


/etc/postfix/transport file looks as follow:


[hidden email]      relay:some.server.relay
/^testmail-.*@example\.com/       relay:some.second.server
example.com                        relay:some.domain



Unfortunately E-mail

[hidden email]

 is routed to some.domain. (routing for example.com).



How to send that message to some.second.server.


I appreciate Your support.


With kind regards

Zalezny

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: transport table - and regular expression for dynamic generated e-mails

Noel Jones-2
In reply to this post by Zalezny Niezalezny
On 3/28/2017 2:59 AM, Zalezny Niezalezny wrote:

> Hi,
>
> I would like to route some dynamic generated E-mails to some server.
>
> My E-mail looks as follow:
>
> Original E-mail: [hidden email] <mailto:[hidden email]>
>
> I have a problem with routing that E-mail:
> Dynamic generate E-mail: [hidden email]
> <mailto:[hidden email]>
> Domain: example.com <http://example.com>
>
>
> /etc/postfix/transport file looks as follow:
>
>
> [hidden email] <mailto:[hidden email]>    
> relay:some.server.relay
> /^testmail-.*@example\.com/       relay:some.second.server
> example.com <http://example.com>                      
> relay:some.domain
>
>
>
> Unfortunately E-mail
>
> [hidden email]
> <mailto:[hidden email]>
>
>  is routed to some.domain. (routing for example.com
> <http://example.com>).
>
>
>
> How to send that message to some.second.server.
>
>
> I appreciate Your support.
>
>
> With kind regards
>
> Zalezny


Looks as if you're mixing regular expressions with indexed lookups
in your transport file.  Don't do that.

Use a regexp: or pcre: transport map type, and write all the entries
as regular expressions.

# main.cf
transport_maps = regexp:/etc/postfix/transport.regexp

# transport.regexp
# in regexp maps, first match wins
/^testmail-.*@example\.com$/   relay:some.second.server
/^testmail@example\.com$/      relay:some.server.relay
/@example\.com$/               relay:some.domain


Alternately, you can use both a regexp: and a hash: map.  This may
be more convenient if you have a large number of transport entries.
# main.cf
transport_maps = regexp:/etc/postfix/transport.regexp
hash:/etc/postfix/transport

http://www.postfix.org/postconf.5.html#transport_maps
http://www.postfix.org/regexp_table.5.html

Loading...