I tried to use transport as following:

transport_maps = local.cf remote.cf
- local.cf contains a sql query which returns "virtual" if the "u...@domain" 
matches.
- remote.cf contains a sql query which return "smtp:[mail.gateway]" if the 
domain matches.

Did this according to TABLE SEARCH ORDER section of transport(5), but it still 
doesn't work.
Local users are finely delivered but I get "Recipient address rejected: User 
unknown in virtual mailbox table" for remote users.

As I said, I'm still not (yet :)) very familiar with Postfix.
Could somebody tell what am I missing ?

> > > Hi.
> > > 
> > > I'm trying to setup a multi-server mail architecture with a mail
> > > gateway and 2 final dest. servers hosting mailboxes, all on the same
> > > domain. I'm using virtual mailboxes wih MySQL backend (same for the 3
> > > servers).
> > > 
> > > I set up the gateway which forwards to end servers.
> > > The problem is that I can't get to send email from one end server to
> > > the other.
> > 
> > ...why would you ever do that ?
> 
> I'm upgrading my company's mail system which is working like that for
> years...
> 
> > You send mail to the machine that holds the destination mailbox.
> > Mailstores never send mail to each other.
> > 
> > You should also be aware of the fact that such a setup is fully
> > dependent on the mail gateway; if that goes down, you have no mail
> > system left.
> 
> Indeed, but the mail gateway is actually made of 2 virtual machines for
> load balancing/failover, to avoid that kind of problem.
> 
> > > First I tried to make the server act like if the mailbox didn't exist
> > > on the local server (with SQL where) thinking that if it doesn't exist
> > > here, the mail will be relayed to the 'relay_host', but getting "User
> > > unknown in virtual mailbox table".
> > > It is not working better with "relay_domains" directive, because it is
> > > already set in "virtual_mailbox_domains" one.
> > 
> > That won't work.
> > You say you have user data in a SQL table; then use that to determine
> > which backend should get what.
> > transport_maps would work fine for this.
> > 
> > > I red the all nearly all documentation I found, especially the official
> > > one, but I'm missing some details.
> > 
> > Yes; first and foremost, you're missing the transport(5) man page:
> > http://www.postfix.org/transport.5.html
> 
> Well, I already read that manpage several times, but I'm lacking some
> Postfix fundamentals...
> 
> Anyway, thanks Jeroen for your answer.
> It is quite blur to me but I think you suggest me to create 2 different
> sort of transport :
> - One would be an "alias" to virtual delivery if the query says the user is
> local
> - The second would forward mail to remote users using the smtp delivery
> 
> Correct me if I'm wrong :)

Reply via email to