Exim system wide filter file - mail command not working
I have written an exim system-wide custom filter file, which is placed in /usr/local/cpanel/etc/exim/sysfilter/options/.
The file freezes some emails based upon a condition, so that they can be reviewed by an administrator. The file is essentially:
The rule works - the header gets added and the emails get frozen. However, the mail command does not work. At first, exim_mainlog showed the error:
which lead me to the setting system_filter_reply_transport in exim.conf I was able to set this from the WHM Exim Advanced Editor interface. However, there is no guidance on what the setting should be. Being as the email would be sent to a user on the system (not externally), I tried:
However, exim_mainlog then showed the error:
My searching has found very little on the subject. Can anyone help with this?
if
condition
then
headers add "custom_header"
mail to ""
subject "email subject"
text "some text"
freeze text "Frozen by system filter"
endif
The rule works - the header gets added and the emails get frozen. However, the mail command does not work. At first, exim_mainlog showed the error:
routing defer (-1): system_filter_reply_transport is unset
which lead me to the setting system_filter_reply_transport in exim.conf I was able to set this from the WHM Exim Advanced Editor interface. However, there is no guidance on what the setting should be. Being as the email would be sent to a user on the system (not externally), I tried:
system_filter_reply_transport = dovecot_virtual_delivery
However, exim_mainlog then showed the error:
system-filter> T=dovecot_virtual_delivery defer (-1): Failed to connect to socket /var/run/dovecot/lmtp for dovecot_virtual_delivery transport: Permission denied
My searching has found very little on the subject. Can anyone help with this?
-
It's also worth noting the following (this output was taken from a test machine) # grep system_filter_user /etc/exim* /etc/exim.conf:system_filter_user = cpaneleximfilter
The cpaneleximfilter user doesn't have the ability to send mail directly, so you might do better calling a PHP script or something similar, if my above ideas don't help the situation.0 -
Thanks @cPRex. I realise you can't support every exim customisation, but I was hoping someone might have already solved this. We have the default settings for system_filter* in exim.conf: system_filter_user = cpaneleximfilter system_filter_group = cpaneleximfilter system_filter = /etc/cpanel_exim_system_filter
I'll have a look at the errors address setting as a workaround.0 -
After some further searching I found a post from 2002 on the exim-users mailing list archive, which give me a clue as to the correct transport to use: system_filter_reply_transport = address_reply
0 -
Nice! Good find! 0
Please sign in to leave a comment.
Comments
5 comments