Unable To Relay Working

This section contains user-submitted tutorials.
Post Reply
mtarkowski
New user
New user
Posts: 2
Joined: 2018-04-05 00:34

Unable To Relay Working

Post by mtarkowski » 2018-04-05 01:41

Just setup my hmailserver on Windows 10.

Set it to relay to Hotmail using SMTP. When I try to send mail from my computer to localhost hmailserver I keep getting the below errors.

Any help would be greatly appreciated.


########### Powershell script code.

$smtp = New-Object System.Net.Mail.SmtpClient
$smtp.Host = "127.0.0.1"
# $smtp.Host = "localhost"
$smtp.Port = 587
## if I enable below line I get PS error, "Server does not support secure connections."
# $smtp.EnableSsl = "true"

$creds = New-Object System.Net.NetworkCredential
# $currentCreds = Get-Credential

$creds.Domain = ""
$creds.UserName = "Administrator" ## tried "administrator", Hotmail ID and password. Same error returned in log.
$creds.Password = "hmailserver_password"

$smtp.Credentials = $creds
$smtp.Send("me@hotmail.com", "me@hotmail.com", "My Subject", "My Message")




############## Below is hmailserver log output.

"DEBUG" 4276 "2018-04-04 19:09:20.393" "Creating session 11"
"TCPIP" 4276 "2018-04-04 19:09:20.399" "TCP - 127.0.0.1 connected to 127.0.0.1:587."
"DEBUG" 4276 "2018-04-04 19:09:20.405" "TCP connection started for session 10"
"SMTPD" 4276 10 "2018-04-04 19:09:20.411" "127.0.0.1" "SENT: 220 THING ESMTP"
"SMTPD" 4576 10 "2018-04-04 19:09:20.416" "127.0.0.1" "RECEIVED: EHLO Thing"
"SMTPD" 4576 10 "2018-04-04 19:09:20.422" "127.0.0.1" "SENT: 250-THING[nl]250-SIZE 204000[nl]250-AUTH LOGIN PLAIN[nl]250 HELP"
"SMTPD" 2252 10 "2018-04-04 19:09:20.426" "127.0.0.1" "RECEIVED: AUTH login QWRtaW5pc3RyYXRvcg=="
"SMTPD" 2252 10 "2018-04-04 19:09:20.431" "127.0.0.1" "SENT: 334 UGFzc3dvcmQ6"
"SMTPD" 4276 10 "2018-04-04 19:09:20.436" "127.0.0.1" "RECEIVED: ***"
"SMTPD" 4276 10 "2018-04-04 19:09:20.442" "127.0.0.1" "SENT: 535 Authentication failed. Restarting authentication process."
"SMTPD" 2252 10 "2018-04-04 19:09:20.446" "127.0.0.1" "RECEIVED: MAIL FROM:<mtarkowski@hotmail.com>"
"SMTPD" 2252 10 "2018-04-04 19:09:20.453" "127.0.0.1" "SENT: 250 OK"
"SMTPD" 4576 10 "2018-04-04 19:09:20.458" "127.0.0.1" "RECEIVED: RCPT TO:<mtarkowski@hotmail.com>"
"SMTPD" 4576 10 "2018-04-04 19:09:20.464" "127.0.0.1" "SENT: 530 SMTP authentication is required."
"DEBUG" 4576 "2018-04-04 19:09:20.469" "The read operation failed. Bytes transferred: 0 Remote IP: 127.0.0.1, Session: 10, Code: 2, Message: End of file"
"DEBUG" 4576 "2018-04-04 19:09:20.474" "Deleting message file."




######### hmailserver Diagnostics output

Test: Collect server details
hMailServer version: hMailServer 5.6.7-B2425
Database type: MSSQL Compact

Test: Test IPv6
IPv6 support is available in operating system.

Test: Test outbound port
SMTP relayer is in use.
Trying to connect to host smtp.live.com...
Trying to connect to TCP/IP address 2603:1036:102:53::2 on port 587.
Received: 220 MWHPR04CA0072.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 4 Apr 2018 23:18:06 +0000.
Connected successfully.

Test: Test backup directory
Backup directory C:\Program Files (x86)\hMailServer\bu is writable.

Test: Test message file locations
Relative message paths are stored in the database for all messages.

Test: Test IP range configuration
No problems were found in the IP range configuration.





########## Other

IP Ranges / My Computer settings - nothing under "Other" or "Require SMTP Authentication" checked.

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

Re: Unable To Relay Working

Post by mattg » 2018-04-05 03:01

you need a domain and account on hMailserver to authenticate with

Why aren't you just sending direct from your script to hotmail? Why are you involving hMailserver in the middle?

If you want to continue with hMailserver, please run this and post the results >> viewtopic.php?f=20&t=30914
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

mtarkowski
New user
New user
Posts: 2
Joined: 2018-04-05 00:34

Re: Unable To Relay Working

Post by mtarkowski » 2018-04-07 19:00

I ran the script and attached the results.
Attachments
HMSDiagnostic_201804071208.zip
(2.3 KiB) Downloaded 60 times

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

Re: Unable To Relay Working

Post by mattg » 2018-04-08 03:37

Some hints as to what you are trying to achieve and why is useful

Please answer at least these questions, and give as much detail about what you are trying to achieve as possible
mattg wrote:
2018-04-05 03:01
Why aren't you just sending direct from your script to hotmail? Why are you involving hMailserver in the middle?

This server will never receive mail from outside - That's OK if that is the intention
mtarkowski wrote:IP Ranges / My Computer settings - nothing under "Other" or "Require SMTP Authentication" checked.
That's clearly not accurate.

The last line shown here says external to external is allowed but only with AUTH.

Code: Select all

IP RANGES
IP: 127.0.0.1 - 127.0.0.1     Priority: 200     Name: My computer

  Allow connections                         Other
     SMTP:   True                              Antispam :  False
     POP3:  False                              Antivirus:  False
     IMAP:  False                              SSL/TLS:    False

  Allow Deliveries from                     Require Authentication from
     Local To Local       -  True              Local To Local       - False
     Local To External    -  True              Local To External    - False
     External To Local    -  True              External To Local    - False
     External To External -  True              External To External -  True
Your options
#1 You can untick 'require AUTH for external to external
#2 You can create a domain (with a FQDN) on your hMailserver, with Accounts / passwords to use for AUTH
#3 You can send direct to your hotmail account from your script (Why are you using hmailserver)

Please note, that no matter what you do, your mail is likely to be seen as spam, and to be honest unless your script is sending some diagnostics of the system that it is running from to a single hotmail address, that's exactly what it looks to me like will be happening
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply