How i can use $user Variable on exim filter and move mail to junk

mean

Verified User
Joined
Feb 14, 2007
Messages
40
Hello

i would like to write exim filter on /etc/system_filter.exim

Dectect the subject contain string "hacked" and move mail to junk

Example
HTML:
if
 ( $header_subject: contains "hacked"  )
then

  if
      $local_part is "${user}"
  then
      save /home/${user}/Maildir/.INBOX.spam/new/ 660
  else
      if "${if exists{/home/${user}/imap/${domain}/${local_part}}{yes}{no}}" is "yes"
      then
          save /home/${user}/imap/$domain/$local_part/Maildir/.INBOX.spam/new/ 660
      else
          save /home/${user}/Maildir/.INBOX.spam/new/ 660
      endif
  endif

  logwrite "$tod_log $message_id from $sender_address contained hack string to  $header_to -- $domain"
  finish
endif
This example doesn't work because
command: unknown variable name "user"

Can anyone guide me with how to get this working?
Thank you, Regards
Mean
 
Last edited:
Top