Problems with new Domain and Account

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
Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-07 02:29

We have been using hMailServer for almost 20 years, done upgrades, etc to stay current.
For the first time in a few years we had a need to add a new domain - vegadiscoveriestech.com.

We used the admin tool and created the new domain and added email accounts.
Then were unable to connect in our outlook client. These are the exact same client that already get email for other domains without issues.

Finally tracked down that hMailServer is getting the traffic.
Then discovered that no folders were created for the domain or the accounts.
With some research learned that the folders for accounts are not created until email appears.
Created the domain folder - no change. Created the email folder - no change.

Assuming it is a permissions issue with the hMailServer not being able to create the folders, we created a new windows user 'hMailServiceUser'.
Gave the user admin rights to the entire folder structure for hMail. Set the service to use the new user account.
Server was restarted - deleted the domain from hMail Admin.
Then re-created the domain and one account.
No change! Still no folders and still getting errors when connecting with Outlook.

Looks like login is success but then:
SENT: +ERR Server error: Failed to fetch messages in Inbox.

Any help to resolve is appreciated.

From the Error Log
"ERROR" 5108 "2021-05-06 15:36:59.785" "Severity: 2 (High), Code: HM4207, Source: DALRecordset::ReportEOFError_, Description: Trying to access data in recordset which was EOF. Column: folderid."
"ERROR" 5108 "2021-05-06 15:36:59.785" "Severity: 3 (Medium), Code: HM5209, Source: SMTPDeliverer::DeliverToLocalAccount_, Description: Unable to create account-level message of 6193006 for account admin@vegadiscoveriestech.com."
"ERROR" 5108 "2021-05-06 15:42:32.190" "Severity: 2 (High), Code: HM4207, Source: DALRecordset::ReportEOFError_, Description: Trying to access data in recordset which was EOF. Column: folderid."
"ERROR" 5108 "2021-05-06 15:42:32.190" "Severity: 3 (Medium), Code: HM5209, Source: SMTPDeliverer::DeliverToLocalAccount_, Description: Unable to create account-level message of 6193011 for account support@virtualcoinfolio.com."
"ERROR" 3968 "2021-05-06 15:46:07.145" "Severity: 3 (Medium), Code: HM5209, Source: SMTPDeliverer::DeliverToLocalAccount_, Description: Unable to create account-level message of 6193012 for account admin@vegadiscoveriestech.com."
"ERROR" 3968 "2021-05-06 15:47:12.245" "Severity: 3 (Medium), Code: HM5209, Source: SMTPDeliverer::DeliverToLocalAccount_, Description: Unable to create account-level message of 6193013 for account admin@vegadiscoveriestech.com."

From the regular logs.
"POP3D" 2852 21 "2021-05-06 17:12:22.073" "75.148.59.107" "SENT: +OK HELO vegadiscoveries.net"
"POP3D" 2492 21 "2021-05-06 17:12:22.119" "75.148.59.107" "RECEIVED: CAPA"
"POP3D" 2492 21 "2021-05-06 17:12:22.119" "75.148.59.107" "SENT: +OK CAPA list follows[nl]USER[nl]UIDL[nl]TOP[nl]STLS[nl]."
"POP3D" 2852 21 "2021-05-06 17:12:22.166" "75.148.59.107" "RECEIVED: USER admin@vegadiscoveriestech.com"
"POP3D" 2852 21 "2021-05-06 17:12:22.166" "75.148.59.107" "SENT: +OK Send your password"
"POP3D" 4976 21 "2021-05-06 17:12:22.198" "75.148.59.107" "RECEIVED: PASS ***"
"POP3D" 4976 21 "2021-05-06 17:12:22.338" "75.148.59.107" "SENT: +ERR Server error: Failed to fetch messages in Inbox."
"POP3D" 2852 21 "2021-05-06 17:12:22.370" "75.148.59.107" "RECEIVED: STAT"
"POP3D" 2852 21 "2021-05-06 17:12:22.370" "75.148.59.107" "SENT: -ERR Invalid command in current state."
"POP3D" 2852 22 "2021-05-06 17:12:22.448" "75.148.59.107" "SENT: +OK HELO vegadiscoveries.net"
"POP3D" 2492 22 "2021-05-06 17:12:22.479" "75.148.59.107" "RECEIVED: CAPA"
"POP3D" 2492 22 "2021-05-06 17:12:22.495" "75.148.59.107" "SENT: +OK CAPA list follows[nl]USER[nl]UIDL[nl]TOP[nl]STLS[nl]."
"POP3D" 4976 22 "2021-05-06 17:12:22.510" "75.148.59.107" "RECEIVED: USER admin@vegadiscoveriestech.com"
"POP3D" 4976 22 "2021-05-06 17:12:22.510" "75.148.59.107" "SENT: +OK Send your password"
"POP3D" 2852 22 "2021-05-06 17:12:22.557" "75.148.59.107" "RECEIVED: PASS ***"
"POP3D" 2852 22 "2021-05-06 17:12:22.620" "75.148.59.107" "SENT: +ERR Server error: Failed to fetch messages in Inbox."
"POP3D" 2492 22 "2021-05-06 17:12:22.651" "75.148.59.107" "RECEIVED: QUIT"
"POP3D" 2492 22 "2021-05-06 17:12:22.651" "75.148.59.107" "SENT: +OK POP3 server saying goodbye..."
"SMTPD" 4976 6 "2021-05-06 17:12:22.729" "75.148.59.107" "SENT: 220 HELO vegadiscoveries.net"
"SMTPD" 2852 6 "2021-05-06 17:12:22.760" "75.148.59.107" "RECEIVED: EHLO VMWIN10DevRH"
"SMTPD" 2852 6 "2021-05-06 17:12:22.760" "75.148.59.107" "SENT: 250-vegadiscoveries.net[nl]250-SIZE 30960000[nl]250-STARTTLS[nl]250-AUTH LOGIN PLAIN[nl]250 HELP"
"SMTPD" 2492 6 "2021-05-06 17:12:22.791" "75.148.59.107" "RECEIVED: STARTTLS"
"SMTPD" 2492 6 "2021-05-06 17:12:22.791" "75.148.59.107" "SENT: 220 Ready to start TLS"
"SMTPD" 4976 6 "2021-05-06 17:12:22.932" "75.148.59.107" "RECEIVED: HELO VMWIN10DevRH"
"SMTPD" 4976 6 "2021-05-06 17:12:22.932" "75.148.59.107" "SENT: 250 Hello."
"SMTPD" 2852 6 "2021-05-06 17:12:22.963" "75.148.59.107" "RECEIVED: MAIL FROM: <Admin@VegaDiscoveriesTech.com>"
"SMTPD" 2852 6 "2021-05-06 17:12:35.167" "75.148.59.107" "SENT: 250 OK"
"SMTPD" 2492 6 "2021-05-06 17:12:35.198" "75.148.59.107" "RECEIVED: RCPT TO: <Admin@VegaDiscoveriesTech.com>"
"SMTPD" 2492 6 "2021-05-06 17:12:35.214" "75.148.59.107" "SENT: 530 SMTP authentication is required."

