merge hcoop vmail configuration
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 4 Oct 2009 22:42:40 +0000 (18:42 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 4 Oct 2009 22:42:40 +0000 (18:42 -0400)
conf.d/router/250_exim4-config_spamcheck_vmail [new file with mode: 0644]
conf.d/router/310_exim4-config_virtual_user [new file with mode: 0644]
conf.d/transport/40_exim4-config_virtual_delivery [new file with mode: 0644]

diff --git a/conf.d/router/250_exim4-config_spamcheck_vmail b/conf.d/router/250_exim4-config_spamcheck_vmail
new file mode 100644 (file)
index 0000000..1b46a4a
--- /dev/null
@@ -0,0 +1,9 @@
+# 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
diff --git a/conf.d/router/310_exim4-config_virtual_user b/conf.d/router/310_exim4-config_virtual_user
new file mode 100644 (file)
index 0000000..b2f28f8
--- /dev/null
@@ -0,0 +1,14 @@
+# 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 }} \
+                     {|}{ }}
diff --git a/conf.d/transport/40_exim4-config_virtual_delivery b/conf.d/transport/40_exim4-config_virtual_delivery
new file mode 100644 (file)
index 0000000..d18a328
--- /dev/null
@@ -0,0 +1,16 @@
+# 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