modified CSS clases in HEAD when saving incoming message

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
lubosdz
New user
New user
Posts: 3
Joined: 2011-06-05 14:09

modified CSS clases in HEAD when saving incoming message

Post by lubosdz » 2011-06-05 14:25

Hi guys,

i experience strange behaviour of hMailServer. On delivery it saves received message without [.my-css-class] without leading dot, like [my-css-class].
Does anyone experience such a modification?

Example - this is message sent out by PHPMailer via sendmail for windows:
(I can see in sendmail logs that CSS class dots are included in message sent to hMailServer)

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Some title</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style type="text/css">
body{
	font-family: tahoma, arial;
	font-size: 12px;
	margin: 0 auto;
	color: #666666;
}
.mail-header{
	font-size: 18px;
	padding: 10px; 
	border-bottom: 5px solid orange;
	border-top: 5px solid red;
	background-color: #FDE8BD;
}
</style>
</head>
<body>
<div class="mail-header">
   this content will not be styled.
</div>
</body>
</html>
When I find saved message in hMailServer /data/... directory, I would find it without those CSS class dots.
Result is, that hMailServer will post such a modified eml file to e.g. Outlook mail client, which cannot apply CSS class styles.

Outlook will receive misformated message body (HTML multipart):

Code: Select all

...
mail-header{
	font-size: 18px;
	padding: 10px; 
	border-bottom: 5px solid orange;
	border-top: 5px solid red;
	background-color: #FDE8BD;
}
...
I changed all .css-classes to ID like #css-classes, and then it worked OK.

I am using default settings, no DKIM signing, nothing special that would assume any message modification.

Any ideas..?

I am using newest hMailServer 5.3.3 B1879.

Thanx

Lubos

^DooM^
Site Admin
Posts: 13862
Joined: 2005-07-29 16:18
Location: UK

Re: modified CSS clases in HEAD when saving incoming message

Post by ^DooM^ » 2011-06-05 14:49

hMail does not mess with message contents unless you are using some form of script to manipulate contents. I send out emails with .css classes and they send / receive just fine.

Do you have antivirus / spam assassin / assp / SMTP filtering on the router?

Please send an email to doom@damnation.org.uk I will check the html when it arrives to see if the .css is missing
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

lubosdz
New user
New user
Posts: 3
Joined: 2011-06-05 14:09

Re: modified CSS clases in HEAD when saving incoming message

Post by lubosdz » 2011-06-05 19:33

Hi,

I have sent email with log attachments to you.
I did some more tests and it looks like the DOT character will be removed only if it is a first character on new line.

This will work OK:

Code: Select all

     .some test (leading space)
This will have dot removed:

Code: Select all

.some test
and will be stored on hMailServer as:

Code: Select all

some test (without dot)
Please see logs if this is sendmail or hMailServer issue.

Cheers
Lubos

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

Re: modified CSS clases in HEAD when saving incoming message

Post by dzekas » 2011-06-05 20:06

lubosdz wrote:Hi,

I have sent email with log attachments to you.
I did some more tests and it looks like the DOT character will be removed only if it is a first character on new line.

This will work OK:

Code: Select all

     .some test (leading space)
This will have dot removed:

Code: Select all

.some test
and will be stored on hMailServer as:

Code: Select all

some test (without dot)
Please see logs if this is sendmail or hMailServer issue.

Cheers
Lubos
Period at the beginning of the line needs special handing in POP3 and SMTP.

How are you sending it? It can be mailer problem and not email server problem.

Don't add style with headers. Use style parameter or basic html formatting. It will make your email more webmail friendly.

lubosdz
New user
New user
Posts: 3
Joined: 2011-06-05 14:09

Re: modified CSS clases in HEAD when saving incoming message

Post by lubosdz » 2011-06-05 20:57

