Aspegic
Verified User
- Joined
- Aug 4, 2005
- Messages
- 282
I added a condition to system_filter.exim so that all email originating from a certain domain is automatically forwarded to the feedback mailbox of that domain:
and this works correctly.
Now I want to add the following condition: "EXCEPT if the mail was generated from a php script".
Mail generated by the php script contains the following header variable:
header_X-PHP-Originating-Script
so I should be able to check for this.
I have studied the exim scripting documentation and I came up with this:
Unfortunately this doesn't work. I have tried several alternative ways to write this, like this for example:
but this also doesn't work.
The documentation on this subject gives very few examples. In fact I couldn't find any that give examples of correctly using the "!" (not) modifier, or the correct syntax for nesting ifs.
Is there someone here who can help me write this in the correct way?
Many thanks in advance!
CentOS 6.0 64-Bit
DirectAdmin 1.49.1
Exim 4.86
Code:
if $sender_address contains somedomain.com
then
unseen deliver [email][email protected][/email]
endif
and this works correctly.
Now I want to add the following condition: "EXCEPT if the mail was generated from a php script".
Mail generated by the php script contains the following header variable:
header_X-PHP-Originating-Script
so I should be able to check for this.
I have studied the exim scripting documentation and I came up with this:
Code:
if $sender_address contains somedomain.com and ${if !def:header_X-PHP-Originating-Script:}
then
unseen deliver [email][email protected][/email]
endif
Unfortunately this doesn't work. I have tried several alternative ways to write this, like this for example:
Code:
if $sender_address contains somedomain.com then
if ${if !def:header_X-PHP-Originating-Script:} then
unseen deliver [email][email protected][/email]
endif
endif
but this also doesn't work.
The documentation on this subject gives very few examples. In fact I couldn't find any that give examples of correctly using the "!" (not) modifier, or the correct syntax for nesting ifs.
Is there someone here who can help me write this in the correct way?
Many thanks in advance!
CentOS 6.0 64-Bit
DirectAdmin 1.49.1
Exim 4.86
Last edited: