Php

電子郵件偶爾被發送給不正確/額外的收件人

  • March 14, 2013

多年來,我們一直成功地使用 hMailServer 作為我們的郵件伺服器。最近微軟阻止了我們的垃圾郵件(即使我們有合法的選擇加入服務),所以任何 hotmail、實時電子郵件都沒有被傳遞。我們在不同的 IP 上安裝了具有相同配置的 hMailServer 的備份伺服器(我們從主伺服器導出並將其推送到備份伺服器)。但是,自從這樣做以來,我們發現了一些非常奇怪的行為,很難確定。

基本上,電子郵件會隨機發送給錯誤的收件人。這並不是一直發生的。我們還有一些包含調試資訊的電子郵件,據報導這些電子郵件已發送到客戶的電子郵件帳戶。在我們切換郵件伺服器之前,這個問題從未存在過,並且沒有更改任何程式碼。我們真的不知道是什麼導致了這種情況的發生。

由於某些資訊是敏感資訊,我們暫時不得不切換回原來的郵件伺服器,並實現一些功能,以便在將電子郵件發送到基於 microsoft 的電子郵件帳戶時,我們會收到電子郵件副本和通知,以便採取適當的措施。這顯然不是一個可行的解決方案,我們需要嘗試並準確了解正在發生的事情。

我不完全確定您想要什麼資訊,但在日誌中我們注意到一些 502(未實現的命令)。這裡有一些日誌。在下面的程式碼段中,staff-member1 和 staff-member2 根本不應該收到這些電子郵件。

"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

我們已經在hMail 論壇上創建了一個文章,回复表明問題出在我們的程式碼中,但是我真的不明白這是怎麼可能的,因為程式碼在我們的其他郵件上執行了很多年伺服器。

抱歉,如果這有點含糊,但我們在這裡遇到了死胡同。如果您需要任何其他資訊,請詢問。

任何投入將不勝感激。

謝謝

也許以下內容可以幫助您解決問題。

看看這些字元串:

"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."

電子郵件實際上是空的 -250 Queued緊接著354 OK, send.

下面的幾行250 Queued告訴您消息頭是作為 SMTP 命令傳輸的。當然,SMTP 伺服器不理解它們。

考慮調查您的程式碼。DATA 部分的結尾是 CRLF.CRLF - 載波返回(ASCII 程式碼 0xD),換行(ASCII 程式碼 0xA),點,載波返回,換行 - 可能是您的腳本或應用程序或任何錯誤地在標題之前發送它。

引用自:https://serverfault.com/questions/485936