0%

linux-SMTP

为了避免大量垃圾邮件泛滥,许多运营商默认屏蔽了SMTP功能,不只是25端口,所有SMTP出站包都会被ban掉。本文记录vultr解封方法

测试

使用telnet命令测试是否被ban

1
telnet smtp.163.com 25

会显示Trying 123.126.97.4...,无法连通。

解封方法

向管理员提交Tickets,比如

1
2
3
4
5
6
Hi,

My SMTP port seems to be blocked.
Could you please help me unlock it?

Thanks!

收到回复的主要内容

1
2
3
4
Please reply to this ticket with the following information:
1. The business name and organization URL(s) under which you offer services.
2. Describe, in as much detail as possible, the nature of the emails you intend to send.
3. The volume of email that you plan to deliver on a daily/monthly basis.

再次reply

1
2
3
1.My personal blog yuangaopeng.com
2.the emails i intend to send is XXXXX
3.The volume would be under XXX emails/month

然后收到回复

1
We have removed the default SMTP block on your account

重启

需要重启服务器使SMTP生效

测试

使用telnet命令测试是否被ban

1
telnet smtp.163.com 25

此时会有如下显示,成功解封

1
2
Connected to smtp.163.com.
Escape character is '^]'.

465端口

出于安全考虑,阿里云也封禁了25端口,并提供了建议使用第三方邮件服务商提供的465端口

1
2
3
4
5
6
7
8
9
10
11
12
13
# springboot邮箱配置
spring:
mail:
host: smtp.163.com
password: xxxxxxx
username: [email protected]
properties:
mail:
smtp:
auth: true
socketFactory:
class: javax.net.ssl.SSLSocketFactory
port: 465