大网数据广告活动
服务器运维问答

How to set up an SMTP Relay Server

· 52CE 我爱测

I have 2 servers (X and Y) and an SMTP server for sending emails. X needs to send an email using the SMTP server, however it cannot resolve the host for the SMTP server. This is inevitable and I need a way around it (I can't do a…

问题原文

原帖链接 · Anfernee · CC BY-SA 3.0

I have 2 servers (X and Y) and an SMTP server for sending emails. X needs to send an email using the SMTP server, however it cannot resolve the host for the SMTP server. This is inevitable and I need a way around it (I can't do any DNS modifications). However, Y is able to connect to the SMTP server and X can connect to Y.

So then:

1) Can I set up Y to appear as an "SMTP server" that just relays the emails/requests sent to it from X, to my actual SMTP server?

2) Can I do so with just the IP addresses of the servers? This is for an LAN network and I don't have any domain names nor host names, only IPs.

3) Does anyone have a clear guide/example of how this can be done? I'm not familiar with SMTP Relaying nor Postfix, so I would appreciate verbose explanations.

I believe Postfix can do this, however, I did not come across any guides for my scenario. I'm open to other tools.

Both servers are Linux (Redhat/Centos).

已采纳解答

原帖链接 · Ra_ · CC BY-SA 3.0

1) Can I set up Y to appear as an "SMTP server" that just relays the emails/requests sent to it from X, to my actual SMTP server?

Yes, edit Y /etc/postfix/main.cf and configure:

mynetworks = 10.0.0.0/8

To accept email only from X (Set the X IP range here)

relayhost = [1.2.3.4]

To do relay (Set the SMTP IP address here)

2) Can I do so with just the IP addresses of the servers? This is for an LAN network and I don't have any domain names nor host names, only IPs.

Indeed, as you can see above.

3) Does anyone have a clear guide/example of how this can be done? I'm not familiar with SMTP Relaying nor Postfix, so I would appreciate verbose explanations.

I agree postfix is a very good option. There are tons of nice postfix guides. Check http://www.postfix.org/BASIC_CONFIGURATION_README.html

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。