简体   繁体   中英

How to save and redirect mail with exim 4

I have working redirecting configuration for exim4 on my server with the help of tutorial. It works with virtual hosts, I followed the following tutorial - the last part

vdom_aliases:
  driver = redirect
  allow_defer
  allow_fail
  domains = dsearch;/etc/exim4/virtual
  data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}}
  retry_use_local_part
  pipe_transport   = address_pipe
  file_transport   = address_file
  no_more

What I need is to not only redirect the mails to the ones specified but also save them first locally.

Is there a way to do it? Thanks.

You have to use verb unseen in the routers. Usually first matched router process message and then routing is complete. But when matching router have unseen processing continues like message wasn't been matched before.

vdom_aliases: # redirect message
  driver = redirect
  domains = dsearch;/etc/exim4/virtual
  data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}}
  unseen      # keep routing

localdeliver: # do everything else
  driver = accept
. . . . . . . .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM