Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We've been using hMailServer successfully for a number of years as our mail server. Recently Microsoft blocked us for spam (even though we have a legit opt-in service), so any hotmail, live emails were not being delivered. We have a backup server on a different IP with hMailServer installed that has the same configuration (we export from the main server and push it to backup servers). However, since doing this we have found some very strange behaviour, which hard to pin down.

Basically, e-mails are randomly being sent to the wrong recipients. This isn't happening all of the time. We also have a number of e-mails containing debugging information, which have reportedly been sent to customer e-mail accounts. This problem never existed until we switched the mail servers over, and no code has been altered. We really have no idea what could be causing this to happen.

As some of the information is sensitive, we've had to switch back to our original mail server for the time being, and implement some functionality so that when an e-mail is sent to a microsoft-based e-mail account, we receive a copy of the e-mail and a notification so that the appropriate action can be taken. This obviously isn't a feasable solution and we need to try and understand exactly what is happening.

I'm not entirely sure what info you'd like, but in the logs we noticed some 502s (Unimplemented Command). Here are some logs. In the below snippet, staff-member1 and staff-member2 shouldn't be receiving these emails at all.

"APPLICATION"   2260   "2013-03-07 13:02:37.762"   "SMTPDeliverer - Message 969617: Message delivery thread completed."
"SMTPD"   2316   14153   "2013-03-07 13:04:15.168"   "IP_ADDRESS"   "SENT: 220 our.mail.server.com ESMTP"
"SMTPD"   2308   14153   "2013-03-07 13:04:15.168"   "IP_ADDRESS"   "RECEIVED: HELO our_server"
"SMTPD"   2308   14153   "2013-03-07 13:04:15.168"   "IP_ADDRESS"   "SENT: 250 Hello."
"SMTPD"   2328   14153   "2013-03-07 13:04:15.168"   "IP_ADDRESS"   "RECEIVED: MAIL FROM:<return@email-address.co.uk>"
"SMTPD"   2316   14154   "2013-03-07 13:04:16.497"   "IP_ADDRESS"   "SENT: 220 our.mail.server.com ESMTP"
"SMTPD"   2348   14154   "2013-03-07 13:04:16.512"   "IP_ADDRESS"   "RECEIVED: HELO our_server"
"SMTPD"   2348   14154   "2013-03-07 13:04:16.512"   "IP_ADDRESS"   "SENT: 250 Hello."
"SMTPD"   2308   14154   "2013-03-07 13:04:16.528"   "IP_ADDRESS"   "RECEIVED: MAIL FROM:<return@email-address.co.uk>"
"SMTPD"   2328   14153   "2013-03-07 13:04:17.731"   "IP_ADDRESS"   "SENT: 250 OK"
"SMTPD"   2308   14154   "2013-03-07 13:04:19.090"   "IP_ADDRESS"   "SENT: 250 OK"
"SMTPD"   2336   14154   "2013-03-07 13:04:19.090"   "IP_ADDRESS"   "RECEIVED: RCPT TO:<customers@email-address.co.uk>"
"SMTPD"   2336   14154   "2013-03-07 13:04:19.090"   "IP_ADDRESS"   "SENT: 250 OK"
"SMTPD"   2348   14154   "2013-03-07 13:04:19.090"   "IP_ADDRESS"   "RECEIVED: RCPT TO:<staff-member1@email-address.co.uk>"
"SMTPD"   2348   14154   "2013-03-07 13:04:19.106"   "IP_ADDRESS"   "SENT: 250 OK"
"SMTPD"   2308   14154   "2013-03-07 13:04:19.106"   "IP_ADDRESS"   "RECEIVED: RCPT TO:<c9ef15da@trustpilotservice.com>"
"SMTPD"   2308   14154   "2013-03-07 13:04:21.106"   "IP_ADDRESS"   "SENT: 250 OK"
"SMTPD"   2324   14154   "2013-03-07 13:04:21.106"   "IP_ADDRESS"   "RECEIVED: RCPT TO:<staff-member2@email-address.co.uk>"
"SMTPD"   2324   14154   "2013-03-07 13:04:23.106"   "IP_ADDRESS"   "SENT: 250 OK"
"SMTPD"   2320   14154   "2013-03-07 13:04:23.106"   "IP_ADDRESS"   "RECEIVED: DATA"
"SMTPD"   2320   14154   "2013-03-07 13:04:23.106"   "IP_ADDRESS"   "SENT: 354 OK, send."
"SMTPD"   2164   14154   "2013-03-07 13:04:23.278"   "IP_ADDRESS"   "SENT: 250 Queued (0.172 seconds)"
"APPLICATION"   2260   "2013-03-07 13:04:23.278"   "SMTPDeliverer - Message 969618: Delivering message from return@email-address.co.uk to customers@email-address.co.uk, staff-member1@email-address.co.uk, c9ef15da@trustpilotservice.com, staff-member2@email-address.co.uk. File: C:\Program Files (x86)\hMailServer\Data\{1798FEFB-112E-4904-92F3-49C47683C213}.eml"
"SMTPD"   2340   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: Date: Thu, 07 Mar 2013 13:03:22 +0000"
"SMTPD"   2340   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "SENT: 502 Unimplemented command."
"SMTPD"   2308   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: Subject: Order Placed... £14.99!"
"SMTPD"   2308   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "SENT: 502 Unimplemented command."
"SMTPD"   2340   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: To: staff-member1@email-address.co.uk, staff-member2@email-address.co.uk"
"SMTPD"   2340   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "SENT: 502 Unimplemented command."
"SMTPD"   2332   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: X-PHP-Originating-Script: 0:checkout.php"
"SMTPD"   2332   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "SENT: 502 Unimplemented command."
"SMTPD"   2320   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: From: Some Debugging Script <staff-member3@email-address.co.uk>"
"SMTPD"   2320   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "SENT: 502 Unimplemented command."
"SMTPD"   2316   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: "
"SMTPD"   2316   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "SENT: 502 Unimplemented command."
"SMTPD"   2340   14154   "2013-03-07 13:04:23.293"   "IP_ADDRESS"   "RECEIVED: Order 97188 has been placed

