I have a list server and refactoring it to using postgres as its source for
data. Was going well until I needed to replace the Reply-to header if pgsql
data said to reply to list.
When doing a exim -d+all simulation I get an expansion error when I get to the
lookup for headers_add and headers_remove config in the list route.
Here is the list route Im having troubles with:
lists_post:
driver = redirect
domains = test.domain.ca
headers_remove = ${lookup pgsql \
{SELECT 'Reply-to' AS result \
FROM listman.lists \
WHERE \
lower(listname) = lower('${quote_pgsql:$local_part}') \
AND lists.options ~ 'reply-to-list' \
} \
}
headers_add = ${lookup pgsql \
{SELECT 'Reply-to: ${quote_pgsql:$local_part}@domain.ca' AS result \
FROM listman.lists \
WHERE \
lower(listname) = lower('${quote_pgsql:$local_part}') \
AND lists.options ~ 'reply-to-list' \
} \
}
And the error message is:
15:46:01.457 756913 ╰───error message: "${quote_pgsql" is not a known
operator (or a } is missing in a variable reference)
15:46:01.457 756913 ├failed to expand: ${lookup pgsql {SELECT 'Reply-to' AS
result FROM listman.lists WHERE lower(listname) = '${quote_pgsql
15:46:01.457 756913 ╰───error message: "${quote_pgsql" is not a known operator
(or a } is missing in a variable reference)
15:46:01.457 756913 lists_post router: defer for [email protected]
15:46:01.457 756913 message: lists_post router failed to expand
remove_headers item "${lookup pgsql {SELECT 'Reply-to' AS result FROM
listman.lists WHERE lower(listname) = '${quote_pgsql": "${quote_pgsql" is not
a known operator (or a } is missing in a variable reference)
It works when I remove where clause and only have
headers_add = ${lookup pgsql \
{SELECT 'Reply-to: ${quote_pgsql:$local_part}@domain.ca' AS result \
} \
}
So the quote_ part worked the first time.
Thoughts?
Dion
--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## [email protected]
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/