Score:0

How to use variables in Exim filter file?

nz flag

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?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.