User avatar
jim.bus
Senior user
Senior user
Posts: 701
Joined: 2011-05-28 11:49
Location: US

Re: Problems with new Domain and Account

Post by jim.bus » 2021-05-07 04:27

First enable all your Logs. You are clearly not showing all the Log Entries that exist. But I already see where you have at least one Email Account which is requiring Authentication in vegadiscoveriestech.com and it is not being done. You might also have some other nefarious attacks to your hMailServer being sent. Note the Invalid Command errors showing in the Logs you have displayed. I see these types of errors all the time from nefarious servers trying to break into my hMailServer. Usually they pose no problem though, at least for me.

I am not familiar with IMAP which is what I think you are using but, you appear to be doing a POP3 download of your email messages. If you are using IMAP only then you wouldn't be using POP3. This is probably an error in the Outlook setup which would also prevent you from receiving any email. I see where a HELO for vegadiscoveriestech.com was issued. Presumably this would be your hostname for your hMailServer Email Server. Almost certainly this would appear to not be the case since this is the Domain you just added to your hMailServer. If in fact this is not your hostname for your hMailServer then this probably is why Outlook is not connecting because this would suggest that Outlook is at least using vegadiscoveriestech.com as the hostname of the incoming Email Server which would whatever the hostname of your hMailServer. In other words vegadiscoveriestech.com is not an Email Server. Therefore Outlook will fail to connect to it.

But because you are not showing all your Logs, you can't see the other activity which could very well show what your problem is. These are basically guesses on my part as I cannot see all your Log Entries but to me it appears these are possibilities as to what some of your problems might be.

By the way hMailServer usually just uses 'Local System Account' as the security permission.

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-07 05:05

Thank you for the response.
I have turned on all the logging. Then renamed the existing log files to get a fresh capture.

I am pretty confident that the Outlook settings are correct, because we can send and receive from other domains with the same settings.
I am also confident that we are successfully logging in, because if I change the password then we get a different error. Confidence does mean that I cannot be proven wrong!

I will upload log files in the morning.

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-07 05:48

multiple domains mentioned in those errors

Also run this and post result please
viewtopic.php?f=20&t=30914

Is your hmailserver on a VM?
Is the datastore on the same local machine?
Is the database on same machine?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
johang
Senior user
Senior user
Posts: 534
Joined: 2008-09-01 09:20

Re: Problems with new Domain and Account

Post by johang » 2021-05-07 08:38

Vega Discoveries wrote:
2021-05-07 02:29

Finally tracked down that hMailServer is getting the traffic.
Then discovered that no folders were created for the domain or the accounts.
With some research learned that the folders for accounts are not created until email appears.
Created the domain folder - no change. Created the email folder - no change.
the admin gui should work adding domains and users and catalogs and what not... i think you should get that sorted.. ( not trying to manually add stuff like the catalog )

since you have been "tampering" with database viewtopic.php?t=34763

