When setting up a mail server (like Postfix + Dovecot) or debugging email delivery, it’s often necessary to verify whether your SMTP host works correctly and if your credentials are valid.Here are two practical methods you can use with PHP 7.4. ✅ Method 1: Using PHPMailer (Recommended) PHPMailer is a full-featured mailer library supporting STARTTLS…
Blog
使用 PHP 測試 SMTP 功能(PHP 7.4 範例)
在開發郵件系統或部署郵件伺服器(如 Postfix、Dovecot)時,常常需要快速驗證 SMTP 主機是否可用、帳號密碼是否正確。本文提供兩種實用方式,使用 PHP 7.4 即可輕鬆測試郵件寄送與認證。 ✅ 方法一:使用 PHPMailer(推薦) 這是最直覺、最穩定的做法。PHPMailer 支援 STARTTLS / SMTPS / AUTH LOGIN,並能顯示詳細的 SMTP 除錯訊息。 安裝 若可使用 Composer: 範例程式:smtp_test.php 若無法使用 Composer,可直接下載 PHPMailer 的三個核心檔案:PHPMailer.php, SMTP.php, Exception.php,並在程式中手動引用。 ✅ 方法二:純 PHP Socket 測試(不發信,只測握手) 這個版本不寄信,只測試 連線 → STARTTLS → AUTH LOGIN 是否正常。非常適合快速檢查主機、TLS 或帳密問題。 🔍 常見錯誤與排查 問題 原因與建議 Connection timed out 主機或連接埠錯誤、防火牆阻擋 Peer certificate CN…
Building a Secure OpenVPN Server on OPNsense — Step-by-Step Practical Guide
Author: Rico WuEnvironment: OPNsense 25.xUse case: Remote work, branch office connectivity, employee VPN 1️⃣ Why OPNsense + OpenVPN? OpenVPN is an open-source, SSL-based VPN protocol that’s secure, cross-platform, and reliable.OPNsense provides a built-in GUI for managing OpenVPN — allowing administrators to quickly deploy: This makes OPNsense a strong, cost-free VPN gateway for modern hybrid work….
在 OPNsense 上建立與設定 OpenVPN:完整實務指南
作者: Rico Wu環境: OPNsense 25.x應用場景: 遠端辦公、跨地分公司連線、行動員工 VPN 一、為什麼選擇 OPNsense + OpenVPN? OpenVPN 是一款開源、安全且穩定的 VPN 解決方案,而 OPNsense 內建完整的 OpenVPN 管理介面,可快速建立: 與傳統 VPN 相比,OpenVPN 使用 TLS/SSL 驗證機制,可確保連線安全並支援跨平台(Windows / macOS / Linux / iOS / Android)。 二、建立 OpenVPN 伺服器(Server) 🔹 步驟 1:建立憑證授權中心(CA) 1️⃣ 前往 System → Trust → Authorities → +Add2️⃣ 設定如下: → 儲存 ✅ 🔹 步驟 2:建立伺服器憑證…
Deep Packet Power: Enabling Layer-7 Traffic Control on OPNsense
Author: Rico WuEnvironment: OPNsense 25.x + Zenarmor + SuricataUse case: Enterprise internet access control & application-layer filtering 🧱 1. What Is Layer-7 Control? Traditional firewalls operate mainly at Layer-3 and Layer-4 — controlling traffic based on IP addresses, ports, and protocols.While effective for basic routing and NAT, they can’t tell what the traffic actually is….
深度封包的力量:在 OPNsense 啟用 Layer 7(L7)應用層流量控制
作者: Rico Wu環境: OPNsense 25.x + Zenarmor + Suricata應用場景: 企業上網行為管理與應用層封包管控 🧱 一、什麼是 L7 流量控制? 一般防火牆主要運作在 L3(網路層)與 L4(傳輸層),也就是依據 IP、Port、通訊協定 來允許或阻擋流量。這樣能處理連線方向與基本安全,但無法辨識「應用內容」。 L7(Layer 7,應用層)防火牆 能深入檢視封包內容(DPI, Deep Packet Inspection),可根據實際應用類型進行控制,例如: 在企業網路環境中,L7 控制能大幅提升 安全性、效率與使用行為可視化。 ⚙️ 二、OPNsense 如何支援 L7? OPNsense 是基於 FreeBSD + pf 架構的防火牆,其中 pf 防火牆本身僅支援 L3/L4 控制。 但 OPNsense 可透過 插件與整合模組 實現 L7(應用層)控制,常用的三種方式如下: 模組 功能用途 L7 支援程度 備註 Zenarmor (原名…
Complete Guide: Installing and Configuring OPNsense Firewall on Proxmox VE
Audience: IT administrators, network engineers, and virtualization enthusiastsEnvironment: Proxmox VE + OPNsense (FreeBSD-based firewall) 📘 1. Why Choose OPNsense? OPNsense is a FreeBSD-based open-source firewall maintained by Deciso.It offers enterprise-grade features — IDS/IPS, traffic shaping, VPN, proxy, and QoS — in a modern web interface with active updates. When running Proxmox VE, OPNsense is one…
在 Proxmox VE 上安裝與設定 OPNsense 防火牆完整指南
適用對象:網管人員、IT 維運、虛擬化環境使用者實作環境:Proxmox VE + OPNsense(FreeBSD-based firewall) 📘 一、為什麼選擇 OPNsense? OPNsense 是一款基於 FreeBSD 的開源防火牆系統,由 Deciso 公司維護,擁有企業級功能(如 IDS/IPS、流量監控、VPN、QoS、Proxy 等)。與 pfSense 相比,它的介面更現代化、套件更穩定,且更新頻率高。 如果你的公司正在使用 Proxmox VE(PVE) 進行虛擬化,OPNsense 是最理想的虛擬防火牆解決方案之一。 ⚙️ 二、在 Proxmox 上安裝 OPNsense 1️⃣ 系統需求建議 項目 最低需求 建議配置 CPU 2 Core 2~4 Core(支援 VT-x / AMD-V) RAM 2GB 4~8GB(視流量與 IDS 功能而定) Disk 10GB 20GB 以上 NIC 2 張 一張…
Understanding “network unreachable resolving ‘./NS/IN’” Messages in BIND9
When managing a DNS server such as BIND9, you might notice repeated messages like these in your lame-servers.log or system log: At first glance, these may look like DNS errors.In reality, they are harmless IPv6 connectivity warnings, not signs of malfunction. 🔍 Why These Messages Appear When BIND performs recursive queries, it tries to contact…
BIND9 日誌出現「network unreachable resolving ‘./NS/IN’」的原因與解決方式
在管理 DNS 伺服器(如 BIND9)時,有時會在 lame-servers.log 或一般系統日誌中看到如下訊息: 乍看之下像是 DNS 出錯,但其實這些只是 IPv6 無法連線的提醒訊息,並不影響實際解析。 🔍 為什麼會出現這些訊息? BIND 在進行遞迴查詢時,會同時嘗試向根伺服器(Root DNS)查詢 IPv4 與 IPv6。如果你的伺服器或 Docker 容器 沒有啟用 IPv6 網路或沒有預設 IPv6 路由,BIND 嘗試連線到 IPv6 根伺服器(如 2001:500:1::53)時,就會出現: 👉 也就是說,它只是告訴你「IPv6 不通」,並不代表 DNS 功能異常。IPv4 解析仍然正常進行。 ✅ 解決方式(擇一) 方案 A:讓 BIND 僅使用 IPv4(最簡單) 如果你的環境暫時不使用 IPv6,可讓 BIND 啟動時加上 -4 參數。 範例:你原本的啟動腳本為 其中的 -4 位置錯了,應該改成放在 映像名稱之後,如下: 這樣…