Linode Email 無法寄送的解法

Linode 於 2019/12/5 以後開得新帳號(原因:CAN-SPAM Act),連到外部 SMTP Port 預設都被擋掉,以至於全部 Connection timed out。

新開機器可以直接 telnet 測試看看:

$ telnet gmail-smtp-in.l.google.com 25
Trying 2404:6800:4008:c03::1b…
Trying 74.125.203.26…
telnet: Unable to connect to remote host: Connection timed out

正常狀況

$ telnet gmail-smtp-in.l.google.com 25
Trying 74.125.203.26…
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP k2si12268129pld.364 - gsmtp

於 Postfix 的 /var/log/mail.log 會看到下述訊息:

Apr 29 12:47:24 localhost postfix/smtp[18520]: connect to gmail-smtp-in.l.google.com[74.125.203.27]:25: Connection timed out
Apr 29 12:47:24 localhost postfix/smtp[18521]: connect to gmail-smtp-in.l.google.com[108.177.97.27]:25: Connection timed out
Apr 29 12:47:24 localhost postfix/smtp[18523]: connect to gmail-smtp-in.l.google.com[64.233.189.26]:25: Connection timed out
Apr 29 12:47:54 localhost postfix/smtp[18523]: connect to alt1.gmail-smtp-in.l.google.com[108.177.9.27]:25: Connection timed out
Apr 29 12:48:24 localhost postfix/smtp[18523]: connect to alt2.gmail-smtp-in.l.google.com[209.85.234.26]:25: Connection timed out
Apr 29 12:48:54 localhost postfix/smtp[18522]: connect to alt3.gmail-smtp-in.l.google.com[142.250.11.27]:25: Connection timed out Apr 29 12:49:24 localhost postfix/smtp[18520]: connect to alt4.gmail-smtp-in.l.google.com[142.250.12.27]:25: Connection timed out

想要開通 Email 的 SMTP Port 需要做些設定,然後在於後台開 Ticket 申請。

閱讀全文〈Linode Email 無法寄送的解法〉

PHP 使用 PHPMailer 遇到 SSL operation failed 的解法

使用 PHP 寄信經常會使用 PHPMailer,但是要使用內部網路的 Mail
Server 來寄信,卻一直遇到如下述的錯誤:

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1.
OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

要怎麼解決呢?

閱讀全文〈PHP 使用 PHPMailer 遇到 SSL operation failed 的解法〉

Amazon SES 的測試信箱(Sandbox)

想要用程式來寄送 Email 越來越麻煩,就算要付費使用 Amazon SES 來寄信,還是非常麻煩...

此篇只有紀錄幾個概念和測試方式,詳細的就不寫了,Amazon SES 把該自己做的事情,全部推到開發者身上...

閱讀全文〈Amazon SES 的測試信箱(Sandbox)〉

PHPMailer 升級到 5.2.18 解決安全性問題

PHPMailer < 5.2.18 的版本,都有 Remote Code Execution (CVE-2016-10033) 的安全性漏洞,請盡快升級到 5.2.18 以上的版本。升級到 5.2.20 以上的版本

  • 註:詳細的攻擊方式、程式還沒有公開,讓大家有時間可以趕快升級套件~
  • 註:5.2.19 也會被繞過去,所以需要升級到 5.2.20 以上

閱讀全文〈PHPMailer 升級到 5.2.18 解決安全性問題〉

PHPMailer 使用 Gmail 寄信登入失敗的設定修復

想要使用 PHPMailer 來透過 GMail 的帳號寄信,近期都無法正常登入成功(「密碼不正確」錯誤),以至於信件無法正常發送,主要原因在於 Google 設定部分需要做點修改。

閱讀全文〈PHPMailer 使用 Gmail 寄信登入失敗的設定修復〉

PHP 使用 PHPMailer 透過 Gmail 預約/排程 寄信

想要在 Gmail 預定時間寄信, 查查發現沒這個功能, 不過外部倒是有些服務有提供此功能(列在相關網站, 有興趣可以參考看看)~

但是外部服務看到得都是 可以預約寄信、提醒 等等, 只是我需要的是下面功能:

  1. 確定 時間點 一定要發信
  2. 準確度 需要確認 0分0秒寄到

外部服務不一定能達到此需求, 於是來簡單寫寫寄信程式.

閱讀全文〈PHP 使用 PHPMailer 透過 Gmail 預約/排程 寄信〉