do you think something could have been changed so hmailserver admin gui does not do its job to the fully creating domain/users/catalogs ?
(setting something in db so hmailserver does not go to stage "add catalog when email arrives)
From the Error Log
"ERROR" 5108 "2021-05-06 15:36:59.785" "Severity: 2 (High), Code: HM4207, Source: DALRecordset::ReportEOFError_, Description: Trying to access data in recordset which was EOF. Column: folderid."
"ERROR" 5108 "2021-05-06 15:36:59.785" "Severity: 3 (Medium), Code: HM5209, Source: SMTPDeliverer::DeliverToLocalAccount_, Description: Unable to create account-level message of 6193006 for account
when searching for HM4207 and HM5209 i unfortunately only end up at webpages describing possible "problems" with database


sorry to be no help at all perhaps a db guru who knows what the stage "add catalog" requires in DB can chip in..
___________________________________________________________end of the line

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-07 18:11

Here is the Analysis report
---------------------------------------------

Code: Select all

2021-05-07   Hmailserver: 5.6.7-B2425

DOMAINS

   "Domain1.com" - 1sxxxxxxxxxxxxxxxxx.com        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

   "Domain2.com" - adxxxxxxxxxxxx.com             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

   "Domain3.com" - adxxxxxxxxxxxxxxxx.orx         Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: admin@Domain3.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain4.com" - brxxxxxxxx.com                 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

   "Domain5.com" - brxxxxxxxxx.com                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

   "Domain6.com" - coxxxxxxxxxxx.com              Enabled: False

   "Domain7.com" - coxxxxxxxxxxxxx.com            Enabled: False

   "Domain8.com" - coxxxxxxxxxxxx.com             Enabled: False

   "Domain9.com" - eaxxxxxx.com                   Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: info@Domain9.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain10.com" - emxxxxxxxxxx.com              Enabled: False

   "Domain11.com" - fixxxxxxxxxxxx.com            Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: support@Domain23.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain12.com" - haxxxxxxxxxxx.com             Enabled: False

   "Domain13.com" - idxxxxxxxxxxxxxxxxx.com       Enabled: False

   "Domain14.com" - iexxx.orx                     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

   "Domain15.com" - ldxxxxxxxxxxxxxxxxxxx.com     Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: ctalda@Domain23.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain16.com" - myxxxxxxx.com                 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

   "Domain17.com" - ogxxxxxxx.com                 Enabled: False

   "Domain18.com" - orxxxxxxxxxxxxxxx.com         Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: rhancock@Domain18.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain19.com" - prxxxxxxxxxxxxxxxxxx.com      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

   "Domain20.com" - raxxxxxxxx.com                Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: rhancock@Domain20.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain21.com" - slxxxxxxxxxxxx.com            Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: True      Catchall: richard@Domain21.com
                   Max message size:        0   Header:   Relaxed  Plus addressing: False
                   Max size of accounts:    0   Body:     Relaxed
                                                Algorithm: SHA256  Greylisting:     False
                                                Private key: c:\program files (x86)\hmailserver\data\Domain21.com\dkim.Domain21.com.pem.txt
                                                Selector:    dkim

   "Domain22.com" - tuxxxxxxxxxx.com              Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: officesupport@Domain22.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain23.com" - vexxxxxxxxxxxxx.com           Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: True      Catchall: support@Domain23.com
                   Max message size:        0   Header:   Relaxed  Plus addressing: False
                   Max size of accounts:    0   Body:     Relaxed
                                                Algorithm: SHA256  Greylisting:     False
                                                Private key: c:\program files (x86)\hmailserver\data\Domain23.com\dkim.Domain23.com.pem
                                                Selector:    dkim

   "Domain24.com" - vexxxxxxxxxxxxx.net           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

   "Domain25.com" - vexxxxxxxxxxxxxxxxx.com       Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: True    
                   Max message size:        0   Header:   Relaxed  Plus addressing: False
                   Max size of accounts:    0   Body:     Relaxed
                                                Algorithm: SHA256  Greylisting:     False
                                                Private key: c:\program files (x86)\hmailserver\data\Domain25.com\dkim.Domain25.com.pem
                                                Selector:    dkim

   "Domain26.com" - vexxxxxx.net                  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

   "Domain27.com" - vixxxxxxxxxxxxxx.com          Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: True    
                   Max message size:        0   Header:   Relaxed  Plus addressing: False
                   Max size of accounts:    0   Body:     Relaxed
                                                Algorithm: SHA256  Greylisting:     False
                                                Private key: c:\program files (x86)\hmailserver\data\Domain27.com\dkim.Domain27.com.pem
                                                Selector:    dkim

   "Domain28.com" - wexxxxxxxxxxxxxxx.com         Enabled: True

SIGNATURE         LIMITS                       DKIM               ADVANCED
  Enabled: False   Max size:                0   Enabled: False     Catchall: support@Domain23.com
                   Max message size:        0                      Plus addressing: False
                   Max size of accounts:    0                    
                                                                   Greylisting:     False

   "Domain29.com" - whxxxxxxxxx.com               Enabled: False
-----------------------------------------------------------------------------------------------

IP RANGES

IP: 192.168.1.1 - 192.168.1.254     Priority: 100     Name: Private IP's

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

  Allow Deliveries from                     Require Authentication from
     Local To Local       -  True              Local To Local       -  True
     Local To External    -  True              Local To External    -  True
     External To Local    -  True              External To Local    - False
     External To External -  True              External To External -  True


IP: 127.0.0.1 - 127.0.0.1     Priority: 15     Name: My computer

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

  Allow Deliveries from                     Require Authentication from
     Local To Local       -  True              Local To Local       -  True
     Local To External    -  True              Local To External    -  True
     External To Local    -  True              External To Local    - False
     External To External - False           


IP: 0.0.0.0 - 255.255.255.255     Priority: 1     Name: Internet

  Allow connections                         Other
     SMTP:   True                              Antispam :   True
     POP3:   True                              Antivirus:   True !! ANTIVIRUS NOT CONFIGURED !!
     IMAP:   True                              SSL/TLS:    False

  Allow Deliveries from                     Require Authentication from
     Local To Local       -  True              Local To Local       -  True
     Local To External    -  True              Local To External    -  True
     External To Local    -  True              External To Local    - False
     External To External -  True              External To External -  True


   !!  Warning:  DEFAULT DOMAIN is SET  !! - "Domain23.com"
------------------------------------------------------
AUTOBANNED Local Addresses:
    No entries

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

AUTOBAN
  Autoban Enabled: True       Max invalid logon attempts:      6
                              Minutes Before Reset:           30  (0.50 hours, 0.02 days)
                              Minutes to Autoban:              5  (0.08 hours, 0.00 days)

No problems were found in the IP range configuration.
-----------------------------------------------------------------------------------------------

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

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

PROTOCOLS

SMTP
GENERAL             DELIVERY                  RFC COMPLIANCE            ADVANCED
No. Connections:  0  No Retries:  4 Mins: 60   Plain Text:         True  Bind: 
                     Host: Domain24.com        Empty sender:       True  Batch recipients:   100
Max Msg Size: 30960  Relay:-                   Incorrect endings:  True  Use STARTTLS:      True
                     (none entered)            Disc. on invalid:   True  Delivered-To hdr: False
                                               Max number commands:  45  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:                  6       Use SPF:            True - 1    Use Spamassassin:    True
  Add X-HmailServer-Spam:     True    Check HELO host:    True - 1    Hostname:       localhost
  Add X-HmailServer-Reason:   True    Check MX records:   True - 1    Port:                 783
  Add X-HmailServer-Subject:  True    Verify DKIM:        True - 1    Use SA score:        True
              Subject Text: "[SPAM]"
  Spam delete threshold: 100         Maximum message size: 1024

DNSBL ENTRIES:
                  zen.spamhaus.org      Score: 5     Result: 127.0.0.2-8|127.0.0.10-11
                   dnsbl.njabl.org      Score: 1     Result: 127.0.0.*
                  psbl.surriel.com      Score: 1     Result: 127.0.0.*
                virbl.dnsbl.bit.nl      Score: 1     Result: 127.0.0.*
            b.barracudacentral.org      Score: 2     Result: 127.0.0.*

SURBL ENTRIES:
                   multi.surbl.org      Score: 1

GREYLISTING:
  Greylisting:   True       Defer mins: 7       Days Unused: 2      Days Used: 72
                            Bypass SPF: False    Bypass A/MX: False

Greylist WHITELIST ENTRIES:
   IP Address: 73.221.100.59

Greylist DOMAINS enabled:
  !! No active domains enabled - GREYLISTING INEFFECTIVE !!

WHITELISTING
              0.0.0.0            to    255.255.255.255              %[@t]trueblueclothing[dot]com
              0.0.0.0            to    255.255.255.255              vegadiscoveries[@t]gmail[dot]com
              0.0.0.0            to    255.255.255.255              %[@t]icardsevice[dot]net
              0.0.0.0            to    255.255.255.255              %[@t]godaddy[dot]com
              0.0.0.0            to    255.255.255.255              maria[dot]jenson[@t]northsight[dot]com
              0.0.0.0            to    255.255.255.255              alohapineselk[@t]gmail[dot]com
              0.0.0.0            to    255.255.255.255              %[@t]no-ip[dot]com
              0.0.0.0            to    255.255.255.255              %[@t]facebookmail[dot]com
              0.0.0.0            to    255.255.255.255              %[@t]opticonusa[dot]com
              0.0.0.0            to    255.255.255.255              dashinsam[@t]earthlink[dot]net
              0.0.0.0            to    255.255.255.255              sheryl[@t]sorourke[dot]com
              0.0.0.0            to    255.255.255.255              [@t]secureserver[dot]net
              0.0.0.0            to    255.255.255.255              vegacontactform[@t]vegadiscoveries[dot]net
              0.0.0.0            to    255.255.255.255              officesupport[@t]vegatunnel[dot]com
-----------------------------------------------------------------------------------------------

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
               *.dll             Dynamic Link Libraries
               *.exe             Executable file
               *.inf             Setup file
               *.lnk             Windows link file
               *.msi             Windows Installer file
               *.msp             Windows Installer patch
               *.reg             Registration key
               *.scf             Windows Explorer command
               *.scr             Windows Screen saver
               *.vbs             Visual Basic Script
-----------------------------------------------------------------------------------------------

SSL CERTIFICATES
   vegadiscoveries
       Certificate: C:\Program Files (x86)\hMailServer\Cert\vegadiscoveries_com.crt
       Private key: C:\Program Files (x86)\hMailServer\Cert\vegadiscoveries_com.key
-----------------------------------------------------------------------------------------------

SSL/TLS
             SSL 3.0 :   True
             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   -   StartTLS Optional   Cert: vegadiscoveries
               0.0.0.0         / 110   / POP3   -   StartTLS Optional   Cert: vegadiscoveries
               0.0.0.0         / 143   / IMAP   -   StartTLS Required   Cert: vegadiscoveries
               0.0.0.0         / 465   / SMTP   -   SSL/TLS             Cert: vegadiscoveries
               0.0.0.0         / 555   / SMTP   -   None                
               0.0.0.0         / 555   / POP3   -   None                
               0.0.0.0         / 587   / SMTP   -   StartTLS Required   Cert: vegadiscoveries
               0.0.0.0         / 993   / IMAP   -   SSL/TLS             Cert: vegadiscoveries
               0.0.0.0         / 995   / POP3   -   SSL/TLS             Cert: vegadiscoveries
               0.0.0.0         / 40808 / POP3   -   StartTLS Optional   Cert: vegadiscoveries
-----------------------------------------------------------------------------------------------

LOGGING      Logging Enabled: True

  Paths:-
    Current:  C:\Program Files (x86)\hMailServer\Logs\hmailserver_2021-05-07.log
    Error:    C:\Program Files (x86)\hMailServer\Logs\ERROR_hmailserver_2021-05-07.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

IPv6 support is available in operating system.

ERROR: Backup directory has not been specified.

ERROR: Full paths are stored in the database.

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

HMAILSERVER.INI

[Directories]
Program folder:  C:\Program Files (x86)\hMailServer\
Database folder: 
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=              MSSQL
Username=          VD_hMailServer
PasswordEncryption=1
Port=              0
Server=            vegahmail
Internal=          0

[Settings]
PreferredHashAlgorithm=0
-----------------------------------------------------------------------------------------------

Generated by HMSSettingsDiagnostics v2.01, Hmailserver Forum.

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-07 18:21

After doing another test -
From Outlook client - send a message from new email account to gmail.
Here are the logs.....

"DEBUG" 8920 "2021-05-07 09:16:28.427" "Creating session 468"
"TCPIP" 8920 "2021-05-07 09:16:28.427" "TCP - 75.148.59.107 connected to 192.168.1.50:110."
"DEBUG" 8920 "2021-05-07 09:16:28.427" "TCP connection started for session 467"
"POP3D" 8920 467 "2021-05-07 09:16:28.427" "75.148.59.107" "SENT: +OK HELO vegadiscoveries.net"
"POP3D" 3572 467 "2021-05-07 09:16:28.474" "75.148.59.107" "RECEIVED: CAPA"
"POP3D" 3572 467 "2021-05-07 09:16:28.474" "75.148.59.107" "SENT: +OK CAPA list follows[nl]USER[nl]UIDL[nl]TOP[nl]STLS[nl]."
"POP3D" 2000 467 "2021-05-07 09:16:28.521" "75.148.59.107" "RECEIVED: USER admin@vegadiscoveriestech.com"
"POP3D" 2000 467 "2021-05-07 09:16:28.552" "75.148.59.107" "SENT: +OK Send your password"
"POP3D" 8920 467 "2021-05-07 09:16:28.599" "75.148.59.107" "RECEIVED: PASS ***"
"POP3D" 8920 467 "2021-05-07 09:16:28.646" "75.148.59.107" "SENT: +ERR Server error: Failed to fetch messages in Inbox."
"POP3D" 8184 467 "2021-05-07 09:16:28.677" "75.148.59.107" "RECEIVED: QUIT"
"POP3D" 8184 467 "2021-05-07 09:16:28.692" "75.148.59.107" "SENT: +OK POP3 server saying goodbye..."
"DEBUG" 8920 "2021-05-07 09:16:28.692" "Ending session 467"
"DEBUG" 8904 "2021-05-07 09:16:28.786" "Creating session 469"
"TCPIP" 8904 "2021-05-07 09:16:28.786" "TCP - 75.148.59.107 connected to 192.168.1.50:587."
"DEBUG" 8904 "2021-05-07 09:16:28.786" "TCP connection started for session 432"
"SMTPD" 8904 432 "2021-05-07 09:16:28.786" "75.148.59.107" "SENT: 220 HELO vegadiscoveries.net"
"SMTPD" 3572 432 "2021-05-07 09:16:28.833" "75.148.59.107" "RECEIVED: EHLO VMWIN10DevRH"
"SMTPD" 3572 432 "2021-05-07 09:16:28.833" "75.148.59.107" "SENT: 250-vegadiscoveries.net[nl]250-SIZE 30960000[nl]250-STARTTLS[nl]250-AUTH LOGIN PLAIN[nl]250 HELP"
"SMTPD" 2000 432 "2021-05-07 09:16:28.880" "75.148.59.107" "RECEIVED: STARTTLS"
"SMTPD" 2000 432 "2021-05-07 09:16:28.880" "75.148.59.107" "SENT: 220 Ready to start TLS"
"DEBUG" 3572 "2021-05-07 09:16:28.880" "Performing SSL/TLS handshake for session 432. Verify certificate: False"
"TCPIP" 8904 "2021-05-07 09:16:29.005" "TCPConnection - TLS/SSL handshake completed. Session Id: 432, Remote IP: 75.148.59.107, Version: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384, Bits: 256"
"SMTPD" 8904 432 "2021-05-07 09:16:29.052" "75.148.59.107" "RECEIVED: HELO VMWIN10DevRH"
"SMTPD" 8904 432 "2021-05-07 09:16:29.052" "75.148.59.107" "SENT: 250 Hello."
"SMTPD" 3572 432 "2021-05-07 09:16:29.099" "75.148.59.107" "RECEIVED: MAIL FROM: <Admin@VegaDiscoveriesTech.com>"
"TCPIP" 3572 "2021-05-07 09:16:29.130" "DNS lookup: 107.59.148.75.zen.spamhaus.org, 0 addresses found: (none), Match: False"
"TCPIP" 3572 "2021-05-07 09:16:37.677" "DNS query failure. Query: 107.59.148.75.dnsbl.njabl.org, Type: A/AAAA, DnsQuery return value: 11002. Message: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server"
"TCPIP" 3572 "2021-05-07 09:16:37.677" "DNS lookup: 107.59.148.75.dnsbl.njabl.org, 0 addresses found: (none), Match: False"
"TCPIP" 3572 "2021-05-07 09:16:37.771" "DNS lookup: 107.59.148.75.psbl.surriel.com, 0 addresses found: (none), Match: False"
"TCPIP" 3572 "2021-05-07 09:16:38.083" "DNS lookup: 107.59.148.75.virbl.dnsbl.bit.nl, 0 addresses found: (none), Match: False"
"TCPIP" 3572 "2021-05-07 09:16:38.177" "DNS lookup: 107.59.148.75.b.barracudacentral.org, 0 addresses found: (none), Match: False"
"DEBUG" 3572 "2021-05-07 09:16:38.177" "Spam test: SpamTestDNSBlackLists, Score: 0"
"DEBUG" 3572 "2021-05-07 09:16:40.442" "Spam test: SpamTestHeloHost, Score: 1"
"DEBUG" 3572 "2021-05-07 09:16:40.536" "Spam test: SpamTestMXRecords, Score: 0"
"DEBUG" 3572 "2021-05-07 09:16:40.786" "Spam test: SpamTestSPF, Score: 0"
"DEBUG" 3572 "2021-05-07 09:16:40.786" "Total spam score: 1"
"SMTPD" 3572 432 "2021-05-07 09:16:40.911" "75.148.59.107" "SENT: 250 OK"
"SMTPD" 8920 432 "2021-05-07 09:16:41.114" "75.148.59.107" "RECEIVED: RCPT TO: <vegadiscoveries@gmail.com>"
"SMTPD" 8920 432 "2021-05-07 09:16:41.192" "75.148.59.107" "SENT: 530 SMTP authentication is required."
"DEBUG" 8920 "2021-05-07 09:16:41.208" "AWStats::LogDeliveryFailure"
"SMTPD" 3572 432 "2021-05-07 09:16:43.786" "75.148.59.107" "RECEIVED: QUIT"
"DEBUG" 3572 "2021-05-07 09:16:43.802" "Deleting message file."
"SMTPD" 3572 432 "2021-05-07 09:16:43.802" "75.148.59.107" "SENT: 221 goodbye"
"DEBUG" 8904 "2021-05-07 09:16:43.802" "Ending session 432"

palinka
Senior user
Senior user
Posts: 2703
Joined: 2017-09-12 17:57

Re: Problems with new Domain and Account

Post by palinka » 2021-05-07 18:32

Vega Discoveries wrote:
2021-05-07 18:11
Here is the Analysis report
---------------------------------------------

Code: Select all

ERROR: Full paths are stored in the database.
I don't know much about this as it predates my use of hmailserver (deprecated before I began using it). I assume the old data dir path must be specified in hmailserver.ini. Perhaps there's some remnant pointing to a non-existent or changed data dir location?

For the old-timers: Was this setting in hmailserver.ini or was it a database setting?

Its just a shot in the dark, but its the only thing I can think of that could explain why a folder can't be created. Obviously, "modren" hmailserver using relative paths draws the data dir info from hmailserver.ini and if one domain folder exists, then you know it cannot possibly be a permissions issue.

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-07 20:04

From the INI file ----

[Directories]
ProgramFolder=C:\Program Files (x86)\hMailServer
DatabaseFolder=
DataFolder=C:\Program Files (x86)\hMailServer\Data
LogFolder=C:\Program Files (x86)\hMailServer\Logs
TempFolder=C:\Program Files (x86)\hMailServer\Temp
EventFolder=C:\Program Files (x86)\hMailServer\Events

And yes - those are valid directories.

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-08 01:01

palinka wrote:
2021-05-07 18:32
Vega Discoveries wrote:
2021-05-07 18:11
Here is the Analysis report
---------------------------------------------

Code: Select all

ERROR: Full paths are stored in the database.
I don't know much about this as it predates my use of hmailserver (deprecated before I began using it). I assume the old data dir path must be specified in hmailserver.ini. Perhaps there's some remnant pointing to a non-existent or changed data dir location?

For the old-timers: Was this setting in hmailserver.ini or was it a database setting?
Neither
Every single message path recorded in the database was written in full in the database
The hmailserver.ini setting replaces that
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-08 01:08

Vega Discoveries wrote:
2021-05-07 18:11
Here is the Analysis report
You have two protocols listening on port 555 - that can't be correct

You have errors - please show the contents of this file
C:\Program Files (x86)\hMailServer\Logs\ERROR_hmailserver_2021-05-07.log
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-10 01:54

mattg wrote:
2021-05-08 01:08
Vega Discoveries wrote:
2021-05-07 18:11
Here is the Analysis report
You have two protocols listening on port 555 - that can't be correct

You have errors - please show the contents of this file
C:\Program Files (x86)\hMailServer\Logs\ERROR_hmailserver_2021-05-07.log
I get that you found an issue that is unrelated to the problem I am having. i.e. it does not matter what ports are listening for what protocaols for the admin tool to correctly create and populate a new account.

I have determined, partially from other posts, that a record for inbox is not being created in the hm_imapfolders table when I create a new email account.
It happens for every domain - not just a new domain.

When I manually create a row in the table the problem of sending and receiving email IS NOT fixed.
So, what other tables get touched when a new email is created?

User avatar
jim.bus
Senior user
Senior user
Posts: 701
Joined: 2011-05-28 11:49
Location: US

Re: Problems with new Domain and Account

Post by jim.bus » 2021-05-10 04:21

Somebody tell me what I am missing:

Assumptions since I haven't heard anything to contradict my understanding so far.

Vega Discoveries appears to intent to be using IMAP and SMTP only. I have not seen so far any references to using POP3.

He seems to have two problems.
1. Vega Discoveries cannot access his IMAP Inbox presumably with Outlook.
2. Vega Discoveries cannot connect when attempting to send an email with Outlook.

Problem 1:
Vega Discoveries Email Client (presumably Outlook) is connecting to hMailServer on a POP3 Port 110 connection and receives a Server Error:Failed to fetch message in Inbox. First suspicion is why is Outlook connecting using POP3 Port 110 when presumably the Email Client should be trying to connect with an IMAP Port 143 Connection (since he didn't appear to be trying to connect using security). This may be what is causing this type of error. I personally never experience these types of errors since I don't use IMAP and am otherwise unfamiliar with this type of error if it is related to an IMAP Folder access using POP3.

Problem 2:
Vega Discoveries Email Client (presumably Outlook) is connecting to hMailServer on an SMTP Port 587 connection and receives a 530 SMTP Authentication is required error which is what should be received because the IP Address Range for his IP Address and Local Domain require Authentication. The Email Client didn't attempt to Authenticate.

So what am I missing? Vega Discoveries isn't showing any Log Entries which indicate he is trying to access any IMAP Folders or at least not accessing IMAP Folders using IMAP Protocols. And the Email Client didn't do an Authentication when one was required.

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-10 04:35

Vega Discoveries wrote:
2021-05-10 01:54
I have determined, partially from other posts, that a record for inbox is not being created in the hm_imapfolders table when I create a new email account.
It happens for every domain - not just a new domain.
The 'other posts', is that also from you?

I just tested and a new hm_imapfolders entry was created for 'INBOX'
Is IMAP as a protocol enabled on your system?
Vega Discoveries wrote:
2021-05-10 01:54
So, what other tables get touched when a new email is created?
I get a new entry in hm_accounts

Vega Discoveries wrote:
2021-05-10 01:54
When I manually create a row in the table the problem of sending and receiving email IS NOT fixed.
AND THIS is the problem

You cannot just manually add rows to tables and expect that to work
I suspect that you have broken your install by directly manipulating your database
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-10 21:19

After much testing and diagnostics here is what I now know.

When a new account is added to any domain a row is created in hm_accounts for the email and three rows are created in hm_imapfolders - one for each SPAM, TRASH and SENT.
From the Admin tool I can create new folders i.e. NEWFOLDER and see the new record in SQL.
The admin tool prevents any add or edit of a folder named INBOX.
If I edit the Folder Name in SQL from NEWFOLDER to NEWFolder2 the change is not visible in the Admin Tool. This is true even if the Admin Tool is closed and re-opened.
Conclusion - The admin writes to SQL but does not read from SQL.

To get the Admin Tool to see the change in SQL the hmail service must be stopped and started. After that the Admin Tool will correctly report the folder name of NEWFOLDER2.

So, we can get an email account to work with the following steps.
1) Create the account with the admin tool.
2) Using the admin tool create 4th imap folder named INBOXA.
3) From SQL rename the folder from INBOXA to INBOX.
4) Re-start the hmail service.
5) Setup MSOutlook for the new email account
We use the following settings - POP3 - incoming on port 110 - SMTP outgoing with login on port 587 with TLS

