Forward unknown recipients to secondary server

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward unknown recipients to secondary server

Guillermo-25
Hello:

I'll start by mentioning I've looked through the mailing list archives
as well as researched through google searches for the last 48 hours
and I haven't found a good solution to my dilemma. There're quite a
few suggestions that have got close to my problem, but still no
solution. Anyway, I'll explain.

Currently I have 2 servers, one that's running Postfix (I'll call it
S2 from now on) and another on Sendmail (S1). I have a ton of users on
S1 that will eventually be moved to S2. I have full control on the
servers, but I honestly don't want to touch S1 as it's already going
down soon either way.

What I need to do is find a way for Postfix (on S2) to forward any
mail that couldn't be delivered locally (on S2) to S1. I'm sure you've
been asked that many times, but the solutions I've seen haven't
worked.

For what I understand, luser_relay can do this job, but my users will
be setup virtually, and for what I've read lusers_relay doesn't work
for virtual mailboxes, so I can't use that. Also, I read about
smtp_fallback_relay, but it doesn't seem to do anything when I use the
setting. I've also tried to use transport_maps, but found out that you
can't use the same domain for 2 destinations, so only one works.

Among other things, I've also read in my searches it's possible to do
it via DNS. Now, while this many mention it'd be simpler and easier, I
currently would like to see how Postfix can do this job first, simply
for self education.

Any help you may provide is greatly appreciated.

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Forward unknown recipients to secondary server

Victor Duchovni
On Thu, Jun 05, 2008 at 09:41:49PM -0500, Guillermo wrote:

> What I need to do is find a way for Postfix (on S2) to forward any
> mail that couldn't be delivered locally (on S2) to S1. I'm sure you've
> been asked that many times, but the solutions I've seen haven't
> worked.

Define "couldn't be delivered locally" more precisely in your context.
What makes a given address "locally deliverable"? How does S2 know
which addresses are valid, and how does it perform delivery for these.

    http://www.postfix.org/DEBUG_README.html#mail.

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: Forward unknown recipients to secondary server

Guillermo-25
On Thu, Jun 5, 2008 at 9:59 PM, Victor Duchovni
<[hidden email]> wrote:

> On Thu, Jun 05, 2008 at 09:41:49PM -0500, Guillermo wrote:
>
>> What I need to do is find a way for Postfix (on S2) to forward any
>> mail that couldn't be delivered locally (on S2) to S1. I'm sure you've
>> been asked that many times, but the solutions I've seen haven't
>> worked.
>
> Define "couldn't be delivered locally" more precisely in your context.
> What makes a given address "locally deliverable"? How does S2 know
> which addresses are valid, and how does it perform delivery for these.
>
>    http://www.postfix.org/DEBUG_README.html#mail.
>

Sorry I was too vague in there.

What I meant was the event of finding no target, or valid recipient
for the mail. S2 knows a mail can be delivered if it finds the mailbox
on its virtual user table (or alias), otherwise it will return the
user does not exist, and bounce it back to its source.

What I want is for S2 to forward the mail to S1 (for further
processing) before it rules it out as non-existant and prevent it from
bouncing.
Reply | Threaded
Open this post in threaded view
|

Re: Forward unknown recipients to secondary server

Victor Duchovni
On Thu, Jun 05, 2008 at 10:39:25PM -0500, Guillermo wrote:

> What I meant was the event of finding no target, or valid recipient
> for the mail. S2 knows a mail can be delivered if it finds the mailbox
> on its virtual user table (or alias), otherwise it will return the
> user does not exist, and bounce it back to its source.

So S2 has a table of valid virtual users, use that to also select the
virtual(8) transport (or lmtp, ...) for *those* users only, and
configure the domain as a relay domain, with users not explicitly
mentioned in the transport table sent to S1. The alternative is
to alias all the virtual users to an internal-only virtual domain,
no per-user transport lookups, and the real domain again routed to S1.

Did I mention:

    <http://www.postfix.org/DEBUG_README.html#mail> ?

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: Forward unknown recipients to secondary server

Guillermo-25
On Thu, Jun 5, 2008 at 11:06 PM, Victor Duchovni
<[hidden email]> wrote:

> On Thu, Jun 05, 2008 at 10:39:25PM -0500, Guillermo wrote:
>
>> What I meant was the event of finding no target, or valid recipient
>> for the mail. S2 knows a mail can be delivered if it finds the mailbox
>> on its virtual user table (or alias), otherwise it will return the
>> user does not exist, and bounce it back to its source.
>
> So S2 has a table of valid virtual users, use that to also select the
> virtual(8) transport (or lmtp, ...) for *those* users only, and
> configure the domain as a relay domain, with users not explicitly
> mentioned in the transport table sent to S1.

I'm not sure I understood this part.

S2 does have a list of valid users for the domain in question. Are you
suggesting I simply make the domain as a relay domain? Wouldn't this
just forward everything to S1?

> The alternative is
> to alias all the virtual users to an internal-only virtual domain,
> no per-user transport lookups, and the real domain again routed to S1.
>

Setting a list of virtual users for those contained on S1 would be too
problematic as that list is quite extensive, and technically speaking
(on a quite different scenario of course) I shouldn't know what users
do exist on S1. This is where I want S1 to kick in, to do the
processing to determine if a user does exist or not, instead of having
S2 doing it.



> Did I mention:
>
>    <http://www.postfix.org/DEBUG_README.html#mail> ?
>
> --

Yes you did, although I didn't see it necessary as it's something that
hasn't yet tossed an error. To be more specific I don't have any logs
that could belong to what I'm trying to do here, as everything is
behaving normally. The server is still doing its functions as it
should, I'm just simply attempting to implement another one, and I'm
not sure how to do it.

I will provide the output of postconf -n though. I replaced the real
addresses with fictitious ones for privacy.

broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
html_directory = no
mail_owner = postfix
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 50000
mydomain = mydomain.mx
myhostname = s2.mydomain.mx
mynetworks_style = host
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relay_transport = relay
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_fallback_relay = s1.mydomain.mx
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = my2ndomain.mx
smtpd_sender_restrictions = reject_unknown_sender_domain
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:125
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains =
mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 512000
virtual_mailbox_maps =
mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 125
virtual_transport = virtual
virtual_uid_maps = static:125

There're several settings here that might be redundant or unnecessary.
This is due to my testings and I haven't stopped to clean them yet.

>        Viktor.
>
> Disclaimer: off-list followups get on-list replies or get ignored.
> Please do not ignore the "Reply-To" header.
>
> To unsubscribe from the postfix-users list, visit
> http://www.postfix.org/lists.html or click the link below:
> <mailto:[hidden email]?body=unsubscribe%20postfix-users>
>
> If my response solves your problem, the best way to thank me is to not
> send an "it worked, thanks" follow-up. If you must respond, please put
> "It worked, thanks" in the "Subject" so I can delete these quickly.
>