Local account sending by SMTP without password?

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
Tilmann
New user
New user
Posts: 28
Joined: 2013-12-19 18:28
Location: Germany

Local account sending by SMTP without password?

Post by Tilmann » 2014-01-16 11:33

Hello again,

I have a local server that needs to be able to send service messages by email - unfortunately it doesn't support any password, but only SMTP without authentification ("Intel Rapid Storage Technology" that informs me if anything with the RAID arrays goes wrong).

I didn't find a setting in hMailServer to disable the SMTP authentification for this particular account. I tried to leave the password empty, but then I only get a warning that this password is weak - and the server still can't post its mails...

Thanks,
Tilmann

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Local account sending by SMTP without password?

Post by Bill48105 » 2014-01-16 18:46

The only way to bypass that is to add an ip range with higher priority & uncheck the option to require authentication. If you make an IP range for local private static IP it should be pretty safe but realize what you are doing.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Tilmann
New user
New user
Posts: 28
Joined: 2013-12-19 18:28
Location: Germany

Re: Local account sending by SMTP without password?

Post by Tilmann » 2014-01-17 15:28

Bill48105 wrote:The only way to bypass that is to add an ip range with higher priority & uncheck the option to require authentication. If you make an IP range for local private static IP it should be pretty safe but realize what you are doing.
Bill
Hello Bill,

thanks alot - this works fine. There is no risk since the server is on the same machine and has its own single IP address. I enabled only this single address to not use authentication and now Intel RST can send its service messages.

