PDF Attachments getting corrupted

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
sri_elgora
New user
New user
Posts: 12
Joined: 2024-10-01 13:24

PDF Attachments getting corrupted

Post by sri_elgora » 2024-11-06 18:05

Hello,

I have a sporadic issue with hMailserver when receiving mails with PDF Attachments, the file is corrupted.

Example:
I'm sending an internal email (no other mailservers involved)
In the EML-File I can see the attachment is split into two parts
The IMAP-Client only receives the first part of the attachment.
We have Outlook 2021 and RoundCubeMail 1.6.8.
The attachment is corrupted in both clients.
hMailserver version is 5.7.0-B2643.17
Possibly the issue came with the upgrade from 5.6.8 to 5.7.0 (I upgraded because of the iOS Mail bug)

Here is an example snippet of the EML-File
Please notice the unusual signs at the end of the first part.
When I copy both parts together manually, I get the complete file.

I can send the original EML-File if someone is interested, please send a DM

Code: Select all

...
SCAgICAgICAgICAgICAgICAgICAgICAgICAgUvxja2dhYmUgOiAwLzAvWlIvNDAxNDYwMikgVGoK
MCAtMTEgVGQgKCkgVGoKMCAtMTEgVGQgKCkgVGoKMCAtMTEgVGQgKCAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGllZmVyYW50ZW4tTnIuOiAgVklLTzAx
KSBUagowIC0xMSBUZCAoICAgICAgICAgIEJSVUNLTkVSU1RSQd9FIDQzICAgICAgICAgICAgICAg
ICAgICAgICBEYXR1bSAgICAgICAgICA6ICAwNi4xMS4yMDI0KSBUagowIC0xMSBUZCAoICAgICAg
ICAgIDU2NTY2IE5FVVdJRUQgICAgICAgICAgICAgICAgICAgICAgICAgICBTZWl0ZSAgICAgICAg
ICA6ICAgIDEpIFRqCjAgLTExIFRkICggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIEtkLi1Oci4gICAgICAgIDogIDIwMDkzMDMpIFRqCjAgLTExIFRkICgg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVpbmthdWZz
di4gICAgIDogIE5PUkRXRVNUKSBUagowIC0xMSBUZCAoICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICBNaXRnbGllZHNuci4gICA6ICA3NzY4KSBUagowIC0x
MSBUZCAoKSBUagowIC0xMSBUZCAoKSBUagowIC0xMSBUZCAoICAgICAgICAgIEVpbmthZXVmZXIg
ICAgIDogTWFyaWEgTml0c2Noa2UgICAgICBUZWw6IDAzMzAxIDg1OTMyMCkgVGoKMCAtMTEgVGQg
KCAgICAgICAgICBNYWlsICAgICAgICAgICA6IGVpbmthdWZAZWxnb3JhLmRlKSBUagowIC0xMSBU
ZCAoICAgICAgICAgIExpZWZlcnRlcm1pbiAgIDogMDYuMTEuMjAyNCkgVGoKMCAtMTEgVGQgKCAg
ICAgICAgICBLb21taXNzaW9uICAgICA6IEExIDQ0NjkyMTUvNDQ5NDY3Ni8tKSBUagowIC0xMSBU
ZCAoICAgICAgICAgIExpZWZlcmFuc2NocmlmdDogRSBMIEcgTyBSIEEgIGUuRy4pIFRqCjAgLTEx
IFRkICggICAgICAgICAgICAgICAgICAgICAgICAgICBSZWtsYW1hdGlvbmVuIC8gU3BlcnJsYWdl
cikgVGoKMCAtMTEgVGQgKCAgICAgICAgICAgICAgICAgICAgICAgICAgIEFuIGRlbiBE/G5lbi CAg
ICAg‰X S P‹G  P(pˆG  bGUgV0tNKSBUag
--nextPart5064.882352941176471--
A2
KSBUagowIC0xMSBUZCAoICAgICAgICAgICAgICAgICAgICAgICAgICAgMTY1MTUgT3JhbmllbmJ1
cmcpIFRqCjAgLTExIFRkICggICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0pIFRqCjAg
LTExIFRkICggICAgICAgICAgUG9zLiAgIEFydG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gbiAKMDAwMDA4NDA1MyAwMDAwMCBuIAowMDAwMDg0MTI1
IDAwMDAwIG4gCjAwMDAwODQzNTggMDAwMDAgbiAKMDAwMDA4NDE4NiAwMDAwMCBuIAowMDAwMDg0
MjE2IDAwMDAwIG4gCjAwMDAwODQ1ODEgMDAwMDAgbiAKdHJhaWxlcgoKPDwKL1Jvb3QgMjQgMCBS
Ci9TaXplIDMwCj4+CnN0YXJ0eHJlZgo4NzI2MAolJUVPRgo=

--nextPart5064.882352941176471--
Hope someone has an idea.

Best regards

sri_elgora
New user
New user
Posts: 12
Joined: 2024-10-01 13:24

Re: PDF Attachments getting corrupted

Post by sri_elgora » 2024-11-07 11:39

Found this log entries for the exact message from above:

Code: Select all

"ERROR"	5192	"2024-11-06 08:33:58.771"	"Severity: 2 (High), Code: HM5049, Source: File::Normal, Description: Could not move the file C:\Program Files (x86)\hMailServer\Data\{86F8C6BA-6361-468C-A1D7-B142B5794C22}.eml.tmp to C:\Program Files (x86)\hMailServer\Data\{86F8C6BA-6361-468C-A1D7-B142B5794C22}.eml. Tried 5 times without success., Error code: 5, Message: Access is denied"
"APPLICATION"	5236	"2024-11-06 08:33:59.596"	"SMTPDeliverer - Message 5012818: Delivering message from xxxx@xxxx.xx to xxxx@xxxx.xx. File: C:\Program Files (x86)\hMailServer\Data\{86F8C6BA-6361-468C-A1D7-B142B5794C22}.eml"

sri_elgora
New user
New user
Posts: 12
Joined: 2024-10-01 13:24

Re: PDF Attachments getting corrupted

Post by sri_elgora » 2024-11-07 12:09

I found more tmp files in the data folder, since the exact date of the upgrade:

Image

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

Re: PDF Attachments getting corrupted

Post by RvdH » 2024-11-07 13:26

Don't know what you have been doing, but you can't simply upgrade from 5.6.8 (32-bit) to 5.7.0 (64-bit) without changings some things in your setup, like program and data and temp paths in hMailServer.ini

I doubt 64-bit hmailserver is installed in C:\Program Files (x86)\hMailServer, not? As it should be in C:\Program Files\hMailServer
Same with Data and Temp Paths, C:\Program Files (x86)\hMailServer\Data vs C:\Program Files\hMailServer\Data and C:\Program Files (x86)\hMailServer\Temp vs C:\Program Files\hMailServer\Temp

You probably made a mess, resulting in those 'Access is denied' errors
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

sri_elgora
New user
New user
Posts: 12
Joined: 2024-10-01 13:24

Re: PDF Attachments getting corrupted

Post by sri_elgora » 2024-11-07 14:51

I installed 5.7.0 with the installer, which checks for a previous installation and of cource it found one in C:\Program Files (x86), I didn't change it.
Then I copied over the latest binaries.

I will uninstall and reinstall in the correct location and move Data and Temp path to a location outside of Program Files.

Thanks for your time, I will give an update later.

infohmail
New user
New user
Posts: 19
Joined: 2015-03-11 14:47

Re: PDF Attachments getting corrupted

Post by infohmail » 2024-11-07 15:44

(5.7, 64bit, latest release). Sometime it's happens to me, but very rare. In our case I think it's linked to spamassasin (run on same hm machine) that doesn't complete the check in a timely fashion and this leave a .eml.tmp in \data folder. We don't care, because the email is still delivered (correctly) to the internal recipient.

sri_elgora
New user
New user
Posts: 12
Joined: 2024-10-01 13:24

Re: PDF Attachments getting corrupted

Post by sri_elgora » 2024-11-08 09:34

I uninstalled and installed hMailserver last night and have the same issues this morning:
Program Files are in C:\Program Files\hMailserver
Data, Events, Log Temp are in C:\hMailserver

Seems to me that another process is locking the file.
I will deactivate SpamAssassin and see if that helps, thanks for the hint.

Code: Select all

"ERROR"	5404	"2024-11-08 06:32:38.365"	"Severity: 3 (Medium), Code: HM4403, Source: PersistentMessage::LoadHeader, Description: Could not read the message header, since the file was not available. File: C:\hMailServer\Data\{23EFE161-C606-4827-9D03-9C04CF049DC6}.eml"
"ERROR"	5404	"2024-11-08 06:32:38.365"	"Severity: 3 (Medium), Code: HM4403, Source: PersistentMessage::LoadHeader, Description: Could not read the message header, since the file was not available. File: C:\hMailServer\Data\{23EFE161-C606-4827-9D03-9C04CF049DC6}.eml"
"ERROR"	5404	"2024-11-08 06:32:39.397"	"Severity: 2 (High), Code: HM5049, Source: File::Normal, Description: Could not move the file C:\hMailServer\Data\{23EFE161-C606-4827-9D03-9C04CF049DC6}.eml.tmp to C:\hMailServer\Data\{23EFE161-C606-4827-9D03-9C04CF049DC6}.eml. Tried 5 times without success., Error code: 5, Message: Access is denied"
"ERROR"	5476	"2024-11-08 06:32:40.553"	"Severity: 3 (Medium), Code: HM4403, Source: PersistentMessage::LoadHeader, Description: Could not read the message header, since the file was not available. File: C:\hMailServer\Data\{23EFE161-C606-4827-9D03-9C04CF049DC6}.eml"
"APPLICATION"	5476	"2024-11-08 06:32:40.553"	"SMTPDeliverer - Message 5019599: Delivering message from <Empty> to xxx@xxx.de. File: C:\hMailServer\Data\{23EFE161-C606-4827-9D03-9C04CF049DC6}.eml"

Post Reply