hmail sending mail with an = every 76 charachters

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
bberndt
New user
New user
Posts: 6
Joined: 2012-12-12 18:40

hmail sending mail with an = every 76 charachters

Post by bberndt » 2012-12-12 18:57

Our company has a Java based web application that generates its own email notifications, based on what any given user does in the app. Currently the app only supports sending to a straight SMTP server, no authentication, no SSL is supported.

In the case where SSl and or authentication is needed, hMailServer makes a great 'bridge'. I set up a local SMTP service, that then forwards to the client's authenticated SMTP server.

This normally seems to work great.

Until now. I have a client, where all of the notifications are getting received with a '=' every 76 charachters, and then it wraps the message. With this '=' in there, the HTML code can't be rendered, and it looks like this:

<html><head><meta http-equiv=3D"Content-Language" content=3D"en-us"><meta ht=
tp-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindows-1252"><met=
a name=3D"GENERATOR" content=3D"Microsoft FrontPage 5.0"><meta name=3D"ProgI=
d" content=3D"FrontPage.Editor.Document"><title>Field Trip Information</titl=
e></head><body><p align=3D"left"><b>Transportation Department<br></b></p><p>=
<i>Dear</i>&nbsp;ldunlap:<br><br>This is an automatic email notification gen=
erated by Field Trip to notify you that the status of the trip you requested=
has changed from&nbsp;Active to Cancelled.</p><table border=3D"0" width=3D"=
100%" cellspacing=3D"0" cellpadding=3D"0"> <tr> <td width=3D"100%"> =
<hr color=3D"#AA0000"> </td> </tr> <tr> <td width=3D"100%"> <p=
align=3D"center"><font face=3D"Tahoma" size=3D"5" color=3D"#AA0000"><b>Fiel=
d Trip Information</b></font></td> </tr> <tr> <td width=3D"100%"> =
<hr color=3D"#AA0000"> </td> </tr></table><div align=3D"center"> <=

Is there any possible that this is the fault of hMailServer? If not, any idea how it could be corrected? The same notifications work fine on other servers that send directly to other clients' real mail server, etc.

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

Re: hmail sending mail with an = every 76 charachters

Post by mattg » 2012-12-13 04:02

in hMailserver Admin GUI

Settings >> Protocols >> SMTP >> RFC Compliance

do you have the 'allow incorrectly formatted line endings' checked?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: hmail sending mail with an = every 76 charachters

Post by Bill48105 » 2012-12-13 04:06

If matt's suggestion doesn't help it'd help if we could see a copy of the raw EML file. Zip it & post or PM. Can email it to me as well if that works best. It's my nick @hmailserver.com. Let me know if you email me though I don't check that box too often. (IOW unless I'm expecting something)
Thx
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

bberndt
New user
New user
Posts: 6
Joined: 2012-12-12 18:40

Re: hmail sending mail with an = every 76 charachters

Post by bberndt » 2012-12-13 18:42

Yes, 'allow incorrectly formatted line endings' is checked. Thats a default isn't it?

raw EML file? not sure what that is. From hmail's sql database? or just one of the offending emails that I received?

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: hmail sending mail with an = every 76 charachters

Post by dzekas » 2012-12-14 21:40

bberndt wrote:Yes, 'allow incorrectly formatted line endings' is checked. Thats a default isn't it?

raw EML file? not sure what that is. From hmail's sql database? or just one of the offending emails that I received?
hMailServer is not 8BITMIME aware. It should not add = to emails. How many other SMTP servers you have in email route?

There is nothing wrong with

Code: Select all

<html><head><meta http-equiv=3D"Content-Language" content=3D"en-us"><meta ht=
tp-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindows-1252"><met=
in email body

bberndt
New user
New user
Posts: 6
Joined: 2012-12-12 18:40

Re: hmail sending mail with an = every 76 charachters

Post by bberndt » 2012-12-14 21:45

dzekas wrote:
bberndt wrote:Yes, 'allow incorrectly formatted line endings' is checked. Thats a default isn't it?

raw EML file? not sure what that is. From hmail's sql database? or just one of the offending emails that I received?
hMailServer is not 8BITMIME aware. It should not add = to emails. How many other SMTP servers you have in email route?

There is nothing wrong with

Code: Select all

<html><head><meta http-equiv=3D"Content-Language" content=3D"en-us"><meta ht=
tp-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindows-1252"><met=
in email body
Well, Im fairly convinced that hMailServer isn't implicated. I momtarily redirected these notifications emails from the web app to our own official email server, and the email came in, in NOT rendered HTML, Not sure whats causing this, but its probably not hMail.

I've tried on different occasions to circumvent each link in the chain and the problem still exists when the web app sends directly to my real smtp server. I have to assume that the web app is at fault, but the programmer say no, and it in fact does work fine in all other installations...

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: hmail sending mail with an = every 76 charachters

Post by dzekas » 2012-12-14 21:51

bberndt wrote:I've tried on different occasions to circumvent each link in the chain and the problem still exists when the web app sends directly to my real smtp server. I have to assume that the web app is at fault, but the programmer say no, and it in fact does work fine in all other installations...
Conversion is done by other SMTP server, but you should have at least two other servers in your email route to trigger this conversion. Or at least one email server, which bounces email back to hmailserver.