Test emails to internal domains - ALL Good
Test emails to GMAIL - All Good

Conclusion - Our Admin Tool is not correctly creating the INBOX imap folder on account creation.

Can we re-install the Admin Tool separately? Will re-installing the Admin tool cause us to lose our settings/configuration?

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-10 22:50

Update --- I discovered the following.
I have a bunch of rows in the hm_imapfolders table that are not connected to any rows in the hm_accounts table.
It seems that the Admin Tool is creating an INBOX record in the hm_imapfolders table every time I add a new email account, but it is getting the pointer wrong for the folderaccountid column.

After adding 3 new accounts here is the data;
SELECT TOP (12) [folderid]
,[folderaccountid]
,[folderparentid]
,[foldername]
,[folderissubscribed]
,[foldercreationtime]
,[foldercurrentuid]
FROM [VD_hMailServer].[dbo].[hm_imapfolders]
order by folderid desc

folderid folderaccountid folderparentid foldername folderissubscribed foldercreationtime foldercurrentuid
----------- --------------- -------------- ---------- ------------------ ----------------------- --------------------
12464 12463 -1 INBOX 1 2021-05-10 13:39:43.000 0
12463 2318 -1 SPAM 0 2021-05-10 13:39:43.383 0
12462 2318 -1 TRASH 0 2021-05-10 13:39:43.383 0
12461 2318 -1 SENT 0 2021-05-10 13:39:43.383 0
12460 12459 -1 INBOX 1 2021-05-10 13:38:00.000 0
12459 2317 -1 SPAM 0 2021-05-10 13:38:00.230 0
12458 2317 -1 TRASH 0 2021-05-10 13:38:00.230 0
12457 2317 -1 SENT 0 2021-05-10 13:38:00.230 0
12456 12455 -1 INBOX 1 2021-05-10 13:27:07.000 0
12455 2316 -1 SPAM 0 2021-05-10 13:27:07.450 0
12454 2316 -1 TRASH 0 2021-05-10 13:27:07.450 0
12453 2316 -1 SENT 0 2021-05-10 13:27:07.450 0

