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

Exim: Change sender address when sending mails out of local network

· 52CE 我爱测

We have a working exim setup at a site, where users can send and receive mails. We are trying to setup a server to send some warnings and errors using email to an address that is outside the local network. The problem is: The pro…

问题原文

原帖链接 · Esa Varemo · CC BY-SA 3.0

We have a working exim setup at a site, where users can send and receive mails. We are trying to setup a server to send some warnings and errors using email to an address that is outside the local network.

The problem is:

The program that sends the mails sends them using the username it runs under and the local hostname of the server. This cause the mails to have a sender of format: [email omitted]. Exim sends these mails to the ISP's SMTP server, which rejects the mails as they have an illegal or unverifiable sender (the internal address).

I'm thinking I should configure exim to rewrite the sender when:

  • sender's domain is on the local network
  • receiver's domain is outside the local network

I tried setting some kind of rewriting in the exim config, but did not manage to get it to work. I'd show what I have tried, but I ran out of time on the last visit to the site, and had to revert to the original version losing all the changes I tried.

已采纳解答

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

begin rewrite
[email omitted]   [email omitted]   SFfrs

The flags have the following meanings:

  1. S - Do all rewriting at SMTP time. This means that all of the following flags are done immediately as the data they apply to is coming in, not delayed until later.
  2. F - Rewrite the envelope from field.
  3. f - Rewrite the From: header field.
  4. r - Rewrite the Reply-To: header field.
  5. s - Rewrite the Sender-To: header field.

Read Chapter 31 of the Exim Specification for more detail on message rewriting

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

资料来源与适用范围

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

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

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