如何在 Exim 过滤文件中使用变量?

如何在 Exim 过滤文件中使用变量?

我正在将 Exim 与 Cpanel 一起使用。

我创建了一个过滤文件:

touch /usr/local/cpanel/etc/exim/sysfilter/options/forward_filter

内容如下:

# Exim filter
if ("$sender_address" does not contain "@example.com") then
headers remove From
headers remove Sender
headers remove Return-Path
headers remove Return-path
headers remove Envelope-From
headers remove X-Authenticated-Sender
headers remove Received
headers add "Envelope-From: ${local_part}@$domain"
headers add "X-Authenticated-Sender: ${local_part}@$domain"
headers add "Reply-To: ${sender_address}"
headers add "X-Original-Sender-Address: ${local_part}@$domain"
headers add "From: ${local_part}@$domain"
headers add "Return-Path: ${local_part}@$domain"
headers add "Return-path: ${local_part}@$domain"
headers add "X-Authenticated-Sender: ${local_part}@$domain"
headers add "X-Authenticated-Sender: ${local_part}@$domain"
endif

我收到带有这些标题的电子邮件:

Envelope-From: @
X-Authenticated-Sender: @
Reply-To: [email protected]
X-Original-Sender-Address: @
From: @:
Return-Path: @
Return-path: @
X-Authenticated-Sender: @
X-Authenticated-Sender: @

所需标题:

Envelope-From: [email protected]
X-Authenticated-Sender: [email protected]
Reply-To: [email protected]
X-Original-Sender-Address: [email protected]
From: [email protected]
Return-Path: [email protected]
Return-path: [email protected]
X-Authenticated-Sender: [email protected]
X-Authenticated-Sender: [email protected]

我试过了$local_part@$domain,但是没用。

如何在过滤文件中读取这些变量的值?

相关内容