--- /dev/null
+# hcoop-change: Pass email through spamc if it has not already been
+# scanned.
+
+spamcheck_router_vmail:
+ no_verify
+ condition = "${if !eq {$received_protocol}{spam-scanned} {1}{0}}"
+ require_files = /etc/spamassassin/addrs/${local_part}@${domain}
+ driver = accept
+ transport = spamcheck
--- /dev/null
+# hcoop-change: Route mail for hosted domains
+
+virtual_user:
+ driver = accept
+ transport = virtual_delivery
+ # Look up the parameters for this email address, and store them in
+ # $address_data for later use. If no data exists for this address,
+ # then "fail", which causes Exim to move on to the next router.
+ # This allows us to access the contents of $address_data in the
+ # virtual_delivery transport later on, without having to do multiple
+ # accesses to exim.dat.
+ address_data = ${tr{${lookup{$local_part@$domain} \
+ dbm{/etc/courier/exim.dat}{$value} fail }} \
+ {|}{ }}
--- /dev/null
+# hcoop-change: This transport is used to deliver mail to virtual
+# mailboxes (i.e. email accounts which have been granted to non-hcoop
+# members by the owner of the domain)
+
+virtual_delivery:
+ debug_print = "T: virtual_delivery for $local_part@$domain"
+ driver = appendfile
+ user = ${extract{uid}{$address_data}}
+ group = nogroup
+ mode = 0600
+ mode_fail_narrower = false
+ envelope_to_add
+ return_path_add
+ directory = ${extract{mail}{$address_data}}${run{/etc/exim4/get-token \
+ ${extract{uid}{$address_data}}}{}}
+ maildir_format