这是本文档旧的修订版!


邮箱服务器

邮件服务器 参考文章:Ubuntu搭建简易Postfix邮箱服务器 文章二

常用命令(以serverback为例):

hostname -f          // 查看当前主机名
sudo nmap 10.0.0.211 // 检测端口
host 152.70.53.150   // ptr 反向域名
dig -x 152.70.53.150 // 主机详细记录
sudo hostnamectl set-hostname <your-fqdn>

测试SMTP端口是否通畅,测试成功后输入 quit 退出连接。

sudo apt install telnet
telnet gmail-smtp-in.l.google.com 25 // 连接谷歌邮箱端口

Trying 66.102.1.27…
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP k15-20020a7bc30f000000b003a4f1df58f7si7130598wmj.37 - gsmtp
quit
221 2.0.0 closing connection k15-20020a7bc30f000000b003a4f1df58f7si7130598wmj.37 - gsmtp
Connection closed by foreign host.

安装 sudo DEBIAN_PRIORITY=low apt install postfix
重新设置 sudo dpkg-reconfigure postfix

Gmail

APP PW of Gmail

使用Gmail代发邮件 通过 Gmail 中的别名发送电子邮件 (官方)

将gmail添加的别名设置为默认发送人,每次通过server中的mail发送时就会显示 [email protected]

官方示例

let transporter = nodemailer.createTransport({
    service: 'gmail',
    auth: {
        user: '[email protected]',
        pass: 'yourpass'
    }
});

QQ 邮箱

node实现邮件发送 同理可使用 Gmail 发送。


let transporter  = nodeMailer.createTransport('SMTP',{
    host: 'smtp.qq.com',
    secure: true,
    port: 465,
    auth: {
        user: [email protected]',//邮箱
        pass: 'XXXXXXX',//登入密码
    }   
});

const message = {
      from: '[email protected]', // Sender address
      to: $sendto,         // List of recipients
      subject: '华鹤易学 - 用户密码', // Subject line
      text: `${name} 您好!
      敬祝愉快安康!`
    };

Mailu 系统

解说视频 Mailu 搭建邮箱 mailu邮件服务器

Mailu with extern proxy (nginx)

apt install docker docker-compose

自己build 一个

wget docker-compose.yml
wget mailu.env
docker-compose -p mailu up -d
docker-compose -p mailu down
docker-compose -p mailu exec admin flask mailu admin admin 域名 密码

download

docker ps // 找到 mailu 的 id
docker port <mailu_id> // 看到所有的端口映射

我的配置文件

cd /mailu
wget https://setup.mailu.io/1.9/file/1f21ff04-8f4a-458e-a571-a7c3a1c0c7a0/docker-compose.yml
wget https://setup.mailu.io/1.9/file/1f21ff04-8f4a-458e-a571-a7c3a1c0c7a0/mailu.env

初始化

download

docker-compose -p mailu up -d // 编译安装
// 设置管理员密码
docker-compose -p mailu exec admin flask mailu admin admin simpinvest.gq PASSWORD

检查端口

netstat -tulpn | grep -E -w '25|80|110|143|443|465|587|993|995'

Docker mailserver

ewomail 系统

Yandex 托管

it/skills/mail.1660923074.txt.gz · 最后更改: 2022-08-19 15:31 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0