前言
通常安全設(shè)備都會提供郵件告警的方式,但一般安全設(shè)備都不直接給出網(wǎng)權(quán)限,所以可以在內(nèi)網(wǎng)做郵件代理,用一臺能出網(wǎng)的linux主機(jī)做代理,實(shí)現(xiàn)告警出網(wǎng)。文章來源:http://www.zghlxwxcb.cn/news/detail-530999.html
下載編譯nginx
// 安裝包版本需要在1.10.0以上
wget http://nginx.org/download/nginx-1.23.3.tar.gz
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
//安裝依賴
yum install -y pcre-devel
//創(chuàng)建用戶
useradd -M -s /sbin/nologin nginx
//解壓文件
tar -zxvf nginx-1.23.3.tar.gz -C /usr/local/
cd /usr/local/nginx-1.23.3
// 安裝時一定要編譯上 mail 和 stream
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-mail --with-stream --with-http_stub_status_module --with-http_ssl_module
make && make install
配置文件
vi /usr/local/nginx/conf/nginx.conf
//添加stream配置,監(jiān)聽本地8025,將流量轉(zhuǎn)發(fā)至網(wǎng)易郵箱smtp服務(wù)器
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
stream{
server {
listen 8025;
proxy_pass smtp.163.com:25;
}
}
以下略
網(wǎng)易郵箱配置介紹:文章來源地址http://www.zghlxwxcb.cn/news/detail-530999.html
啟動檢查
/usr/local/nginx/sbin/nginx
//檢查nginx是否監(jiān)聽8025端口
netstat -ntulp | grep 8025
到了這里,關(guān)于內(nèi)網(wǎng)通過nginx代理實(shí)現(xiàn)郵件出網(wǎng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!