Persistently getting "Access denied" despite correct everything

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
DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-22 02:55

Hi all,

I had to restore the MySQL DB from a backup and change passwords for all MySQL user accounts. Previously I already used that very same backup, and everything worked fine.
Now I was able to bring up everything, which uses this MySQL instance (my web sites, jabber server, and a few other things - all of them happily took the new passwords and are working), but hMailServer. It is persistently giving me Access denied error for the specific user @'localhost', even though I can run mysql and log in with the same credentials.
I tried playing with localhost vs IP vs host name to no avail.
Sometimes I have to wait about 30 seconds to get this message, other times it pops up immediately.
Tried changing the password, allowing the user access from localhost, from this specific host name and from % on MySQL side, and still getting nothing but this message:

"Severity: 1 (Critical), Code: HM4354, Source: Application::OpenDatabase, Description: hMailServer failed to connect to the database server. Error message: Access denied for user 'hMailServer'@'localhost' (using password: YES)"

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-22 04:14

I guess, I am getting a bit further ahead:
I edited the INI file, turned password encryption off, and changed the encrypted password to the same plain text password, which I changed the MySQL user's password to. I am no longer getting the MySQL error.
Now when I am trying to run the admin UI, I am getting a message "the password is incorrect", then the password dialog.
But the admin password, which I am using for more than 10 years and know it for certain, is not working anymore.
Okay, I thought, probably the encryption of passwords applied not only to the MySQL password, but to the admin password too.
So I replaced the encrypted admin password with the plain text, thinking it would work. Nope. I am still getting the same message about invalid password.
How do I get my server back up?

Some things in the INI file and the dialog for DB connections, that comes up after the error message, do not make sense.
For instance, no matter what I enter in there: localhost, or the IP, or the host name, the INI only saves localhost.
And by the way, I just uninstalled, reinstalled and configured the DB, but now I am also seeing line #2 in the error message, about the RPC server unavailable.
What can be so horribly wrong in this simple INI file, that out of several softwares, only hMailServer absolutely cannot log into this DB?
I can log in from any host on the network, using any number of different SQL clients (MySQL workbench, PHPMyAdmin, Squirrel SQL) but hMailServer cannot log in. Why? Any ideas?
Last edited by DrmCa on 2018-12-22 04:30, edited 1 time in total.

User avatar
Dravion
Senior user
Senior user
Posts: 1334
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Persistently getting "Access denied" despite correct everything

Post by Dravion » 2018-12-22 04:21

Set the Administrator password empty (just leave it blank) and login to hMailAdmin without a password
and in hMailAdmin set a new Adminstrator Password again.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-22 04:32

Did that.

"The specified user name or password is incorrect"

and then it prompts for the admin password.
And if I press Cancel, it takes me back to the DB connection dialog.

But strangely, the server seems to be up and running! I just got an email, but still cannot log into the admin UI.

User avatar
Dravion
Senior user
Senior user
Posts: 1334
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Persistently getting "Access denied" despite correct everything

Post by Dravion » 2018-12-22 05:02

Ok, follow this tutorial to reset your Admin password
viewtopic.php?f=21&t=31490
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

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

Re: Persistently getting "Access denied" despite correct everything

Post by mattg » 2018-12-22 05:17

where is your hmailserver.ini located?
Can you please show the contents of it (with passwords removed)

What version of hMailserver?
What Version of MySQL?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-22 16:09

Solved those one, thanks for the tip about the blank admin password!
Once I used the combination of:
1. The "administrator" user name in the connection dialog (which I was mistaking for the DB connection and provided the DB password), and
2. The IP address in the INI file (localhost did not work)
the server came up w/o errors and I logged into the admin UI. So far so good, but!

One question: is there a way to return to using the encrypted DB password?

Also, there is a problem and a minor annoyance:

The problem is that SSL no longer works. It almost feels like the server is no longer listening on port 995 (Thunderbirds says no messages, error connecting to the server, it refused connection)
Last night I was getting these errors in the log:

Code: Select all

"ERROR"	5836	"2018-12-21 21:34:46.157"	"Severity: 2 (High), Code: HM5113, Source: SslContextInitializer::InitServer, Description: Failed to load certificate file. Path: D:\Program Files\Apache Software Foundation\Apache24\conf\ssl.crt\mydomain.crt, Address: 0.0.0.0, Port: 995, Error: use_certificate_file: No such process"
But since late last night I am not getting them, after simply re-entering the same path.

And the annoyance is that every time I start the admin UI, it first alerts of invalid password, then pops up the password dialog.

User avatar
Dravion
Senior user
Senior user
Posts: 1334
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Persistently getting "Access denied" despite correct everything

Post by Dravion » 2018-12-22 17:30

