how to make hmailserver to act as a relay / smarthost

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-09-23 23:47

hi there!

i managed to get hmailserver working on a w2k3-server these days. my domain mail.domain.org is working fine. in step 2 i am trying to get the following beside my mail.domain.org working:

can i set up hmailserver in a way, it collects all incoming mail for mailhost.domain.com and forwards it to mail.domain.com, which is hosted on another server. mail.domain.com should also pass outgoing mail over to mailhost.domain.com ??

if this setting is not possible, maybe i can manage to act hmailserver as smarthost for all outgoing mail from mail.domain.com

<hmailserver>
domain.org
mailhost.domain.com

|
|

<server b>
mail.domain.com

can someone help me?


engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

Re: how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-09-24 16:21

ahh, thank you for that information ...

two more question on that topic came up when reading this:

1. does this setting affect the other served domain?
2. how to set this up for sending emails via the mailhost.domain.com coming from mail.domain.com going to external recipients?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: how to make hmailserver to act as a relay / smarthost

Post by martin » 2008-09-24 18:28

A route in hMailServer does not affect other hosted domains unless it has the same as an existing domain.

> 2. how to set this up for sending emails via the mailhost.domain.com coming from mail.domain.com going to external recipients?

Not really clear to me what you mean? If you set up a route named mailhost.domain.com and specify target SMTP server in that one, all email sent to that domain name will be forwarded to the target SMTP server.

engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

Re: how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-09-24 20:40

martin wrote:Not really clear to me what you mean? If you set up a route named mailhost.domain.com and specify target SMTP server in that one, all email sent to that domain name will be forwarded to the target SMTP server.
thank you for your help so far.

what i ment is: the setting mentioned above lets hmailserver act as a backup-mailserver, which means emails are coming in via hmailserver to the backend mailserver. is there something special to do, to get emails going out from the backend mailserver via hmailserver to external recipients?

i already set hmailserver to be the "smarthost" for the backend mailserver. what do i have to do to get hmailserver to do this most secure ... ?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: how to make hmailserver to act as a relay / smarthost

Post by martin » 2008-09-24 20:50

You probably want to add an IP range in hMailServer matching the IP address of the backend server, specify the same options as in the Internet IP range, but select "External to external". Otherwise the internal server will have problems sending email to recipients on external servers. (Since the Internet IP range in hMailServer, which by default the backend server would match, does not permit delivery from external recipients to other external recipients. Since the domain hosted by the backend server is not set up as a domain in hMailServer, it's considered external.)

engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

Re: how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-11-13 13:29

martin wrote:You probably want to add an IP range in hMailServer matching the IP address of the backend server, specify the same options as in the Internet IP range, but select "External to external". Otherwise the internal server will have problems sending email to recipients on external servers. (Since the Internet IP range in hMailServer, which by default the backend server would match, does not permit delivery from external recipients to other external recipients. Since the domain hosted by the backend server is not set up as a domain in hMailServer, it's considered external.)
hi,
i am still searching the right configuration for my server.

part one - whith incoming mail forwarded to the second mailserver mail.example.com is now working and actually working fine.

part two is much more tricky for me an this is where i really need your help badly: sent emails from user@example.com should go to mail.example.com and from there directly to mailhost.example.com - and the mailhost should deliver it to the other mailservers.
actually mail.example.com is behind a dls-line, mailhost.example.com is a fixed server in the net. so all the traffic is forwarded to the smarthost mailhost.example.com. but the mailhost doesn´t take the messages at all - they stay pending on mail.example.com ...

unfortunally hmailserver doesnt write anything about this into its logfile ...

can anybody help me with this?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: how to make hmailserver to act as a relay / smarthost

Post by martin » 2008-11-13 14:07

> they stay pending on mail.example.com ...

But that server isn't running hMailServer, right? I get a bit confused when you mix up the host names. Have you checked the logs on the backend server to see what's going on? What does the bounce message say which, I assume, the backend server delivers to the user when it fails to deliver the message to your hMailServer installation?

engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

Re: how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-11-13 15:14

martin wrote:But that server isn't running hMailServer, right?
it is a small business server installation running exchange 2003 - so i actually can´t replace the exchange server, because it is also used for collaboration.

the exchange server is behind an Astaro V7 gateway an the Astaro does the forwarding to the hmailserver.

log:

Code: Select all

Message Delivery Log:
2008-11-13 12:30:40 mailhost.____.at [xx.yy.xx.yy] Connection timed out
2008-11-13 12:30:40 wolfgang.denk@______.at R=smarthost_route T=remote_smtp defer (110): Connection timed out

Message Delivery Log:
2008-11-13 13:51:11 wolfgang.denk@______.at R=smarthost_route T=remote_smtp defer (-53): retry time not reached for any host

2008:11:13-14:09:09 (none) exim[803]: 2008-11-13 14:09:09 0zO6Wf-0006oL-0T mailhost.____.at [xx.yy.xx.yy]  Connection timed out
2008:11:13-14:09:09 (none) exim[802]: 2008-11-13 14:09:09 0zO6Wf-0006oL-0T == wolfgang.denk@_____.at R=smarthost_route T=remote_smtp defer (110): Connection timed out
2008:11:13-14:09:09 (none) exim[1025]: 2008-11-13 14:09:09 0z4MCQ-0007Cr-1x == wolfgang.denk@_____.at R=smarthost_route T=remote_smtp defer (-53): retry time not reached for any host
2
i am a bit confused as it seems hmailserser is not accepting the messages at all ...

the perfect solution would be, to have only an auth-user-access on hmailserver.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: how to make hmailserver to act as a relay / smarthost

Post by martin » 2008-11-13 15:26

So the connection to hMailServer timed out. Which is why you don't see anything in the hMailServer logs - the server hasn't even been able to connect.

I would recheck the smart-host set-up in Exchange. Try to telnet from the Exchange server to hMailServer on port 25 to confirm that you can connect.

engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

Re: how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-11-13 18:00

martin wrote:I would recheck the smart-host set-up in Exchange. Try to telnet from the Exchange server to hMailServer on port 25 to confirm that you can connect.
:shock: connection didnt work - so i put it up again. actually i can connect to the mailhost on port 2525, telnet was successfully. but the messages are still not taken by hmailserver :-(

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: how to make hmailserver to act as a relay / smarthost

Post by martin » 2008-11-13 18:05

Huh? Put what up again?
Is hMailServer listening on port 25 or 2525? Have you configured Exchange to relay to the specific port you have configured hMailServer to listen on?

engel.aloisius
New user
New user
Posts: 12
Joined: 2008-09-23 23:34

Re: how to make hmailserver to act as a relay / smarthost

Post by engel.aloisius » 2008-11-13 18:20

martin wrote:Is hMailServer listening on port 25 or 2525? Have you configured Exchange to relay to the specific port you have configured hMailServer to listen on?
hMailServer has defined protocols (SMTP) regulary on 25 and additional 2525. when i telnet on either 25 or 2525 i get response in both cases. so hMailServer should listen on both ports i guess.

the forward relay for the exchange in also functional. i can telnet from the exchange-machine.

i could take some screenshots of my hMailServer-config if thats affordable.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: how to make hmailserver to act as a relay / smarthost

Post by martin » 2008-11-13 18:23

So from the Exchange computer you can telnet to hMailServer on port 25. But Exchange cannot connect to hMailServer on port 25. Did I get that right? From hMailServers point of view there is no difference between those two scenarios so I don't see how it could have anything to do with hMailServer. If hMailServer responds properly on port 25 but Exchange cannot connect, it sounds more like a problem in the Exchange configuration?

Post Reply