Error 7760 / HM4406 - Could not read the message header, since the file was not available

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
Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-08 13:12

Ladies and Gents,

First of all thank you for looking at this. I have seached through the forums for an answer and not found one that answers this specifically. I have also searched through the documentation and not found anything. If I've missed something obvious then please point me in the right direction

I'm looking for a little assistance in that I am getting the above error message on 7 files that aren't in my data folder

Ideally I just want a method of telling HMS that those files are permanently gone and not to generate error messages for them

I have tried the DataDirectorySynchronizer (I was pretty sure that was only desaigned to add files to the database but thought it worth a shot anyway) but I am getting this error message for the same 7 files repeatedly, filling up an error log


Backrground:

My server got infected with ransomeware over Easter, probably a vulverability in a WordPress plugin - JetPack

Thankfully I have daily backups of the database and data folders (along with much else) to a cloud based service so had all my data

I reinstalled my server from bare-bones but as things had moved on a little from my original setup of the server a few years back I took the opportunity of installing the latest software etc. I am now running:

1and1/Ionos cloud server
Windows 2019 OS
MYSQL v8
HMS latest v5.6.7
ClamwWin plus SaneSecurity
SpamAssassin

My problem came from not realising how embedded Windows Defender was with Microsoft's newer OS and it took a few days before I realised there was a well hidden file scan going on at 3:05am each day and Windows Defender was being a bit over zealous in removing some files (I had disabled the realtime protection from Windows Defender when I installed ClamWin and added in exceptions for .eml files and the location hosting the data folder). I have now found and removed the scheduled scan task for Windows Defender

In short, Windows Defender removed these 7 files and I can't get them back. Missing those 7 files from 177k is fine with me but I do want to stop HMS generating repeating error messages

Is these any way to stop this?

Thank you for any assistance

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-08 13:14

Do you get a file path with the error message?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-08 14:41

mattg wrote:
2019-05-08 13:14
Do you get a file path with the error message?
Yes I do

The .eml files do not exist at that location, hence the error messages

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-09 00:15

Actually no, a different thing would occur if the message didn't exist - A new dummy message would be created

This error specifically say that the message exists, just that it is not available (presumably because it is quarantined by the AV)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-09 14:23

Thanks for your assistance on this Matt, it is much appreciated

I've double checked and none of the 7 files exist in the Data folder

I've gone through each subfolder line by line to make sure they weren't just in an odd order and the referenced files are not threre at all

e.g.

"ERROR" 8876 "2019-05-09 07:59:08.160" "Severity: 3 (Medium), Code: HM4403, Source: Message::GetHeader, Description: Could not read the message header, since the file was not available. File: C:\.....\Data\.....\john\26\{26005202-1496-44BF-BA14-21C6FB4B9594}.eml"

I have gone through the \26 subfolder individiual line by line (search and indexing seem to get a little confused with these file names) and there is no match. I've repeated the exercise for all 7 files and there is no .eml file for any of them

Different times I get slightly different error messages. All say HM4403 and the line as above but the error message at the beginning of the string can be 7760, 8876, 5792 etc

Any thoughts?

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-10 00:26

Can you create an empty file named exactly that at each specific location, and the restart the machine, to see if that makes a difference
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
Dravion
Senior user
Senior user
Posts: 1466
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Dravion » 2019-05-10 07:00

You also can stop hMailServer, login into your DB and delete the orphaned DB Records yourself

For example like this:

DELETE FROM
'hmailserver'.'hm_messages'
WHERE
messagefilename like '{8F79335E-A0A3-4B0A-9099-6F802E6737D0}.eml'

After this, restart hMailServer, the Error should be gone.

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by RvdH » 2019-05-10 09:01

Dravion wrote:
2019-05-10 07:00
You also can stop hMailServer, login into your DB and delete the orphaned DB Records yourself

For example like this:

DELETE FROM
'hmailserver'.'hm_messages'
WHERE
messagefilename like '{8F79335E-A0A3-4B0A-9099-6F802E6737D0}.eml'

After this, restart hMailServer, the Error should be gone.
And what about references to such messages in 'hm_message_metadata'?
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: 20222
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-10 09:13

Remember that officially, we don't support direct database manipulation.
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
Dravion
Senior user
Senior user
Posts: 1466
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Dravion » 2019-05-10 09:59

RvdH wrote:
2019-05-10 09:01

And what about references to such messages in 'hm_message_metadata'?
Can be ignored in this case.
The Log Errors will only triggered by the Master Record.

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by RvdH » 2019-05-10 11:22