However, this leads to the next problem. :(
When the server sends a message, it is delivered to hMailServer with a local mail address (which corresponds to an account in the local domain). Now hMailServer takes this mail address as "From:" when forwarding the message to the ISP via SMTP (auth), but the ISP rejects it since it's not of the right domain... And that $&%@ Intel RST software doesn't even allow separate data for "From" and login... So currently, I can send service messages only within the domain (i.e. as long as SMTP relaying is not needed).

Tilmann

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

Re: Local account sending by SMTP without password?

Post by mattg » 2014-01-17 15:43

You could write a script to change the FROM and other necessary details
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Local account sending by SMTP without password?

Post by Bill48105 » 2014-01-17 16:55

Example of what mattg is talking about:

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
   if oMessage.From = "someone@where.dom" then
	oMessage.From = "someone-else@where.dom"
	oNewMessage.Save
   End If
End Sub
The IF was only added to restrict the change for certain FROM. Without it From would be changed for ALL MAIL & that isn't a good idea on a real server. I'd make sure hmail knows about the new From domain like in a Route or something though or it might bounce.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Tilmann
New user
New user
Posts: 28
Joined: 2013-12-19 18:28
Location: Germany

Re: Local account sending by SMTP without password?

Post by Tilmann » 2014-01-17 17:26

Bill48105 wrote:Example of what mattg is talking about:

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
   if oMessage.From = "someone@where.dom" then
	oMessage.From = "someone-else@where.dom"
	oNewMessage.Save
   End If
End Sub
The IF was only added to restrict the change for certain FROM. Without it From would be changed for ALL MAIL & that isn't a good idea on a real server. I'd make sure hmail knows about the new From domain like in a Route or something though or it might bounce.
Bill
Thanks, Matt and Bill, for the information and explanation.
But maybe it doesn't work, maybe I did something wrong...

The exact situation is: The Intel RST software sends as "service@domain.local", where domain.local is the (only) domain hosted by hMailServer. All external addresses use the domain "domain.de", and this is the only FROM: domain that the ISP accepts with SMTP. I included the above script to change "service@domain.local" to "service@domain.de" (the syntax is checked OK, JFYI), but from the log files, the behaviour is exactly the same:
- hMailServer correctly takes the mail from "service@domain.local" (Intel RST) with SMTP
- correctly delivers to an other internal account (name@domain.local)
- correctly establishes an SMTP connection to the ISP, using the SMTP relay login data
- sends the FROM with "service@domain.local" (--> here it should use "service@domain.de")
- and gets rejected by the ISP since domain.local is not domain.de

Maybe OnAcceptMessage is the wrong place to substitute the FROM address? How can I verify that the script was applied correctly at all and the substitution really was done?

Thanks for all your help,
Tilmann

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Local account sending by SMTP without password?

Post by Bill48105 » 2014-01-17 17:52

Tilmann wrote:
Bill48105 wrote:Example of what mattg is talking about:

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
   if oMessage.From = "someone@where.dom" then
	oMessage.From = "someone-else@where.dom"
	oNewMessage.Save
   End If
End Sub
The IF was only added to restrict the change for certain FROM. Without it From would be changed for ALL MAIL & that isn't a good idea on a real server. I'd make sure hmail knows about the new From domain like in a Route or something though or it might bounce.
Bill
Thanks, Matt and Bill, for the information and explanation.
But maybe it doesn't work, maybe I did something wrong...

The exact situation is: The Intel RST software sends as "service@domain.local", where domain.local is the (only) domain hosted by hMailServer. All external addresses use the domain "domain.de", and this is the only FROM: domain that the ISP accepts with SMTP. I included the above script to change "service@domain.local" to "service@domain.de" (the syntax is checked OK, JFYI), but from the log files, the behaviour is exactly the same:
- hMailServer correctly takes the mail from "service@domain.local" (Intel RST) with SMTP
- correctly delivers to an other internal account (name@domain.local)
- correctly establishes an SMTP connection to the ISP, using the SMTP relay login data
- sends the FROM with "service@domain.local" (--> here it should use "service@domain.de")
- and gets rejected by the ISP since domain.local is not domain.de

Maybe OnAcceptMessage is the wrong place to substitute the FROM address? How can I verify that the script was applied correctly at all and the substitution really was done?

Thanks for all your help,
Tilmann

If you are on 5.4 you might try OnSMTPData instead. You might add some logging like:
EventLog.Write("oMessage.From: "+Chr(34)+oMessage.From)
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Tilmann
New user
New user
Posts: 28
Joined: 2013-12-19 18:28
Location: Germany

Re: Local account sending by SMTP without password?

Post by Tilmann » 2014-01-17 19:29

Bill48105 wrote:If you are on 5.4 you might try OnSMTPData instead. You might add some logging like:
EventLog.Write("oMessage.From: "+Chr(34)+oMessage.From)
Thanks, Bill,

this was a good hint - it showed that "From" is empty, I had to use "FromAddress" instead - and now it works as desired (with the script in OnSMTPData, working on FromAddress).

Many thanks again,
your support is really great.

Have a nice weekend,
Tilmann

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Local account sending by SMTP without password?

Post by Bill48105 » 2014-01-17 22:02

Tilmann wrote:
Bill48105 wrote:If you are on 5.4 you might try OnSMTPData instead. You might add some logging like:
EventLog.Write("oMessage.From: "+Chr(34)+oMessage.From)
Thanks, Bill,

this was a good hint - it showed that "From" is empty, I had to use "FromAddress" instead - and now it works as desired (with the script in OnSMTPData, working on FromAddress).

Many thanks again,
your support is really great.

Have a nice weekend,
Tilmann
Yup sorry about that you are right From is the "name" where FromAddress is the address. Glad you got it sorted.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Arius
New user
New user
Posts: 4
Joined: 2014-08-17 21:31

What version of Intel Rapid Storage Techology are you runnin

Post by Arius » 2014-08-17 23:29

Tilmann:

What version of RST are you running?

I cannot get an Intel RST v13.1.0.1058 email test to succeed. In fact, after running a test with a TCP listener (either hMailServer or another TCP listener) on TCP port 25 it doesn’t seem to do anything, although I can TELNET 127.0.0.1 25 and pass commands to either hMailServer or other.

I can’t test RST with gmail or other server as RST doesn’t support defining username and password for SMTP authentication.

Any suggestions will be very much appreciated.

My configuration:
Windows 7 Pro 64bit sp1
Intel Rapid Storage Technology v13.1.0.1058
Intel(R) ICH8R/ICH9R/ICH10R/DO/5 Series/3400 Series SATA RAID Controller

Tilmann
New user
New user
Posts: 28
Joined: 2013-12-19 18:28
Location: Germany

Re: What version of Intel Rapid Storage Techology are you ru

Post by Tilmann » 2014-08-18 14:04

Arius wrote: What version of RST are you running?
The server runs RST 10.6.0.1002 of 2011 (when it was set up), on Windows Server 2008 R2.
Arius wrote: I cannot get an Intel RST v13.1.0.1058 email test to succeed. In fact, after running a test with a TCP listener (either hMailServer or another TCP listener) on TCP port 25 it doesn’t seem to do anything, although I can TELNET 127.0.0.1 25 and pass commands to either hMailServer or other.

I can’t test RST with gmail or other server as RST doesn’t support defining username and password for SMTP authentication.
When I changed to hMailServer at the end of 2013, I asked Intel for SMTP-auth support, but they denied it. So I had no reason to update RST to a more recent version... But their reply was straight and clear - they don't support it, nor have any plans to do so in the future. This is ignorant, at least - no serious provider accepts mails without authentication any more.

Sorry if I can't help you in this concern.

Tilmann

Arius
New user
New user
Posts: 4
Joined: 2014-08-17 21:31

Re: Local account sending by SMTP without password?

Post by Arius » 2014-08-19 05:36

Thanks. With the hMailServer beta that supports starttls I have implemented it as a SMTP relay to gmail.

Note that AMD also didn't implement SMTP authentication in RAIDXPERT.

Post Reply