Backup and Archive Incoming Email with Exim

Loitering around Google and finding a way to archive/backup incoming email in Exim email server. I went through the documentation in Exim offical website and found out a solution to do that with $tod_log, substr and shadow_transport.

The below transport rule will backup copy of email into /mail/backup/datetime/domainname/userid


save_incoming_email:
  driver = appendfile
  file = /mail/backup/${substr_0_10:$tod_log}/$domain/$local_part
  delivery_date_add
  envelope_to_add
  return_path_add
  group = paulooieximing
  user = paulooieximing

local_delivery:
  driver = appendfile
  file = /mail/$domain/$local_part/inbox
  create_directory
  delivery_date_add
  envelope_to_add
  return_path_add
  group = paulooieximing
  user = paulooieximing
  shadow_transport = save_incoming_email

This rules will backup all incoming email in local_delivery router. For you information;


$local_part = email userid
$domain = domain name
$tod_log = date time for log files
${substr_0_10:$tod_log} = substring 10 char for date "2006-07-01"

Related posts:

  1. Force Email Delivery on Exim Hundred emails are queuing on your mail relay server, and...
  2. Exim: Restrict Authenticated Outgoing Email with Sender Domain Most of the outgoing SMTP server allowed the user to...
  3. Grep Exim Email Transaction with Bash While email transport having problem, the first we look for...
  4. exim: rejected EHLO, syntactically invalid argument If you email having problem with rejected EHLO or HELO,...
  5. Check DNS Record with Dig Command Check DNS Record with Dig Command How do you find...
  6. ls & rm with regular expression e.g. rm -rf backup-20070[8-9]-* would delete : backup-200708-morning backup-200708-evening backup-200709-night...
  7. useful unix command: xargs In our mailserver, we backup every incoming email and keep...
  8. Exim – anti-spam per domain setting acl_check_rcpt: blah … blah … blah … deny message =...
  9. Searching for the right Xorg resolution & refresh rate It took me a while to find the correct tools...
  10. Exim, Recipient Verify on Relay and Mail Server How many of you got dictionary/ratware attack on your mail...

Leave a Reply