That leaves orphaned data, that really is not the best practice...but as Matt already pointed out, it is not recommended to alter database directly in the first place
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

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-11 12:12

Thanks for your advice Matt, this seems to have fixed the issue

I had thought about whether I would have to edit the database directly but am glad I asked on here before doing so

Thank you again, very much :)

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-17 12:02

Latest update is that the kind suggestions haven't quite solved the issue

I had followed MattG's suggestion of putting blank txt files in place but I had the following error message a couple of days later

ERROR" 2752 "2019-05-17 07:46:52.877" "Severity: 3 (Medium), Code: HM5042, Source: File::ReadTextFile, Description: An unknown error occurred while reading a text file from disk."
"ERROR" 2752 "2019-05-17 07:46:52.892" "Severity: 3 (Medium), Code: HM4218, Source: MessageData::LoadFromMessage, Description: An unknown error occurred while loading message. File: C:\OneDrive\....john\26\{26005202-1496-44BF-BA14-21C6FB4B9594}.eml. Backuped to: C:\OneDrive\.......\Logs\Problematic messages\{26005202-1496-44BF-BA14-21C6FB4B9594}.eml"

HMS created a folder in the logs folder "Problematic MEssages" and moved the zero size txt files there

I thought it might be a one-off process but I got lots of similar error messages this morning, so the check is not frequest but approx every 3 days

I'm loath the edit the database directly as I am very wary of any unexpected consequences

Everything else on the system is working great, just these errors

Any thoughts as to what to try next?

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Dravion » 2019-05-17 13:16

Maybe you just shouldnt save your hMailServer Data files into a Clouddrive folder....

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-17 14:45

Dravion wrote:
2019-05-17 13:16
Maybe you just shouldnt save your hMailServer Data files into a Clouddrive folder....
That's never been a problem and it means if the system goes down I have all the messages not just the ones from the latest backup time

Benn running that way for a year plus so that bit I'm happy with. Also witht he logs going striaght to cloud, mysqlpump files going there, that all works

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Dravion » 2019-05-17 17:29

Unknown Error at loading a EML Message file isnt verry detailed. Could be a Filesystem ord Harddisk issue, a faulty RAM Module or a interfering process like AV-Software.

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-18 16:49

Dravion,

Thank you for the response. As per the original post I know why the 7 e-mail files were deleted, and that's not a problem

What I am looking to do is stop HMS from flagging them up as missing as an error log, preferably without editing anything in the database

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-19 02:47

Perhaps next step is to copy a known message to each of the seven locations
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
nitro
Normal user
Normal user
Posts: 31
Joined: 2018-11-08 16:31
Location: Spain

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by nitro » 2019-05-20 11:54

Does the Data Directory Synchronizer application not work?
Maybe it is the best solution for this problem.
I have used it once and I have obtained good results.

Image
Image
Production 5.6.8-B2437.20_OpenSSL_1.0.2s W.Server 2016 Datace [2x Intel Xeon E5-2660 8GB RAM]
Staging 5.7-B2490 W.Server 2008 R2 Stand [Intel Pentium 4 4GB RAM]

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-20 13:10

Good thought...but OP has tried that without success
Gordonh1970 wrote:
2019-05-08 13:12
I have tried the DataDirectorySynchronizer (I was pretty sure that was only desaigned to add files to the database but thought it worth a shot anyway) but I am getting this error message for the same 7 files repeatedly, filling up an error 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

User avatar
nitro
Normal user
Normal user
Posts: 31
Joined: 2018-11-08 16:31
Location: Spain

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by nitro » 2019-05-20 13:14

Sorry, the problem of reading diagonally. :oops:
Production 5.6.8-B2437.20_OpenSSL_1.0.2s W.Server 2016 Datace [2x Intel Xeon E5-2660 8GB RAM]
Staging 5.7-B2490 W.Server 2008 R2 Stand [Intel Pentium 4 4GB RAM]

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

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by mattg » 2019-05-20 13:15

no stress

like I said, good thought.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Gordonh1970
Normal user
Normal user
Posts: 42
Joined: 2016-01-29 13:50
Location: UK
Contact:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Post by Gordonh1970 » 2019-05-29 18:22

mattg wrote:
2019-05-19 02:47
Perhaps next step is to copy a known message to each of the seven locations
Well its been 5 days since I tried this and no error messages so I suppsed I can count on that being fixed

Thank you all for your help and suggestions

Post Reply