Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running into some issues setting up hMailServer to use the local SMTP on my server. I've got the local SMTP running and can send mail using telnet and through local .NET apps.

The issue is with getting it to work with forwarding incoming email. I've got a few accounts set up under hMailServer and can get access to POP3 email accounts no problem. It's just getting it all to hang together that I'm having issues with.

If disable the local SMTP and enable it on hMailServer with a relay (I used Gmail) everything works okay apart from the forwarded emails showing up as "via myaccount@gmail.com".

If I enable the local SMTP and disable it on hMailServer (keeping POP3 running) then I don't get any emails through hMailServer - when I leave logging on, nothing is coming through.

I can't run both the local SMTP and the hMailServer SMTP at the same time (Windows one refuses to start).

If I don't enter anything for the relay address in hMailServer's SMTP settings, the diagnostics show it trying to connect to mail.hmailserver.com. The hMailServer instructions state serveral times not to use localhost as the relayer so I've not tried that.

On my firewall, I've got port 25 open for outgoing and 25 and 110 open for incoming.

What I'd like is for hMailServer to handle incoming email and use the local SMTP to send out.

Is there something simple that I'm missing on doing? Any suggestions would be very welcome.

Thanks,

K

share|improve this question
    
Yes. When you disable "local SMTP" how should hMailserver use that? Why even use that? hMailserver already is a SMTP server. –  mailq Aug 19 '11 at 15:04
    
As I said, "If I don't enter anything for the relay address in hMailServer's SMTP settings, the diagnostics show it trying to connect to mail.hmailserver.com". It's not working as an SMTP by itself, it seems to need some sort of relay. Should it be sending email without putting anything in as the relay? –  Kevin Wilson Aug 20 '11 at 8:33
add comment

2 Answers

up vote 1 down vote accepted

So it is really easy. hMailserver has a step-by-step configuration guide for your setup at http://www.hmailserver.com/documentation/v5.3/?page=basic_configuration

Especially read carefully the section about "Specifying SMTP relayer". Which explains when, why and what you should put as an relay for hMailserver.

But don't use hMailserver to relay to another locally running SMTP server. This is neither necessary nor gets you in the right direction. One SMTP server is absolutely enough and hMailserver can act as an SMTP server and SMTP client and that is enough for every purpose you can think of.

To accomplish that you only have to follow the manual. It's all there.


Edit

If that was not understandable enough that there is no need to run two SMTP server on one machine - as .NET and web applications only need a SMTP server and not the Microsoft SMTP server - I'm going to add a solution without port-mapping-bla.

You can bind hMailserver to address 192.168.0.4:25 (or whatever local address you have). Additionally you can bind Microsoft SMTP to address 127.0.0.1:25. So both services can coexist without interfering. Now it is only a DNS resolution thing or a configuration of the client software to use IPs for local delivery.

How to bind to an address in hMailserver is shown here: http://www.hmailserver.com/documentation/v5.3/?page=reference_tcpipport

How to bind to an address in Microsoft SMTP is shown here: Setting the IP address that the SMTP service uses in Windows Server 2008

Sending to the outside world is not a problem and never was a problem. If you absolutely need a relay from hMailserver to Microsoft SMTP (I still have no clue what advantage that should have) then put a relay in hMailserver to 127.0.0.1:25.

Done.

share|improve this answer
    
Looks like I had it set up correctly but was reading the diagnostics wrong. When it was testing the SMTP service, I thought it was trying to use mail.hmailserver.net as the relay but it seems it was just trying to connect to this from the local SMTP. All working now. Thanks for the advice. –  Kevin Wilson Aug 24 '11 at 16:49
add comment

You may be able to setup hMailServer to run its SMTP on a non-port 25 assignment and then utilize something like http://analogx.com/contents/download/Network/pmapper/Freeware.htm to redirect its non-port 25 traffic back to the Windows SMTP (on port 25).

share|improve this answer
    
The challenge with the presented situation is that there are possibly two opposing applications requiring access to the same port (SMTP 25) - hMailServer and the .NET applications requiring access to the Windows SMTP services. The person that downgraded the answer may not understand that proper configuration of multiple SMTP MTAs can work as long as care is taken to ensure there are no unintentional transport loops created. It is an approach used to "bolt-on" additional SMTP processors for virus and spam scanning as well as 3rd party content processors (e.g. amavis as an example). –  user48838 Aug 20 '11 at 10:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.