User avatar
Conzi
Normal user
Normal user
Posts: 140
Joined: 2006-02-24 14:44
Location: Varese, Italy

Re: hmail sending mail with an = every 76 charachters

Post by Conzi » 2012-12-15 13:05

I had same problem with the e-mail sent by codeigniter, a php framework.
The bug was in codeigniter, hmail was "neutral" and did not change the email.

solutions: we routed the e-mail through a postfix mta (postfix "fix" the problem". add CR+LF at the end of the line instead only LF)

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: hmail sending mail with an = every 76 charachters

Post by Bill48105 » 2012-12-19 01:14

What happens if you uncheck the RFC compliance line endings box? Does hmail reject the emails?

If the problem is the way the client is sending it wouldn't be too hard to make a script to convert the line-endings.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: hmail sending mail with an = every 76 charachters

Post by dzekas » 2012-12-19 09:44

Bill48105 wrote:If the problem is the way the client is sending it wouldn't be too hard to make a script to convert the line-endings.
Bill
user posted message body in quoted printable format. there is nothing wrong about it or I missed some QP line ending specifics.

bberndt
New user
New user
Posts: 6
Joined: 2012-12-12 18:40

Re: hmail sending mail with an = every 76 charachters

Post by bberndt » 2012-12-19 17:57

My hunch is that its the web app doing it, not hMail. The developers are working on a SSL / Authentication support so I don't have to rely on hMail, as greats as it is, in this instance. Once that works for the users of this web app, then all that is left to blame is the web app. :)

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: hmail sending mail with an = every 76 charachters

Post by Bill48105 » 2012-12-19 19:16

bberndt wrote:My hunch is that its the web app doing it, not hMail. The developers are working on a SSL / Authentication support so I don't have to rely on hMail, as greats as it is, in this instance. Once that works for the users of this web app, then all that is left to blame is the web app. :)
Yeah sounds like it's the web app which should be fixed but was trying to get you a solution. ;) hmail's scripting is quite powerful & fixing the line-endings should be possible if needed. Obviously get the app fixed ideally though.
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: hmail sending mail with an = every 76 charachters

Post by dzekas » 2012-12-19 20:20

Code: Select all

tomas@orphne:~$ php check_qp_decode.php 
<html><head><meta http-equiv="Content-Language" content="en-us"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>Field Trip Information</title></head><body><p align="left"><b>Transportation Department<br></b></p><p><i>Dear</i>&nbsp;ldunlap:<br><br>This is an automatic email notification generated by Field Trip to notify you that the status of the trip you requestedhas changed from&nbsp;Active to Cancelled.</p><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%"> <hr color="#AA0000"> </td> </tr> <tr> <td width="100%"> <palign="center"><font face="Tahoma" size="5" color="#AA0000"><b>Field Trip Information</b></font></td> </tr> <tr> <td width="100%"> <hr color="#AA0000"> </td> </tr></table><div align="center"> <tomas@orphne:~$
Like I said there is nothing wrong with your message body based on information provided by you. Although you never showed us your message headers and user can see those = in email program, if header is not set correctly. Other possible issue is "requestedhas", but it can be either encoder error or typo in notification text or email encoding corruption which happened when you pasted text in forum or when I fed it to PHP quoted_printable_decode() function.

bberndt
New user
New user
Posts: 6
Joined: 2012-12-12 18:40

Re: hmail sending mail with an = every 76 charachters

Post by bberndt » 2013-02-20 20:45

I think we've finally found the cause of the problem. In both cases, when out web app kicks out an email, as well as an email from another of our Windows native applications, the header is truncated right after the Message ID. i.e. the From: line is missing, the to: line is missing, as well as, and more importantly, the Content-Type= line is missing.

Looks like hMailServer is adding a Content-Type=text/plain to the header, and then the end mail client views it just as that, plain text, regardless of what it is; either the HTML source from the web app, or Base64 from the Widnows native app (sending an attachment).

Any idea on how this header is getting messed with before hMailServer get it, from the app sending on the same physical server?

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: hmail sending mail with an = every 76 charachters

Post by Bill48105 » 2013-02-20 22:50

I highly doubt hmail is modifying the content type header or truncating those headers.. Sure hmail adds some headers but normally hmail does not modify the content. The exceptions are attachment stripping, AV attachment removal & server side signature addition but otherwise it should pass emails on as they were received. Do you use any of those things? Understand that if the email arrives corrupted it's likely it'll just get more corrupt as it passes if the issues is in the headers. Have you tried a normal email client like outlook or thunderbird vs your custom senders?
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

bberndt
New user
New user
Posts: 6
Joined: 2012-12-12 18:40

Re: hmail sending mail with an = every 76 charachters

Post by bberndt » 2013-02-20 23:30

Yes, I believe that emails sent with a mail client to hmailserver come out fine.

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: hmail sending mail with an = every 76 charachters

Post by Bill48105 » 2013-02-20 23:52

bberndt wrote:Yes, I believe that emails sent with a mail client to hmailserver come out fine.
I'd confirm by doing some tests. It'll be tough to see the raw data sent from your sending tools but you could get very close with 5.4 archiving or a script version for earlier versions can save copies of the raw EML as it is received before hmail makes any changes: http://www.hmailserver.com/forum/viewto ... 20&t=22909
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Post Reply