Hybrid View

send mails addressed to inexistant local domain users by smtp

hi

i am runing a zimbra m2 server (test installation) at home. since my internet connection is not stable enough to run a "real" mailserver, i am getting all my mails through fetchmail from a pop3 account i have on a mailserver belonging to my virtual server which is hosting my whole domain and it's locatet at a provider somwhere in switzerland.

now as far as fetching my email goes, everything works fine. fetchmail fetches my mail every 60 seconds and distributes it to local users, according to the pop accounts on my virtual server out on the internet. in order to organize my mails by filter rules, i tend to use many different email addresses which all go to my main account using a catch-all configuration. recieving them works, sorting them works, but i have a big problem sending my mails out:

when i try to send an email to an email address of my domain, which zimbra doesn't know, it shows an error when i try to send the message and tells me that this is an unknown user. well it certainly is with zimbra, but my mailserver on the virtual server at my provider would know what to do. so what i want is, i want to tell zimbra to forward all emails which are addressed to an inexistant local email address to a smtp server so that this smtp server can then send it through te internet and let it go where it should go, which is my mailserver at the internet provider, which will then recieve this mail, and forward it to my main account because of the catch-all statement... and then it will be fetched and i have it back

i understand that with the catch-all example this doesn't make sense, but imagine there is another user on that mail server at my provider's and he pops his mails directly from my mail server.. well he can't pop his mails from my zimbra server at home, because of my bad internet connection so he has to get the mails from my server at the provider. i could never write any mails to this friend again, since he is using the same domain as i do and zimbra won't allow me to send an email to a user of a domain it "owns" if it knows that this user doesn't exist ...

i hope i could explain my problem.. it's quite hard to describe i think sorry for bothering you.. any help would be greatly appreciated...

smtp host

If you're sending your mail through the web UI, the thing to do is to set your zimbraSmtpHost setting in ldap to your ISPs mail server.

This will cause the mail from the web client to be delivered to the MTA at your ISP - if the mail is for you, your ISP will hand it back to the postfix you've got installed, and then delivered locally.

Your other option is to set the unknown_luser_relay(?) postfix item - check the postfix docs for the correct syntax.

i've looked at the postfix docs and config files and i have found out, that the fallback_transport parameter is what i might want to use in order to achieve my goal, because i could enter an alternative fallback transport to be used whenever no local user is found for an email address of the local domain.
it says, i have to change local_recipient_maps too, in order to allow the usage of undefined local users at all. so i have set those two parameters in main.cf as follows:

Code:

local_recipient_maps =
fallback_transport = smtp:smtp.myprovider.ch

but i still get the same error message when i try to send an email to "testmail@mydomain.ch" where testmail is not a local user, but would be forwarded to my primary email account by my provider's mailserver as described above.. here's the error message i get in the webmail interface, after hitting the send button:

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTranspo rt.java:1141)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTr ansport.java:536)
at javax.mail.Transport.send0(Transport.java:151)
at javax.mail.Transport.send(Transport.java:80)
at com.zimbra.cs.service.mail.SendMsg.sendMimeMessage (SendMsg.java:248)
... 25 more

sorry for digging up this old thread but I need this solution too. Added the fallback_transport accordingly but still not working. Can't use the luser_relay as I need to forward it to a host not a user.