Assistance Required with System Filter Saving Spam to User Maildir
I am trying to configure my system filter (/etc/cpanel_exim_system_filter) to save spam emails into the user’s .spam folder using the following filter:
if "${if def:header_X-Spam-Subject: {there}}" is there
then
headers remove Subject
headers add "Subject: $rh_X-Spam-Subject:"
headers remove X-Spam-Subject
save "/home/${lookup{$domain}lsearch{/etc/trueuserdomains_readable}}/mail/$domain/$local_part/.spam/"
endif
However, when checking /var/log/exim_mainlog, I see:
1umW0g-0000000BAvN-3Y48 == /home//mail//.spam/ <system-filter> T=custom_spam_filter
It seems that $domain and $local_part are not being expanded at all.
I am using custom_spam_filter defined in TRANSPORTSTART section of Exim:
custom_spam_filter:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
group = cpaneleximfilter
user = cpaneleximfilter
mode = 0660
maildir_format = true
create_directory = true
Could you please explain why the variables are not expanding in this context, and how I can properly save spam into the correct user mailbox path using a system filter?
-
Hey there! I do remember that users in Discord helped out with this as I'm not able to offer custom Exim filter work through the Forums.
0
Please sign in to leave a comment.
Comments
1 comment