Page 1 of 1

send external mail with user credentials

Posted: 2019-06-14 12:59
by HakimzyanovA
Hello!

We have internal hmailserver on domain example.org, all users have one account in thunderbird on domain example.org and some users have external accounts on domain example.ru which hosted on ISP.
When user test@example.org send mail to test@gmail.com, hmailserver check mail on OnDeliveryStart(), see that source (test@example.org) in internal and dest (test@gmail.com) is external and change
oMessage.FromAddress, oMessage.From, oMessage.HeaderValue to user test@example.ru and sucessfully send mail to test@gmail.com using login noreply@example.ru for autorization on isp (in smtp-delivery of e-mail - smtp relayer).
Everithing was ok but recently our ISP change their policy for spam prevention: now user who send email and user who autorize on isp smtp must be the same, as in thunderbird i.e. when hmailserver send mail from test@example.ru it must authorize as test@example.ru, when from test2@example.ru as authorize as test2@example.ru etc
So as temporary decision for now hmailserver have to send all external mail from noreply@example.ru, which is very inconvinient :(

Can we solve problem using script or using another smtp in chain: hmailserver -> smtp -> isp?
Thanks and sorry for my english.

Re: send external mail with user credentials

Posted: 2019-06-14 14:11
by jimimaseye
Set up different routes - 1 for each user, each authorising with their own credentials - and the use rules:

If From = user A the send using route userAroute
If From = user B the send using route userBroute
If From = user C the send using route userCroute


Etc

[Entered by mobile. Excuse my spelling.]

Re: send external mail with user credentials

Posted: 2019-06-17 06:24
by HakimzyanovA
Thanks for your advice, but i am don't undestand: how i can make route for all external mail from specific user?
which value I have to place in field Routes-Domain? Becouse I don't know domain - user can send mail to different domains, to @google.com, @yndex.ru etc.

Re: send external mail with user credentials

Posted: 2019-06-17 07:41
by mattg
HakimzyanovA wrote:
2019-06-17 06:24
Thanks for your advice, but i am don't undestand: how i can make route for all external mail from specific user?
which value I have to place in field Routes-Domain? Becouse I don't know domain - user can send mail to different domains, to @google.com, @yndex.ru etc.
It doesn't matter who it is TO only who it is FROM.

The route server will then accept or deny the TO based on their own rules

Which value in routes/domain field? It doesn't matter - probably easier to call the route UserA, UserB etc so that you find them later when setting up your rules

Re: send external mail with user credentials

Posted: 2019-06-17 08:10
by HakimzyanovA
ok, ifaik it is worked fine, thanks :D