In hMailAdmin, you can setup a new Administrator password.

If your Pop3 SSL certificates has trouble,
delete it from the SSL-Section in hMailadmin
and set it up new, a reasign it to,port 110.
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-22 18:55

Dravion wrote:
2018-12-22 17:30
In hMailAdmin, you can setup a new Administrator password.
I know. I did that. When I set up a new password, I get this annoying popup about the wrong password. Then I click Ok, get the regular password prompt, enter the new password, and it logs me in. What am I missing?
If your Pop3 SSL certificates has trouble,
delete it from the SSL-Section in hMailadmin
and set it up new, a reasign it to,port 110.
This is sounding a bit cryptic to me. First of all, I do not want SSL on port 110, as I have clients, who can only connect over 110 in plain text.
I want SSL to be on port 995.
What do you mean, delete it? There is a path to the cert, and that cert is shared among all services for this domain - Apache, jabber server, and several others including hMailServer. Only hMailServer is having a problem with it. So what exactly does it mean - delete and set up new?

User avatar
Dravion
Senior user
Senior user
Posts: 1334
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Persistently getting "Access denied" despite correct everything

Post by Dravion » 2018-12-22 20:04

You have an SSL Error for Port 995 and Port 995 is encrypted POP3

You dont need to look for Port 110 if your Problem is 995
64-Bit builds of hMailserver

hMailServer-5.6.+ (HCD) https://github.com/hMailServer-ComDevs/hmailserver
hMailServer-5.6.+ (LTS) https://github.com/Dravion/hMailServer/releases

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-22 23:48

Cool! But what should I do if I have an SSL error on port 995?
I had to tell all users to temporarily switch off SSL for POP and SMTP, how do I troubleshoot to allow them to turn this back on?
So far, when I am trying to log in, connection is refused on 995. I only restored the DB, the certs and keys are the same for more than a year.

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

Re: Persistently getting "Access denied" despite correct everything

Post by mattg » 2018-12-23 05:45

DrmCa wrote:
2018-12-22 18:55
When I set up a new password, I get this annoying popup about the wrong password. Then I click Ok, get the regular password prompt, enter the new password, and it logs me in. What am I missing?
That the wrong password is saved.
press cancel on the first messagebox, then a 'connect' dialogue appears, select localhost and press edit
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: 19810
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Persistently getting "Access denied" despite correct everything

Post by mattg » 2018-12-23 05:46

DrmCa wrote:
2018-12-22 23:48
Cool! But what should I do if I have an SSL error on port 995?
I had to tell all users to temporarily switch off SSL for POP and SMTP, how do I troubleshoot to allow them to turn this back on?
So far, when I am trying to log in, connection is refused on 995. I only restored the DB, the certs and keys are the same for more than a year.
Run this and post the results
http://www.hmailserver.com/forum/viewto ... 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

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2018-12-25 03:01

This is what I am getting:
Image

Am I missing any software to be installed?

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

Re: Persistently getting "Access denied" despite correct everything

Post by jimimaseye » 2018-12-25 10:20

Wrong password. You need the administrator password.

[Entered by mobile. Excuse my spelling.]

It's Christmas!
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

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2019-01-15 02:48

Right. Sounds like my admin password was left blank since I started getting the popup about it being invalid every time I opened the admin UI. I set it to some value, and here is the file.
Attachments
z.zip
diags
(3.25 KiB) Downloaded 18 times

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

Re: Persistently getting "Access denied" despite correct everything

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

What is your current issue?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2019-01-17 04:36

The problem is the SSL error from the post on 2018-12-22 09:09

Code: Select all

"ERROR"	5836	"2018-12-21 21:34:46.157"	"Severity: 2 (High), Code: HM5113, Source: SslContextInitializer::InitServer, Description: Failed to load certificate file. Path: D:\Program Files\Apache Software Foundation\Apache24\conf\ssl.crt\mydomain.crt, Address: 0.0.0.0, Port: 995, Error: use_certificate_file: No such process"

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

Re: Persistently getting "Access denied" despite correct everything

Post by mattg » 2019-01-17 08:23

right

so the user that the hMailserver SERVICE runs under doesn't have access to that file

Is D drive a mapped network drive or a local drive?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

DrmCa
Normal user
Normal user
Posts: 74
Joined: 2011-02-14 21:30

Re: Persistently getting "Access denied" despite correct everything

Post by DrmCa » 2019-01-19 15:22

Genius! Thanks a lot, Matt!

POP3 worked right away, but then Thunderbird threw me to a loop, as when switching connection security on POP it changes 110 to 995, but when on SMTP it leaves it at 25 and for a while I was staring at the progress bar when sending. Then realized that, switched 25 to 465, and it is working.

Post Reply