OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
nexthop picked by custom rewrite service gets overwritten with default nexthop

From: cross eyed (tiredofheadersyahoo.com)
Date: Mon Jan 03 2005 - 16:18:49 CST


What I'm trying to accomplish is the following:

Adding a specific address extension, say +++foo, to an
address will cause the mail to route thru an alternate
relay before taking the "normal" route. Before the
mail is sent on it's way. The +++foo is removed from
the email address, as well as any Recieved headers
that contain +++foo.

What I've got done so far is:

An inbound mail is recieved by the "normal" postfix
addressed to user+++fooexample.com I use a pcre
transport map to select :[127.0.0.1]:2500 as it's next
hop:

/(\+\+\+foo)/ :[127.0.0.1]:2500

For 127.0.0.1:2500 I've added the following in
master.cf:

127.0.0.1:2500 inet n - n - - smtpd
-o cleanup_service_name=cleanup-alt
-o rewrite_service_name=rewrite-alt
-o syslog_facility=local5

cleanup-alt unix n - n - 0 cleanup
-o
recipient_canonical_maps=pcre:/etc/postfix/maps/recipient_canonical-alt
-o syslog_facility=local5

rewrite-alt unix - - n - - trivial-rewrite
-o transport_maps=hash:/etc/postfix/maps/transport-alt
-o syslog_facility=local5

in /etc/postfix/maps/recipient_canonical-alt I have:

/^(.+)\+\+\+foo(.+)$/ ${1}${2}
to remove the +++foo extension

in /etc/postfix/maps/transport-alt I have the ip
address of the
alternate smtp relay:
* :[a.b.c.d]

By setting debug_peer_level to 1 and debug_peer_list =
127.0.0.1,
example.com
I can see that part of this is working:

I can see that stmpd on port 25 recieves it and hands
it off to 127.0.0.1:2500. I see the rewrite-alt
service picking the correct next hop as specified in
/etc/postfix/maps/transport-alt and I see the
recipient_canonical_maps removing the +++foo
extension.

However, it appears that 127.0.0.1:2500 hands it back
to the "normal" postfix which attempts to deliver it
in the normal way (e.g. directly to the MX host
instead of sending it to the next hop as specified in
the -o
transport_maps=hash:/etc/postfix/maps/transport-alt
arg to the rewrite-alt service.

So, what part of the puzzle am I missing here? I think
that I may need to setup a custom smtp service for
delivery, but I'm not real sure how to do that part.

Thanks for any advise or pointers!

-Samson

                
__________________________________
Do you Yahoo!?
Jazz up your holiday email with celebrity designs. Learn more.
http://celebrity.mail.yahoo.com