The folderaccountid coluimn is getting populated with the folderid value from the SPAM record for each new account being created.

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-10 23:27

Here is my fix:
1 stored procedure, one command file and one task scheduler job.

The Procedure
===========
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Richard Hancock
-- Create date: May 10, 2021
-- Description: Fix problem with imap folders (INBOX)
-- =============================================
ALTER PROCEDURE [dbo].[spi_hm_imapfolders_accountswithoutinbox_AddINBOX]

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

declare @AccountRows Table(rowid int identity(1,1),folderaccountid int)
insert into @AccountRows(folderaccountid)
SELECT folderaccountid--,[accountaddress]
FROM v_hm_imapfolders_accountswithoutinbox
declare @row int, @rows int
set @row = 0
set @rows = (select count(*) from @AccountRows)
declare @folderaccountid int, @folderid int
while @row < @rows
begin
set @row = @row + 1
set @folderaccountid = (Select folderaccountid from @AccountRows where rowid = @row)
set @folderid = (select folderid from hm_imapfolders where folderaccountid = @folderaccountid and foldername = 'SPAM')
if @folderid > 0
begin
update hm_imapfolders
set folderaccountid = @folderaccountid
where folderaccountid = @folderid
end
end
END

The Command File
============
sqlcmd -Q "exec spi_hm_imapfolders_accountswithoutinbox_AddINBOX" -S [servername] -d [databasename]
net stop hMailServer && net start hMailServer

