Cannot forward mail with SMTP Authentication enabled.

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
Microquest
New user
New user
Posts: 2
Joined: 2019-01-30 23:50

Cannot forward mail with SMTP Authentication enabled.

Post by Microquest » 2019-01-31 00:58

Hello.
I am trying to use hmail to receive and send out mail from our software program installed at clients sites. I have setup hmail with the domain of let’s say “xyz.ca” which is a separate domain from our main domain and email address that we use of let’s say “abc.ca”. We have software that is installed at client’s sites that has the ability to email us when a backup fails, but when I configure the software we do not receive the email. The software is configured to send to “myemail@abc.ca” using credentials from “backupfail@xyz.com” on hmail pointing to our hmail server external IP address.
I have in hmail “Require SMTP Authentication Local to External, External to Local, External to External” selected and I have Local to Local unselected. With all three selected and authentication turned off on our software program I get an authentication is required error, so I know it is hitting the server. If I deselect “Local to External” and leave authentication off on our program the emails send normally.
When I select Local to External and enable Authentication on our software I get mail error 504 gateway timeout error instantly. I have included parts of the log from hmail server. Can anyone point me in the direction of what I have misconfigured?

Below is a failure with authentication enabled:

"DEBUG" 5452 "2019-01-30 10:16:55.968" "Creating session 12662"
"TCPIP" 5452 "2019-01-30 10:16:55.968" "TCP - 174.3.x.x connected to 192.168.x.x:587."
"DEBUG" 5452 "2019-01-30 10:16:55.968" "TCP connection started for session 12658"
"SMTPD" 5452 12658 "2019-01-30 10:16:55.968" "174.3.x.x" "SENT: 220 mail.xyz.ca ESMTP"
"SMTPD" 3580 12658 "2019-01-30 10:16:56.014" "174.3.x.x" "RECEIVED: EHLO RIPPER"
"SMTPD" 3580 12658 "2019-01-30 10:16:56.014" "174.3.x.x" "SENT: 250-mail.xyz.ca[nl]250-SIZE 20480000[nl]250-AUTH LOGIN[nl]250 HELP"
"SMTPD" 5452 12658 "2019-01-30 10:16:56.061" "174.3.x.x" "RECEIVED: QUIT"
"SMTPD" 5452 12658 "2019-01-30 10:16:56.061" "174.3.x.x" "SENT: 221 goodbye"
"DEBUG" 3580 "2019-01-30 10:16:56.061" "Ending session 12658"

Below is one that was delivered with authentication disabled:

"DEBUG" 5452 "2019-01-30 10:17:59.532" "Creating session 12663"
"TCPIP" 5452 "2019-01-30 10:17:59.532" "TCP - 174.3.x.x connected to 192.168.x.x:587."
"DEBUG" 5452 "2019-01-30 10:17:59.532" "TCP connection started for session 12662"
"SMTPD" 5452 12662 "2019-01-30 10:17:59.532" "174.3.x.x" "SENT: 220 mail.xyz.ca ESMTP"
"SMTPD" 3580 12662 "2019-01-30 10:17:59.595" "174.3.x.x" "RECEIVED: EHLO RIPPER"
"SMTPD" 3580 12662 "2019-01-30 10:17:59.595" "174.3.x.x" "SENT: 250-mail.xyz.ca[nl]250-SIZE 20480000[nl]250-AUTH LOGIN[nl]250 HELP"
"SMTPD" 5452 12662 "2019-01-30 10:17:59.642" "174.3.x.x" "RECEIVED: MAIL FROM:<backup@xyz.ca>"
"SMTPD" 5452 12662 "2019-01-30 10:17:59.642" "174.3.x.x" "SENT: 250 OK"
"SMTPD" 3580 12662 "2019-01-30 10:17:59.689" "174.3.x.x" "RECEIVED: RCPT TO:<davids@abc.ca>"
"SMTPD" 3580 12662 "2019-01-30 10:17:59.689" "174.3.x.x" "SENT: 250 OK"
"SMTPD" 5452 12662 "2019-01-30 10:17:59.735" "174.3.x.x" "RECEIVED: DATA"
"SMTPD" 5452 12662 "2019-01-30 10:17:59.735" "174.3.x.x" "SENT: 354 OK, send."
"DEBUG" 5452 "2019-01-30 10:17:59.845" "Adding task AsynchronousTask to work queue Asynchronous task queue"
"DEBUG" 5216 "2019-01-30 10:17:59.845" "Executing task AsynchronousTask in work queue Asynchronous task queue"
"DEBUG" 5216 "2019-01-30 10:17:59.860" "Saving message: {CEDC9811-525D-4631-A397-6651190DF98C}.eml"
"DEBUG" 5216 "2019-01-30 10:17:59.860" "Requesting SMTPDeliveryManager to start message delivery"
"SMTPD" 5216 12662 "2019-01-30 10:17:59.860" "174.3.x.x" "SENT: 250 Queued (0.128 seconds)"
"DEBUG" 2500 "2019-01-30 10:17:59.860" "Adding task DeliveryTask to work queue SMTP delivery queue"
"DEBUG" 2076 "2019-01-30 10:17:59.860" "Executing task DeliveryTask in work queue SMTP delivery queue"
"DEBUG" 2076 "2019-01-30 10:17:59.860" "Delivering message..."
"APPLICATION" 2076 "2019-01-30 10:17:59.860" "SMTPDeliverer - Message 1821946: Delivering message from backup@xyz.ca to davids@abc.ca. File: C:\Program Files (x86)\hMailServer\Data\{CEDC9811-525D-4631-A397-6651190DF98C}.eml"
"DEBUG" 2076 "2019-01-30 10:17:59.860" "Applying rules"
"DEBUG" 2076 "2019-01-30 10:17:59.860" "Performing local delivery"
"DEBUG" 2076 "2019-01-30 10:17:59.860" "Local delivery completed"
"TCPIP" 2076 "2019-01-30 10:17:59.860" "DNS MX lookup: abc.ca"
"SMTPD" 4956 12662 "2019-01-30 10:17:59.907" "174.3.x.x" "RECEIVED: QUIT"
"SMTPD" 4956 12662 "2019-01-30 10:17:59.907" "174.3.x.x" "SENT: 221 goodbye"
"DEBUG" 6096 "2019-01-30 10:17:59.907" "Ending session 12662"
"TCPIP" 2076 "2019-01-30 10:18:00.126" "DNS - MX Result: 1 IP addresses were found."
"DEBUG" 2076 "2019-01-30 10:18:00.126" "Starting external delivery process. Server: abc-ca.mail.protection.outlook.com (104.47.60.36), Port: 25, Security: 2, User name: "
"DEBUG" 2076 "2019-01-30 10:18:00.126" "Creating session 12664"
"TCPIP" 2076 "2019-01-30 10:18:00.126" "Connecting to 104.47.60.36:25..."
"DEBUG" 3580 "2019-01-30 10:18:00.220" "TCP connection started for session 12664"
"SMTPC" 3580 12664 "2019-01-30 10:18:05.517" "104.47.60.36" "RECEIVED: 220 QB1CAN01FT004.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Wed, 30 Jan 2019 17:17:59 +0000"
"SMTPC" 3580 12664 "2019-01-30 10:18:05.532" "104.47.60.36" "SENT: EHLO mail.xyz.ca"
"SMTPC" 3612 12664 "2019-01-30 10:18:05.611" "104.47.60.36" "RECEIVED: 250-QB1CAN01FT004.mail.protection.outlook.com Hello [68.179.56.65][nl]250-SIZE 157286400[nl]250-PIPELINING[nl]250-DSN[nl]250-ENHANCEDSTATUSCODES[nl]250-STARTTLS[nl]250-8BITMIME[nl]250-BINARYMIME[nl]250-CHUNKING[nl]250 SMTPUTF8"
"SMTPC" 3612 12664 "2019-01-30 10:18:05.611" "104.47.60.36" "SENT: STARTTLS"
"SMTPC" 5648 12664 "2019-01-30 10:18:05.704" "104.47.60.36" "RECEIVED: 220 2.0.0 SMTP server ready"
"DEBUG" 5648 "2019-01-30 10:18:05.704" "Performing SSL/TLS handshake for session 12664. Verify certificate: True, Expected remote host name: abc-ca.mail.protection.outlook.com"
"DEBUG" 3580 "2019-01-30 10:18:05.798" "Certificate verification succeeded for session 12664."
"TCPIP" 5452 "2019-01-30 10:18:05.908" "TCPConnection - TLS/SSL handshake completed. Session Id: 12664, Remote IP: 104.47.60.36, Version: TLSv1.2, Cipher: ECDHE-RSA-AES256-SHA384, Bits: 256"
"SMTPC" 5452 12664 "2019-01-30 10:18:05.908" "104.47.60.36" "SENT: EHLO mail.xyz.ca"
"SMTPC" 4956 12664 "2019-01-30 10:18:06.001" "104.47.60.36" "RECEIVED: 250-QB1CAN01FT004.mail.protection.outlook.com Hello [68.179.56.65][nl]250-SIZE 157286400[nl]250-PIPELINING[nl]250-DSN[nl]250-ENHANCEDSTATUSCODES[nl]250-8BITMIME[nl]250-BINARYMIME[nl]250-CHUNKING[nl]250 SMTPUTF8"
"SMTPC" 4956 12664 "2019-01-30 10:18:06.001" "104.47.60.36" "SENT: MAIL FROM:<backup@xyz.ca>"
"SMTPC" 5452 12664 "2019-01-30 10:18:18.142" "104.47.60.36" "RECEIVED: 250 2.1.0 Sender OK"
"SMTPC" 5452 12664 "2019-01-30 10:18:18.158" "104.47.60.36" "SENT: RCPT TO:<davids@abc.ca>"
"SMTPC" 5452 12664 "2019-01-30 10:18:44.049" "104.47.60.36" "RECEIVED: 250 2.1.5 Recipient OK"
"SMTPC" 5452 12664 "2019-01-30 10:18:44.049" "104.47.60.36" "SENT: DATA"
"SMTPC" 5648 12664 "2019-01-30 10:18:44.190" "104.47.60.36" "RECEIVED: 354 Start mail input; end with <CRLF>.<CRLF>"
"SMTPC" 5648 12664 "2019-01-30 10:18:44.253" "104.47.60.36" "SENT: [nl]."
"SMTPC" 5452 12664 "2019-01-30 10:19:02.394" "104.47.60.36" "RECEIVED: 250 2.6.0 <A3F14514-B3D0-47A0-A6B3-0AB338824B80@mail.xyz.ca> [InternalId=1627792606594, Hostname=YTBPR01MB2976.CANPRD01.PROD.OUTLOOK.COM] 8228 bytes in 0.159, 50.484 KB/sec Queued mail for delivery"
"SMTPC" 5452 12664 "2019-01-30 10:19:02.394" "104.47.60.36" "SENT: QUIT"
"SMTPC" 5648 12664 "2019-01-30 10:19:02.488" "104.47.60.36" "RECEIVED: 221 2.0.0 Service closing transmission channel"
"DEBUG" 5648 "2019-01-30 10:19:02.488" "Ending session 12664"
"DEBUG" 2076 "2019-01-30 10:19:02.488" "External delivery process completed"
"DEBUG" 2076 "2019-01-30 10:19:02.488" "Summarizing delivery result"
"DEBUG" 2076 "2019-01-30 10:19:02.488" "AWStats::LogDeliverySuccess"
"DEBUG" 2076 "2019-01-30 10:19:02.488" "Summarized delivery results"
"DEBUG" 2076 "2019-01-30 10:19:02.488" "Deleting message"
"DEBUG" 2076 "2019-01-30 10:19:02.488" "Deleting message file."
"APPLICATION" 2076 "2019-01-30 10:19:02.488" "SMTPDeliverer - Message 1821946: Message delivery thread completed."

