send external mail with user credentials

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
HakimzyanovA
New user
New user
Posts: 3
Joined: 2019-06-14 12:30

send external mail with user credentials

Post by HakimzyanovA » 2019-06-14 12:59

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.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8020
Joined: 2011-09-08 17:48

Re: send external mail with user credentials

Post by jimimaseye » 2019-06-14 14:11

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.]
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

HakimzyanovA
New user
New user
Posts: 3
Joined: 2019-06-14 12:30

Re: send external mail with user credentials

Post by HakimzyanovA » 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.

User avatar
mattg
Moderator
Moderator
Posts: 19906
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: send external mail with user credentials

Post by mattg » 2019-06-17 07:41

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
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

HakimzyanovA
New user
New user
Posts: 3
Joined: 2019-06-14 12:30

Re: send external mail with user credentials

Post by HakimzyanovA » 2019-06-17 08:10

ok, ifaik it is worked fine, thanks :D

Post Reply