I'm using Exim with Cpanel.
I created a filter file:
touch /usr/local/cpanel/etc/exim/sysfilter/options/forward_filter
with the following content:
# 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
I receive emails with these headers:
Envelope-From: @
X-Authenticated-Sender: @
Reply-To: [email protected]
X-Original-Sender-Address: @
From: @:
Return-Path: @
Return-path: @
X-Authenticated-Sender: @
X-Authenticated-Sender: @
Desired headers:
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]
I tried $local_part@$domain
but it didn't work.
How to read the values of these variables in the filter file?