We have already created a thread over at the hMail forums, the responses suggest that the problem lies within our code, however I really don't see how that it is possible as the code has worked fine for a number of years on our other mail server.

Apologies if any of this is a bit vague but we've kind of hit a dead end here. If you need any additional information please ask.

Any input would be greatly appreciated.

Thanks

share|improve this question

1 Answer 1

up vote 3 down vote accepted
+50

Maybe the following helps you to advance in your problem.

Take a look at these strings:

"SMTPD" 2320 14154 "2013-03-07 13:04:23.106" "IP_ADDRESS" "SENT: 354 OK, send."

"SMTPD" 2164 14154 "2013-03-07 13:04:23.278" "IP_ADDRESS" "SENT: 250 Queued (0.172 seconds)"

"APPLICATION" 2260 "2013-03-07 13:04:23.278" "SMTPDeliverer - Message 969618: Delivering message from return@email-address.co.uk to customers@email-address.co.uk, staff-member1@email-address.co.uk, c9ef15da@trustpilotservice.com, staff-member2@email-address.co.uk. File: C:\Program Files (x86)\hMailServer\Data\{1798FEFB-112E-4904-92F3-49C47683C213}.eml"

"SMTPD" 2340 14154 "2013-03-07 13:04:23.293" "IP_ADDRESS" "RECEIVED: Date: Thu, 07 Mar 2013 13:03:22 +0000"

"SMTPD" 2340 14154 "2013-03-07 13:04:23.293" "IP_ADDRESS" "SENT: 502 Unimplemented command."

The e-mail is actually empty - 250 Queued straight after 354 OK, send.

The lines below 250 Queued tell you that message headers are transmitted as SMTP commands. Of course, SMTP server doesn't understand them.

Consider investigating your code. End of DATA section is CRLF.CRLF - carrier return (ASCII code 0xD), line feed (ASCII code 0xA), dot, carrier return, line feed - maybe your script-or-app-or-whatever erroneously sends it before headers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.