Thanks
Dave

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

Re: Cannot forward mail with SMTP Authentication enabled.

Post by jimimaseye » 2019-01-31 01:15

run this and post the results: viewtopic.php?f=20&t=30914

[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

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

Re: Cannot forward mail with SMTP Authentication enabled.

Post by mattg » 2019-01-31 04:15

Microquest wrote:
2019-01-31 00:58
I have setup hmail with the domain of let’s say “xyz.ca”

We have software that is installed at client’s sites

If I deselect “Local to External” and leave authentication off on our program the emails send normally.

When I select Local to External and enable Authentication on our software I get mail error 504 gateway timeout error instantly. I have included parts of the log from hmail server. Can anyone point me in the direction of what I have misconfigured?
I think your client software doesn't like to AUTH...
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Microquest
New user
New user
Posts: 2
Joined: 2019-01-30 23:50

Re: Cannot forward mail with SMTP Authentication enabled.

Post by Microquest » 2019-01-31 19:01

Thank you for checking on it jimimaseye

Code: Select all

2019-01-31   Hmailserver: 5.6.5-B2367

DOMAINS

   "Domain1.com" - hexxxxxxxxx.ca                 Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False   
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False
-----------------------------------------------------------------------------------------------

GLOBAL RULES
-----------------------------------------------------------------------------------------------

IP RANGES

IP: 127.0.0.1 - 127.0.0.1     Priority: 15     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    -  True
     External To Local    -  True              External To Local    -  True
     External To External -  True              External To External -  True


IP: 0.0.0.0 - 255.255.255.255     Priority: 10     Name: Internet

  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    -  True
     External To Local    -  True           !! External To Local    -  True !!
       !! EXTERNAL INBOUND ON SUB IP RANGES OR EXTERNAL DOWNLOADS ONLY !!  
     External To External -  True              External To External -  True


------------------------------------------------------
AUTOBANNED Local Addresses:
    No entries

-----------------------------------------------------------------------------------------------

AUTOBAN
  Autoban Enabled: True       Max invalid logon attempts:      3
                              Minutes Before Reset:           15  (0.25 hours, 0.01 days)
                              Minutes to Autoban:          10080  (168.00 hours, 7.00 days)

There is a total of 12 auto-ban IP ranges.
-----------------------------------------------------------------------------------------------

INCOMING RELAYS
   No entries
-----------------------------------------------------------------------------------------------

MIRRORING         Disabled
-----------------------------------------------------------------------------------------------

PROTOCOLS

SMTP
GENERAL             DELIVERY                  RFC COMPLIANCE            ADVANCED
No. Connections:  0  No Retries: 10 Mins:  1   Plain Text:        False  Bind: 
                     Host: EXTERNAL.TLD        Empty sender:      False  Batch recipients:   100
Max Msg Size: 20480  Relay:-                   Incorrect endings:  True  Use STARTTLS:      True
                     (none entered)            Disc. on invalid:   True  Delivered-To hdr: False
                                               Max number commands:  25  Loop limit:           5
                                                                         Recipient hosts:     15
  Routes:
     No routes defined.

POP3
  No. Connections: 0

IMAP
 GENERAL                   PUBLIC FOLDERS                    ADVANCED
  No. Connections:   0      Public folder name: #Public       IMAP sort:  True
                                                              IMAP Quota: True
                                                              IMAP Idle:  True
                                                              IMAP ACL:   True
                                                              Delim: "."
-----------------------------------------------------------------------------------------------

ANTISPAM

GENERAL                              SPAM TESTS              Score   SPAMASSASSIN
  Spam Mark:                  5       Use SPF:           False        Use Spamassassin:   False
  Add X-HmailServer-Spam:     True    Check HELO host:   False    
  Add X-HmailServer-Reason:   True    Check MX records:  False    
  Add X-HmailServer-Subject: False    Verify DKIM:       False    

  Spam delete threshold: 20         Maximum message size: 1024

DNSBL ENTRIES:
                  zen.spamhaus.org      Score: 3     Result: 127.0.0.2-8|127.0.0.10-11

SURBL ENTRIES:
   No 'enabled' entries

GREYLISTING:
  Greylisting:  False

WHITELISTING
   No entries
-----------------------------------------------------------------------------------------------

ANTIVIRUS:  No application configured.

  Block Attachments: True
               *.bat             Batch processing file
               *.cmd             Command file for Windows NT
               *.com             Command
               *.cpl             Windows Control Panel extension
               *.csh             CSH script
               *.exe             Executable file
               *.inf             Setup file
               *.lnk             Windows link file
               *.msi             Windows Installer file
               *.msp             Windows Installer patch
               *.pif             Program Information file
               *.reg             Registration key
               *.scf             Windows Explorer command
               *.scr             Windows Screen saver
-----------------------------------------------------------------------------------------------

SSL CERTIFICATES
   No entries
-----------------------------------------------------------------------------------------------

SSL/TLS
             SSL 3.0 :  False
             TLS 1.0 :   True
             TLS 1.1 :   True
             TLS 1.2 :   True                Verify Remote SSL/TLS Certs:   True
SslCipherList  :

ECDHE-RSA-AES128-GCM-SHA256     - ECDHE-ECDSA-AES128-GCM-SHA256   - ECDHE-RSA-AES256-GCM-SHA384     
ECDHE-ECDSA-AES256-GCM-SHA384   - DHE-RSA-AES128-GCM-SHA256       - DHE-DSS-AES128-GCM-SHA256       
kEDH+AESGCM                     - ECDHE-RSA-AES128-SHA256         - ECDHE-ECDSA-AES128-SHA256       
ECDHE-RSA-AES128-SHA            - ECDHE-ECDSA-AES128-SHA          - ECDHE-RSA-AES256-SHA384         
ECDHE-ECDSA-AES256-SHA384       - ECDHE-RSA-AES256-SHA            - ECDHE-ECDSA-AES256-SHA          
DHE-RSA-AES128-SHA256           - DHE-RSA-AES128-SHA              - DHE-DSS-AES128-SHA256           
DHE-RSA-AES256-SHA256           - DHE-DSS-AES256-SHA              - DHE-RSA-AES256-SHA              
AES128-GCM-SHA256               - AES256-GCM-SHA384               - ECDHE-RSA-RC4-SHA               
ECDHE-ECDSA-RC4-SHA             - AES128                          - AES256                          
RC4-SHA                         - HIGH                            - !aNULL                          
!eNULL                          - !EXPORT                         - !DES                            
!3DES                           - !MD5                            - !PSK;                           
-----------------------------------------------------------------------------------------------

TCPIP PORTS                                         Connection Sec
               0.0.0.0         / 25    / SMTP   -   None                
               0.0.0.0         / 587   / SMTP   -   None                
               192.168.1.125   / 110   / POP3   -   None                
               192.168.1.125   / 143   / IMAP   -   None                
-----------------------------------------------------------------------------------------------

LOGGING      Logging Enabled: True

  Paths:-
    Current:  C:\Program Files (x86)\hMailServer\Logs\hmailserver_2019-01-31.log
    Error:    C:\Program Files (x86)\hMailServer\Logs\ERROR_hmailserver_2019-01-31.log - !! ERRORS PRESENT !!
    Event:    C:\Program Files (x86)\hMailServer\Logs\hmailserver_events.log - Not present
    Awstats:  C:\Program Files (x86)\hMailServer\Logs\hmailserver_awstats.log
                        APPLICATION -    True
                        SMTP        -    True
                        POP3        -    True
                        IMAP        -    True
                        TCPIP       -    True
                        DEBUG       -    True
                        AWSTATS     -    True
-----------------------------------------------------------------------------------------------

SYSTEM TESTS

Database type: MSSQL Compact

IPv6 support is available in operating system.

Backup directory C:\hMailServer_Backup is writable.

Relative message paths are stored in the database for all messages.

-----------------------------------------------------------------------------------------------

HMAILSERVER.INI

[Directories]
Program folder:  C:\Program Files (x86)\hMailServer\
Database folder: C:\Program Files (x86)\hMailServer\Database
Data folder:     C:\Program Files (x86)\hMailServer\Data
Log folder:      C:\Program Files (x86)\hMailServer\Logs
Temp folder:     C:\Program Files (x86)\hMailServer\Temp
Event folder:    C:\Program Files (x86)\hMailServer\Events

[Database]
Type=              MSSQLCE
Username=           
PasswordEncryption=1
Port=              0
Server=             
Internal=          1
-----------------------------------------------------------------------------------------------

Generated by HMSSettingsDiagnostics v1.95, Hmailserver Forum.

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

Re: Cannot forward mail with SMTP Authentication enabled.

Post by mattg » 2019-01-31 23:44

in your current config (as posted)

You won't receive ANY mail from the internet without AUTH, which means that you won't receive ANY mail from the internet

On the IP ranges tab - press the default button and try again

ALSO
There are errors in your error log
Please post the contents of that
C:\Program Files (x86)\hMailServer\Logs\ERROR_hmailserver_2019-01-31.log - !! ERRORS PRESENT !!
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