ilan
Verified User
I'm trying to build a custom email filter for one of our clients, and for that I'm trying to use the all_post.sh custom script, but something strange happens and I some guidance.
Basically what the script does that it appends to the user's filter file some extra filters, and to avoid overriding this addendum when the filters are re-writen by directadmin, I use the all_post.sh script
My problem is that the $domain variable appears to be empty for some things and not empty for others.
Trying to figure out the problem I did the following test, I wrote in the all_post.sh with only the following content:
and the output I'm receiving is:
(just an empty row where the domain name should be)
Seemingly no value for $domain but apparently the following statement does work:
and it does evaluate properly both sides of the condition so the variable $domain must be having come content.
Any ideas?
Thanks in advance
Basically what the script does that it appends to the user's filter file some extra filters, and to avoid overriding this addendum when the filters are re-writen by directadmin, I use the all_post.sh script
My problem is that the $domain variable appears to be empty for some things and not empty for others.
Trying to figure out the problem I did the following test, I wrote in the all_post.sh with only the following content:
Code:
#!/bin/sh
echo start > /tmp/deleteme.txt
echo "$domain" >> /tmp/deleteme.txt
echo "$command" >> /tmp/deleteme.txt
echo end >> /tmp/deleteme.txt
exit 0;
and the output I'm receiving is:
Code:
cat /tmp/deleteme.txt
start
/CMD_EMAIL_FILTER
end
(just an empty row where the domain name should be)
Seemingly no value for $domain but apparently the following statement does work:
Code:
if ([ "$command" = "/CMD_EMAIL_FILTER" ] || [ "$command" = "/CMD_SPAMASSASSIN" ]) && [ "$domain" = "mydomain.com" ];
and it does evaluate properly both sides of the condition so the variable $domain must be having come content.
Any ideas?
Thanks in advance