The Task Scheduler Job
===============
Run the command file with elevated permissions once a day!

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

Re: Problems with new Domain and Account

Post by jimimaseye » 2021-05-11 00:06

I have been using hmailserver and monitoring this forum for over 10-years. And I have never seen this scenario before.

This smacks of interference and tinkering with the database and the consequences of doing so.
5.7 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

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-11 01:58

Ya know - it is not the first time someone in this forum has come out and claimed that I broke the system by opening SQL Server.
I have shared most of the testing I have done to get to the bottom of this.

Bottom line - what could I have possibly done to cause three data records to be created correctly and a fourth to fail?

If you did not code the Admin Tool - then you cannot say what is causing this.

I have been doing nothing but trying to get help to solve this problem and until now have ignored this type of accusation.
I suppose I feel I can risk sharing my thoughts now that I have a solution.
But, one thing I do know - after programming large database driven applications for over 40 years, using MS SQL Server for 90% of that work - is that you can never plan for when a bug will appear. And no I am not saying for 100% that there is a bug in the code.

I have seen strange things happen just by copying a file from one computer to another. Just last week we pushed a website out to production and saw strange characters on one of the web pages. Simply pushing out a single file again fixed it!
This is why I am asking for advice on a re-install of the admin tool.
Could you be bothered to actually respond to questions about a long-term fix, rather than the hack I put in place? (see - even I don't think my fix is a good one!)

Let me re-post those questions;
Can we re-install the Admin Tool separately? Will re-installing the Admin tool cause us to lose our settings/configuration?

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-11 03:08

Vega Discoveries wrote:
2021-05-10 21:19
After much testing and diagnostics here is what I now know.

When a new account is added to any domain a row is created in hm_accounts for the email and three rows are created in hm_imapfolders - one for each SPAM, TRASH and SENT.
This is inaccurate

Those folders are ONLY created when an IMAP mail client creates them.
They are NOT created by hMailserver.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-11 03:10

Vega Discoveries wrote:
2021-05-11 01:58
Let me re-post those questions;
Can we re-install the Admin Tool separately? Will re-installing the Admin tool cause us to lose our settings/configuration?
You can install the database and the admin tool separately as you can install them on separate machines
All settings and configuration are stored in the database - EXACTLY WHY direct manipulation of the database is UNSUPPORTED
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-11 04:32

mattg wrote:
2021-05-11 03:08
Vega Discoveries wrote:
2021-05-10 21:19
After much testing and diagnostics here is what I now know.

When a new account is added to any domain a row is created in hm_accounts for the email and three rows are created in hm_imapfolders - one for each SPAM, TRASH and SENT.
This is inaccurate

Those folders are ONLY created when an IMAP mail client creates them.
They are NOT created by hMailserver.
Please review what I wrote - We are both correct. The folders in the file system are not created until later - as you write. But I was not speaking about file folders, I was referencing data in the database and specifically one table in the database.

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-11 04:33

mattg wrote:
2021-05-11 03:10
Vega Discoveries wrote:
2021-05-11 01:58
Let me re-post those questions;
Can we re-install the Admin Tool separately? Will re-installing the Admin tool cause us to lose our settings/configuration?
You can install the database and the admin tool separately as you can install them on separate machines
All settings and configuration are stored in the database - EXACTLY WHY direct manipulation of the database is UNSUPPORTED
Thank you

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-11 05:10

Vega Discoveries wrote:
2021-05-11 04:32
mattg wrote:
2021-05-11 03:08
Vega Discoveries wrote:
2021-05-10 21:19
After much testing and diagnostics here is what I now know.

When a new account is added to any domain a row is created in hm_accounts for the email and three rows are created in hm_imapfolders - one for each SPAM, TRASH and SENT.
This is inaccurate

Those folders are ONLY created when an IMAP mail client creates them.
They are NOT created by hMailserver.
Please review what I wrote - We are both correct. The folders in the file system are not created until later - as you write. But I was not speaking about file folders, I was referencing data in the database and specifically one table in the database.
You ARE incorrect
I am specifically speaking about the database entries
The database entries ARE NOT CREATED until a mail client creates THE FOLDERS via an IMAP connection

As proof, different mail clients add the folders sent, spam and trash under different names. This is also the case for different languages using the same mail client.

Outlook sets the 'sent' folders as 'Sent Messages', whereas Thunderbird sets the sent folder as 'Sent' and in fact if you connect via both clients, both folders will be created


hMailserver doesn't create folders in teh file system for 'sent' or draft or junk.
hMailserver creates a file folder for the account under the domain, and then a heap of two character folders that are hex numerals, as described here >> https://www.hmailserver.com/documentati ... in_datadir
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 4595
Joined: 2006-08-21 15:38
Location: Denmark

Re: Problems with new Domain and Account

Post by SorenR » 2021-05-11 09:20

Vega Discoveries wrote:
2021-05-11 01:58
Ya know - it is not the first time someone in this forum has come out and claimed that I broke the system by opening SQL Server.
I have shared most of the testing I have done to get to the bottom of this.

Bottom line - what could I have possibly done to cause three data records to be created correctly and a fourth to fail?

If you did not code the Admin Tool - then you cannot say what is causing this.

I have been doing nothing but trying to get help to solve this problem and until now have ignored this type of accusation.
I suppose I feel I can risk sharing my thoughts now that I have a solution.
But, one thing I do know - after programming large database driven applications for over 40 years, using MS SQL Server for 90% of that work - is that you can never plan for when a bug will appear. And no I am not saying for 100% that there is a bug in the code.

I have seen strange things happen just by copying a file from one computer to another. Just last week we pushed a website out to production and saw strange characters on one of the web pages. Simply pushing out a single file again fixed it!
This is why I am asking for advice on a re-install of the admin tool.
Could you be bothered to actually respond to questions about a long-term fix, rather than the hack I put in place? (see - even I don't think my fix is a good one!)

Let me re-post those questions;
Can we re-install the Admin Tool separately? Will re-installing the Admin tool cause us to lose our settings/configuration?
The Admin Tool is NOT "doing anything", it is using the API from hMailServer.exe. You can do exactly the same as the GUI with COM/DCOM in VB, VBScript or JScript. hMailServer.exe is the ONLY interface to read/write to the hmailserver database.

If you ran the upgrade from 5.1 directly to 5.6 without intermediates and then later tried to "fix things in the database" despite being told to upgrade in steps then you asked for it.

How you managed to break the system so bad is beyond me. The worst part is that you do not appear to be listening to the advice you are getting.

There are a few options...

1:Install hMailServer 5.6.8 on a new server, create all the users either by GUI or by COM/DCOM scripting. Copy the ..\Data directory with ALL subdirectories to the new server and run DDS (Data Directory Synchronizer). Downfall is ALL emails will be placed in their INBOX'es, all forwards will be ignored, all account rules will be ignored and all passwords will be reset. - This is the quick-and-dirty solution.

2: Use a tool like https://imapsync.lamiral.info/ to sync mailboxes and IMAP folders between servers but you need to reset everyones passwords to do that and all forwards will be ignored... bla bla...

3: Inspiration: viewtopic.php?p=197910#p197910 It is possible to mirror the entire server via scripting WITHOUT TOUCHING THE DATABASE! You cannot break things by using the API and if I'm not completely mistaken then you can even migrate the message flags by using the API.

It is no problem if you reuse the same initials/passwords for databases and administrator on a new server and you can also copy the hmailserver.ini from ..\bin. My production servers and test servers are built that way. That also means the hash and salt used for passwords will be the same. Makes my development environment simpler.

There is always 4: Run the backup from the GUI, hope it is good and restore it on a new server.
It WILL NOT alter any tables, only content.
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

Vega Discoveries
New user
New user
Posts: 25
Joined: 2019-06-21 22:49

Re: Problems with new Domain and Account

Post by Vega Discoveries » 2021-05-11 17:20

This is my last post on this topic.
It is unfortunate that a Moderator of the forum is not as knowledgeable about how some portions of the software works as I have become and that lack of knowledge has resulted inaccurate information being presented as completely accurate, which may end up misleading other users.

I wish all well - I am pleased that my email server is functional again.

I am displeased with the tone that the forum messages are taking. Especially when I took some criticisms of a moderator offline from the public view and the moderator chose to bring that conversation back to the public forum.

Bye for now.

User avatar
RvdH
Senior user
Senior user
Posts: 1466
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Problems with new Domain and Account

Post by RvdH » 2021-05-11 18:32

Vega Discoveries wrote:
2021-05-11 17:20
This is my last post on this topic.
It is unfortunate that a Moderator of the forum is not as knowledgeable about how some portions of the software works as I have become and that lack of knowledge has resulted inaccurate information being presented as completely accurate, which may end up misleading other users.

I wish all well - I am pleased that my email server is functional again.

I am displeased with the tone that the forum messages are taking. Especially when I took some criticisms of a moderator offline from the public view and the moderator chose to bring that conversation back to the public forum.

Bye for now.
I understand your frustration but i have to weigh in here. In practically all topics/issues you posted you talk about modifications in the database and you find (temporary) solutions by editing the database directly (even when told to do not)
Yet you come up with a claim something is not working as expected, you have to ask yourself the question why that is?
Especially as there are only a few topics with issues similar to yours and most of those surprisingly are related to direct database manipulation without using the tools supplied :idea:
You seem a bit stubborn if it comes to listening and taking advice, but if you like assistance in the future I would advice you to do some restoration (as described by SorenR above) so you will have a database without manually manipulated tables.
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

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

Re: Problems with new Domain and Account

Post by mattg » 2021-05-12 02:23

Vega Discoveries wrote:
2021-05-11 17:20
This is my last post on this topic.
It is unfortunate that a Moderator of the forum is not as knowledgeable about how some portions of the software works as I have become and that lack of knowledge has resulted inaccurate information being presented as completely accurate, which may end up misleading other users
To be honest I am absolutely mystified why you keep calling me out on this.

You have absolutely no proof that what you say is true.
I know what you say to be inaccurate, BECAUSE I TESTED this yesterday, just to confirm what I was saying is absolutely correct.

I'm not even certain that you are even using our software, from some of the ridiculous things that you are claiming to be truths.
Vega Discoveries wrote:
2021-05-10 21:19
After much testing and diagnostics here is what I now know.

When a new account is added to any domain a row is created in hm_accounts for the email and three rows are created in hm_imapfolders - one for each SPAM, TRASH and SENT.
This is INACCURATE - ONLY an INBOX is created in that table when the admin GUI is used.
The other folders are created by a mail client .
Vega Discoveries wrote:
2021-05-11 04:32
The folders in the file system are not created until later - as you write.
There are no folders for Spam, trash or Sent created in the file storage AT ALL.
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