How are you sending it? It can be mailer problem and not email server problem.
Don't add style with headers. Use style parameter or basic html formatting. It will make your email more webmail friendly.
I am not sure if following will help to resolve the issue...

sending via php mail() function:
====================================================
php.ini
====================================================

Code: Select all

[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25

; For Win32 only.
sendmail_from = wamp@localhost.localdomain

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = c:\wamp\bin\sendmail\sendmail.exe -t

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
====================================================
sendmail.ini
====================================================

Code: Select all

; configuration for fake sendmail

; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory.  (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.

; smtp_server=mail.mydomain.com
; smtp_server=c:\wamp\bin\sendmail\delivered-emails\
smtp_server=localhost.localdomain

; smtp port (normally 25)

smtp_port=25

; SMTPS (SSL) support
;   auto = use SSL for port 465, otherwise try to use TLS
;   ssl  = alway use SSL
;   tls  = always use TLS
;   none = never try to use SSL

smtp_ssl=auto

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

default_domain=localhost.localdomain

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

error_logfile=log/error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

debug_logfile=log/debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=test@localhost.localdomain
auth_password=admin

; if your smtp server uses pop3 before smtp authentication, modify the 
; following three lines.  do not enable unless it is required.

pop3_server=
pop3_username=
pop3_password=

; force the sender to always be the following email address
; this will only affect the "MAIL FROM" command, it won't modify 
; the "From: " header of the message content

force_sender=

; force the sender to always be the following email address
; this will only affect the "RCTP TO" command, it won't modify 
; the "To: " header of the message content

force_recipient=test@localhost.localdomain

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting.  you can manually set the ehlo/helo name if required

hostname=localhost.localdomain
====================================================
hMailServer - log
====================================================

Code: Select all

"DEBUG"	2324	"2011-06-05 19:03:06.716"	"Creating session 4"
"SMTPD"	2324	4	"2011-06-05 19:03:06.717"	"127.0.0.1"	"SENT: 220 localhost ESMTP"
"SMTPD"	2344	4	"2011-06-05 19:03:07.194"	"127.0.0.1"	"RECEIVED: EHLO localhost.localdomain"
"SMTPD"	2344	4	"2011-06-05 19:03:07.195"	"127.0.0.1"	"SENT: 250-localhost[nl]250-SIZE 20480000[nl]250 AUTH LOGIN"
"SMTPD"	2344	4	"2011-06-05 19:03:07.197"	"127.0.0.1"	"RECEIVED: AUTH LOGIN"
"SMTPD"	2344	4	"2011-06-05 19:03:07.198"	"127.0.0.1"	"SENT: 334 VXNlcm5hbWU6"
"SMTPD"	2364	4	"2011-06-05 19:03:07.200"	"127.0.0.1"	"RECEIVED: dGVzdEBsb2NhbGhvc3QubG9jYWxkb21haW4="
"SMTPD"	2364	4	"2011-06-05 19:03:07.201"	"127.0.0.1"	"SENT: 334 UGFzc3dvcmQ6"
"SMTPD"	2356	4	"2011-06-05 19:03:07.203"	"127.0.0.1"	"RECEIVED: ***"
"SMTPD"	2356	4	"2011-06-05 19:03:07.210"	"127.0.0.1"	"SENT: 235 authenticated."
"SMTPD"	2364	4	"2011-06-05 19:03:07.212"	"127.0.0.1"	"RECEIVED: MAIL FROM: <synet@synet.sk>"
"SMTPD"	2364	4	"2011-06-05 19:03:07.216"	"127.0.0.1"	"SENT: 250 OK"
"SMTPD"	2332	4	"2011-06-05 19:03:07.218"	"127.0.0.1"	"RECEIVED: RCPT TO: <test@localhost.localdomain>"
"SMTPD"	2332	4	"2011-06-05 19:03:07.219"	"127.0.0.1"	"SENT: 250 OK"
"SMTPD"	2332	4	"2011-06-05 19:03:07.221"	"127.0.0.1"	"RECEIVED: DATA"
"SMTPD"	2332	4	"2011-06-05 19:03:07.222"	"127.0.0.1"	"SENT: 354 OK, send."
"DEBUG"	2084	"2011-06-05 19:03:07.254"	"Saving message: C:\Program Files\hMailServer\Data\{FB0DBBE8-3102-48BA-BC1D-345831C653D4}.eml"
"DEBUG"	2084	"2011-06-05 19:03:07.280"	"Requesting SMTPDeliveryManager to start message delivery"
"SMTPD"	2084	4	"2011-06-05 19:03:07.281"	"127.0.0.1"	"SENT: 250 Queued (0.031 seconds)"
"SMTPD"	2308	4	"2011-06-05 19:03:07.284"	"127.0.0.1"	"RECEIVED: QUIT"
"SMTPD"	2308	4	"2011-06-05 19:03:07.285"	"127.0.0.1"	"SENT: 221 goodbye"
"DEBUG"	2316	"2011-06-05 19:03:07.286"	"Closing TCP/IP socket"
"DEBUG"	2316	"2011-06-05 19:03:07.287"	"Ending session 4"
"DEBUG"	2260	"2011-06-05 19:03:07.288"	"Delivering message..."
"APPLICATION"	2260	"2011-06-05 19:03:07.289"	"SMTPDeliverer - Message 23: Delivering message from synet@synet.sk to test@localhost.localdomain. File: C:\Program Files\hMailServer\Data\{FB0DBBE8-3102-48BA-BC1D-345831C653D4}.eml"
"DEBUG"	2260	"2011-06-05 19:03:07.292"	"Applying rules"
"DEBUG"	2260	"2011-06-05 19:03:07.293"	"Performing local delivery"
"DEBUG"	2260	"2011-06-05 19:03:07.300"	"Applying rules"
"DEBUG"	2260	"2011-06-05 19:03:07.305"	"Saving message: C:\Program Files\hMailServer\Data\localhost.localdomain\test\FB\{FB0DBBE8-3102-48BA-BC1D-345831C653D4}.eml"
"DEBUG"	2260	"2011-06-05 19:03:07.322"	"Local delivery completed"
"APPLICATION"	2260	"2011-06-05 19:03:07.323"	"SMTPDeliverer - Message 23: Message delivery thread completed."
"DEBUG"	2340	"2011-06-05 19:04:50.823"	"Creating session 5"
"POP3D"	2340	5	"2011-06-05 19:04:50.824"	"127.0.0.1"	"SENT: +OK POP3"
"POP3D"	2308	5	"2011-06-05 19:04:50.827"	"127.0.0.1"	"RECEIVED: AUTH "
"POP3D"	2308	5	"2011-06-05 19:04:50.827"	"127.0.0.1"	"SENT: -ERR Invalid command in current state."
"POP3D"	2360	5	"2011-06-05 19:04:50.830"	"127.0.0.1"	"RECEIVED: USER test@localhost.localdomain"
"POP3D"	2360	5	"2011-06-05 19:04:50.830"	"127.0.0.1"	"SENT: +OK Send your password"
"POP3D"	2360	5	"2011-06-05 19:04:50.832"	"127.0.0.1"	"RECEIVED: PASS ***"
"DEBUG"	2360	"2011-06-05 19:04:50.842"	"Reading message from database"
"POP3D"	2360	5	"2011-06-05 19:04:50.843"	"127.0.0.1"	"SENT: +OK Mailbox locked and ready"
"POP3D"	2312	5	"2011-06-05 19:04:50.846"	"127.0.0.1"	"RECEIVED: STAT"
"POP3D"	2312	5	"2011-06-05 19:04:50.847"	"127.0.0.1"	"SENT: +OK 1 1990"
"POP3D"	2360	5	"2011-06-05 19:04:50.849"	"127.0.0.1"	"RECEIVED: UIDL"
"POP3D"	2360	5	"2011-06-05 19:04:50.850"	"127.0.0.1"	"SENT: +OK 1 messages (1990 octets)[nl]1 22[nl]."
"POP3D"	2356	5	"2011-06-05 19:04:50.852"	"127.0.0.1"	"RECEIVED: LIST"
"POP3D"	2356	5	"2011-06-05 19:04:50.853"	"127.0.0.1"	"SENT: +OK 1 messages (1990 octets)"
"POP3D"	2356	5	"2011-06-05 19:04:50.854"	"127.0.0.1"	"SENT: 1 1990[nl]."
"POP3D"	2312	5	"2011-06-05 19:04:50.957"	"127.0.0.1"	"RECEIVED: RETR 1"
"POP3D"	2312	5	"2011-06-05 19:04:50.959"	"127.0.0.1"	"SENT: ."
"POP3D"	2328	5	"2011-06-05 19:04:51.653"	"127.0.0.1"	"RECEIVED: DELE 1"
"POP3D"	2328	5	"2011-06-05 19:04:51.653"	"127.0.0.1"	"SENT: +OK msg deleted"
"POP3D"	2332	5	"2011-06-05 19:04:51.874"	"127.0.0.1"	"RECEIVED: QUIT"
"DEBUG"	2332	"2011-06-05 19:04:51.875"	"Deleting message"
"DEBUG"	2332	"2011-06-05 19:04:51.876"	"Deleting message file"
"POP3D"	2332	5	"2011-06-05 19:04:51.878"	"127.0.0.1"	"SENT: +OK POP3 server saying goodbye..."
"DEBUG"	2308	"2011-06-05 19:04:51.879"	"Closing TCP/IP socket"
"DEBUG"	2308	"2011-06-05 19:04:51.880"	"Ending session 5"
"DEBUG"	2324	"2011-06-05 19:08:34.150"	"Creating session 6"
"SMTPD"	2324	6	"2011-06-05 19:08:34.151"	"127.0.0.1"	"SENT: 220 localhost ESMTP"
"SMTPD"	2332	6	"2011-06-05 19:08:34.628"	"127.0.0.1"	"RECEIVED: EHLO localhost.localdomain"
"SMTPD"	2332	6	"2011-06-05 19:08:34.629"	"127.0.0.1"	"SENT: 250-localhost[nl]250-SIZE 20480000[nl]250 AUTH LOGIN"
"SMTPD"	2364	6	"2011-06-05 19:08:34.632"	"127.0.0.1"	"RECEIVED: AUTH LOGIN"
"SMTPD"	2364	6	"2011-06-05 19:08:34.633"	"127.0.0.1"	"SENT: 334 VXNlcm5hbWU6"
"SMTPD"	2332	6	"2011-06-05 19:08:34.636"	"127.0.0.1"	"RECEIVED: dGVzdEBsb2NhbGhvc3QubG9jYWxkb21haW4="
"SMTPD"	2332	6	"2011-06-05 19:08:34.637"	"127.0.0.1"	"SENT: 334 UGFzc3dvcmQ6"
"SMTPD"	2340	6	"2011-06-05 19:08:34.639"	"127.0.0.1"	"RECEIVED: ***"
"SMTPD"	2340	6	"2011-06-05 19:08:34.645"	"127.0.0.1"	"SENT: 235 authenticated."
"SMTPD"	2332	6	"2011-06-05 19:08:34.648"	"127.0.0.1"	"RECEIVED: MAIL FROM: <synet@synet.sk>"
"SMTPD"	2332	6	"2011-06-05 19:08:34.652"	"127.0.0.1"	"SENT: 250 OK"
"SMTPD"	2316	6	"2011-06-05 19:08:34.655"	"127.0.0.1"	"RECEIVED: RCPT TO: <test@localhost.localdomain>"
"SMTPD"	2316	6	"2011-06-05 19:08:34.656"	"127.0.0.1"	"SENT: 250 OK"
"SMTPD"	2308	6	"2011-06-05 19:08:34.658"	"127.0.0.1"	"RECEIVED: DATA"
"SMTPD"	2308	6	"2011-06-05 19:08:34.660"	"127.0.0.1"	"SENT: 354 OK, send."
"DEBUG"	2084	"2011-06-05 19:08:34.715"	"Saving message: C:\Program Files\hMailServer\Data\{C46804C1-D4E1-4DB3-91CF-B3056203A847}.eml"
"DEBUG"	2084	"2011-06-05 19:08:34.720"	"Requesting SMTPDeliveryManager to start message delivery"
"SMTPD"	2084	6	"2011-06-05 19:08:34.721"	"127.0.0.1"	"SENT: 250 Queued (0.047 seconds)"
"SMTPD"	2364	6	"2011-06-05 19:08:34.723"	"127.0.0.1"	"RECEIVED: QUIT"
"SMTPD"	2364	6	"2011-06-05 19:08:34.726"	"127.0.0.1"	"SENT: 221 goodbye"
"DEBUG"	2260	"2011-06-05 19:08:34.727"	"Delivering message..."
"DEBUG"	2356	"2011-06-05 19:08:34.727"	"Closing TCP/IP socket"
"DEBUG"	2356	"2011-06-05 19:08:34.729"	"Ending session 6"
"APPLICATION"	2260	"2011-06-05 19:08:34.730"	"SMTPDeliverer - Message 24: Delivering message from synet@synet.sk to test@localhost.localdomain. File: C:\Program Files\hMailServer\Data\{C46804C1-D4E1-4DB3-91CF-B3056203A847}.eml"
"DEBUG"	2260	"2011-06-05 19:08:34.731"	"Applying rules"
"DEBUG"	2260	"2011-06-05 19:08:34.732"	"Performing local delivery"
"DEBUG"	2260	"2011-06-05 19:08:34.737"	"Applying rules"
"DEBUG"	2260	"2011-06-05 19:08:34.742"	"Saving message: C:\Program Files\hMailServer\Data\localhost.localdomain\test\C4\{C46804C1-D4E1-4DB3-91CF-B3056203A847}.eml"
"DEBUG"	2260	"2011-06-05 19:08:34.747"	"Local delivery completed"
"APPLICATION"	2260	"2011-06-05 19:08:34.748"	"SMTPDeliverer - Message 24: Message delivery thread completed."
"DEBUG"	2340	"2011-06-05 19:09:37.961"	"Creating session 7"
"POP3D"	2340	7	"2011-06-05 19:09:37.962"	"127.0.0.1"	"SENT: +OK POP3"
"POP3D"	2356	7	"2011-06-05 19:09:37.965"	"127.0.0.1"	"RECEIVED: AUTH "
"POP3D"	2356	7	"2011-06-05 19:09:37.966"	"127.0.0.1"	"SENT: -ERR Invalid command in current state."
"POP3D"	2364	7	"2011-06-05 19:09:37.969"	"127.0.0.1"	"RECEIVED: USER test@localhost.localdomain"
"POP3D"	2364	7	"2011-06-05 19:09:37.970"	"127.0.0.1"	"SENT: +OK Send your password"
"POP3D"	2340	7	"2011-06-05 19:09:37.973"	"127.0.0.1"	"RECEIVED: PASS ***"
"DEBUG"	2340	"2011-06-05 19:09:37.982"	"Reading message from database"
"POP3D"	2340	7	"2011-06-05 19:09:37.984"	"127.0.0.1"	"SENT: +OK Mailbox locked and ready"
"POP3D"	2348	7	"2011-06-05 19:09:37.987"	"127.0.0.1"	"RECEIVED: STAT"
"POP3D"	2348	7	"2011-06-05 19:09:37.988"	"127.0.0.1"	"SENT: +OK 1 2299"
"POP3D"	2364	7	"2011-06-05 19:09:37.991"	"127.0.0.1"	"RECEIVED: UIDL"
"POP3D"	2364	7	"2011-06-05 19:09:37.992"	"127.0.0.1"	"SENT: +OK 1 messages (2299 octets)[nl]1 23[nl]."
"POP3D"	2364	7	"2011-06-05 19:09:37.995"	"127.0.0.1"	"RECEIVED: LIST"
"POP3D"	2364	7	"2011-06-05 19:09:37.996"	"127.0.0.1"	"SENT: +OK 1 messages (2299 octets)"
"POP3D"	2364	7	"2011-06-05 19:09:37.997"	"127.0.0.1"	"SENT: 1 2299[nl]."
"POP3D"	2316	7	"2011-06-05 19:09:38.048"	"127.0.0.1"	"RECEIVED: RETR 1"
"POP3D"	2316	7	"2011-06-05 19:09:38.050"	"127.0.0.1"	"SENT: ."
"POP3D"	2320	7	"2011-06-05 19:09:38.772"	"127.0.0.1"	"RECEIVED: DELE 1"
"POP3D"	2320	7	"2011-06-05 19:09:38.782"	"127.0.0.1"	"SENT: +OK msg deleted"
"POP3D"	2344	7	"2011-06-05 19:09:39.169"	"127.0.0.1"	"RECEIVED: QUIT"
"DEBUG"	2344	"2011-06-05 19:09:39.170"	"Deleting message"
"DEBUG"	2344	"2011-06-05 19:09:39.174"	"Deleting message file"
"POP3D"	2344	7	"2011-06-05 19:09:39.175"	"127.0.0.1"	"SENT: +OK POP3 server saying goodbye..."
"DEBUG"	2316	"2011-06-05 19:09:39.178"	"Closing TCP/IP socket"
"DEBUG"	2316	"2011-06-05 19:09:39.179"	"Ending session 7"
"DEBUG"	2340	"2011-06-05 19:19:10.186"	"Creating session 8"
"POP3D"	2340	8	"2011-06-05 19:19:10.187"	"127.0.0.1"	"SENT: +OK POP3"
"POP3D"	2316	8	"2011-06-05 19:19:10.190"	"127.0.0.1"	"RECEIVED: AUTH "
"POP3D"	2316	8	"2011-06-05 19:19:10.191"	"127.0.0.1"	"SENT: -ERR Invalid command in current state."
"POP3D"	2324	8	"2011-06-05 19:19:10.193"	"127.0.0.1"	"RECEIVED: USER test@localhost.localdomain"
"POP3D"	2324	8	"2011-06-05 19:19:10.194"	"127.0.0.1"	"SENT: +OK Send your password"
"POP3D"	2364	8	"2011-06-05 19:19:10.196"	"127.0.0.1"	"RECEIVED: PASS ***"
"POP3D"	2364	8	"2011-06-05 19:19:10.202"	"127.0.0.1"	"SENT: +OK Mailbox locked and ready"
"POP3D"	2324	8	"2011-06-05 19:19:10.206"	"127.0.0.1"	"RECEIVED: STAT"
"POP3D"	2324	8	"2011-06-05 19:19:10.207"	"127.0.0.1"	"SENT: +OK 0 0"
"POP3D"	2332	8	"2011-06-05 19:19:10.413"	"127.0.0.1"	"RECEIVED: QUIT"
"POP3D"	2332	8	"2011-06-05 19:19:10.414"	"127.0.0.1"	"SENT: +OK POP3 server saying goodbye..."
"DEBUG"	2320	"2011-06-05 19:19:10.416"	"Closing TCP/IP socket"
"DEBUG"	2320	"2011-06-05 19:19:10.417"	"Ending session 8"
Cheers
Lubos

Post Reply