Page 1 of 1

Use custom SMTP per user

Posted: Tue Mar 22, 2016 6:06 pm
by maxxer
Uncommon request, but this is the situation: I've configured a domain in Zimbra but I want each user to use an external SMTP for delivery. Also, the SMTP must use Submission port.

I've set up the configuration with stunnel and with postfix_sender_relay and works fine.
The problem is when I send mails between two users of this domain. I'd like those mails to go outside, but of course zimbra is delivering them internally.

I was thinking about setting the relay using zimbraMailTransport but that's act on the recipient, I must set the smtp by sender!

Is it possible to select an outside relay for ALL mails sent from an account?
thanks

Re: Use custom SMTP per user

Posted: Tue Mar 22, 2016 8:37 pm
by ppearl
It might be best to setup (standalone postfix perhaps) MTA(s) for outbound/smart-relay only and do the custom routing/config there...

If you go this route, then you could setup zimbraSmtpHostname for each MBS to talk to the smart-relay (caveats/details just glossed over for now, like rejecting invalid addresses, etc. but that smart mta could be setup to 'do the right thing' in theory) and continue up stream to your MTA that requires use of submission (since ZCS mailbox servers don't know how to do that yet).

I presume you were looking for something more elegant, but hopefully this is at least a little helpful.

Re: Use custom SMTP per user

Posted: Wed Mar 23, 2016 11:06 am
by maxxer
ok. thank you very much for your feedback.

I knew it wouldn't be easy, maybe I'll take another approach. Thanks again!

Re: Use custom SMTP per user

Posted: Wed Mar 23, 2016 1:34 pm
by ezajko
maxxer wrote:Uncommon request, but this is the situation: I've configured a domain in Zimbra but I want each user to use an external SMTP for delivery. Also, the SMTP must use Submission port.

I've set up the configuration with stunnel and with postfix_sender_relay and works fine.
The problem is when I send mails between two users of this domain. I'd like those mails to go outside, but of course zimbra is delivering them internally.

I was thinking about setting the relay using zimbraMailTransport but that's act on the recipient, I must set the smtp by sender!

Is it possible to select an outside relay for ALL mails sent from an account?
thanks


Hi Maxxer,

have you tried this:

https://wiki.zimbra.com/wiki/Relay_per_Domain?

regards,

--eZ

Re: Use custom SMTP per user

Posted: Wed Mar 23, 2016 2:18 pm
by maxxer
thanks but this won't fix the issue of the same domain delivery

Re: Use custom SMTP per user

Posted: Wed Mar 23, 2016 2:33 pm
by ezajko
maxxer wrote:thanks but this won't fix the issue of the same domain delivery


Hi maxxer,

I know it is odd question, but what's the use case for that?
Some external archiving solution?

regards,

--eZ

Re: Use custom SMTP per user

Posted: Wed Mar 23, 2016 3:00 pm
by maxxer
ezajko wrote:I know it is odd question, but what's the use case for that?
Some external archiving solution?


In Italy we have infamous PEC which requires dedicated smtp auth based on sender. This is normally accomplished with sender_dependent_relay, but I (mistakely) configured Zimbra with the PEC domain, so accounts on the same domain which are not in Zimbra are tried internally first.

I need to change the setup, which wasn't initially meant to work this way.