Score:0

Exim.conf Redirect email to an another folder

pw flag

I am trying to redirect/route incoming emails to another folder depending if they are listed inside the /etc/email_list file (ON/OFF). I am unsure how would I approach this, I am clearly messing something up. What would be the correct way of approaching this? Thanks!

Here is my exim.conf

custom_folder_redirect:
   driver = redirect

# Check if the email address is listed in /etc/email_list. If yes, folder_redirect = true.

   condition = ${if exists{/etc/email_list} {${lookup{$local_part@$domain} 
   lsearch{/etc/email_list}}}}} {}
   set folder_redirect = true
   message = Your email will be redirected to OTHER_FOLDER folder.

#If the folder redirect is OFF, then redirect the mails to INBOX(cur folder)
   driver = redirect
   condition = ${if !eq{$folder_redirect}{true}}
   data = /$home/mail/$domain/$local_part/cur
   allow_fail
   file_transport = address_file
   pipe_transport = address_pipe
   unseen
   endif

# If the folder redirect is ON, redirect the mails to OTHER_FOLDER
   condition = ${if eq{$folder_redirect}{true}}
   data = /$home/mail/$domain/$local_part/OTHER_FOLDER
   allow_fail
   file_transport = address_file
   pipe_transport = address_pipe
   unseen
   endif
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.