From: Matthijs Kooijman Date: Wed, 15 Apr 2009 17:43:11 +0000 (+0200) Subject: exim4: Use dovecot for delivery only. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=fded9ae27e80912bf898b213039c7a85416dd9ba;p=matthijs%2Fservers%2Fdrsnuggles.git exim4: Use dovecot for delivery only. This removes all previous delivery methods (.forward files, procmail and direct Maildir delivery) in favour of using dovecot's deliver program. Dovecot supports forwarding and filtering use sieve scripts and knows exactly where a user's mailbox should be, so this does not remove functionality but prevents duplicate configuration. --- diff --git a/etc/exim4/conf.d/router/15_real_local b/etc/exim4/conf.d/router/15_real_local deleted file mode 100644 index d654524..0000000 --- a/etc/exim4/conf.d/router/15_real_local +++ /dev/null @@ -1,13 +0,0 @@ -# This router allows reaching a local user while avoiding local processing. -# This matches only the "localhost" domain, which is used in the last step of -# delivery and should never be set on external messages. This can be used to -# inform a user of a broken .forward file, for example. The userforward router -# does this. - -real_local: - debug_print = "R: real_local for $local_part@$domain" - driver = accept - domains = localhost - local_part_prefix = real- - check_local_user - transport = maildir_home diff --git a/etc/exim4/conf.d/router/40_local_delivery b/etc/exim4/conf.d/router/40_local_delivery index ad6c559..d89df90 100644 --- a/etc/exim4/conf.d/router/40_local_delivery +++ b/etc/exim4/conf.d/router/40_local_delivery @@ -5,8 +5,8 @@ # redirect_router to "local_delivery". These routers are not used directly on # incoming messages, the first router guarantees this. # -# These routers support .forward files, procmail and mbox delivery in -# /var/mail, each tried in turn. +# Currently, there is only a single router that uses dovecot's deliver program +# to deliver the mail, but others could be (re)added when required. ################################# @@ -28,80 +28,14 @@ local_delivery: driver = redirect data = -# This router handles forwarding using traditional .forward files in users' -# home directories. It also allows mail filtering with a forward file -# starting with the string "# Exim filter" or "# Sieve filter". -# -# The no_verify setting means that this router is skipped when Exim is -# verifying addresses. Similarly, no_expn means that this router is skipped if -# Exim is processing an EXPN command. -# -# The check_ancestor option means that if the forward file generates an -# address that is an ancestor of the current one, the current one gets -# passed on instead. This covers the case where A is aliased to B and B -# has a .forward file pointing to A. -# -# The four transports specified at the end are those that are used when -# forwarding generates a direct delivery to a directory, or a file, or to a -# pipe, or sets up an auto-reply, respectively. -# -# Any syntax errors in the .forward are sent with the real- prefix, which the -# real_local router directly delivers through the maildir_home transport, -# avoiding the routers in this file. -userforward: - debug_print = "R: userforward for $local_part@$domain" - driver = redirect - domains = localhost - check_local_user - file = $home/.forward - require_files = $local_part:$home/.forward - no_verify - no_expn - check_ancestor - allow_filter - forbid_smtp_code = true - directory_transport = address_directory - file_transport = address_file - pipe_transport = address_pipe - reply_transport = address_reply - skip_syntax_errors - syntax_errors_to = real-$local_part@$domain - syntax_errors_text = \ - This is an automatically generated message. An error has\n\ - been found in your .forward file. Details of the error are\n\ - reported below. While this error persists, you will receive\n\ - a copy of this message for every message that is addressed\n\ - to you. If your .forward file is a filter file, or if it is\n\ - a non-filter file containing no valid forwarding addresses,\n\ - a copy of each incoming message will be put in your normal\n\ - mailbox. If a non-filter file contains at least one valid\n\ - forwarding address, forwarding to the valid addresses will\n\ - happen, and those will be the only deliveries that occur. - -# Let procmail deliver the message if a global or local (in the user's -# homedir) procmailrc exists. -procmail: - debug_print = "R: procmail for $local_part@$domain" - driver = accept - domains = localhost - check_local_user - transport = procmail_pipe - # emulate OR with "if exists"-expansion - require_files = ${local_part}:\ - ${if exists{/etc/procmailrc}\ - {/etc/procmailrc}{${home}/.procmailrc}}:\ - +/usr/bin/procmail - no_verify - no_expn - -# This router delivers to /var/mail. -local_user: - debug_print = "R: local_user for $local_part@$domain" +# This router uses dovecot_deliver for delivery +dovecot_deliver: + debug_print = "R: dovecot_deliver for $local_part@$domain" driver = accept domains = localhost check_local_user local_parts = ! root - transport = maildir_home + transport = dovecot_deliver # If we get here, some previous router redirected to a non-existing user. # That should not happen! cannot_route_message = Unknown user: This should not happen diff --git a/etc/exim4/conf.d/transport/30_exim4-config_address_file b/etc/exim4/conf.d/transport/30_exim4-config_address_file deleted file mode 100644 index 82b55e2..0000000 --- a/etc/exim4/conf.d/transport/30_exim4-config_address_file +++ /dev/null @@ -1,11 +0,0 @@ - -# This transport is used for handling deliveries directly to files that are -# generated by aliasing or forwarding. -# -address_file: - debug_print = "T: address_file for $local_part@$domain" - driver = appendfile - delivery_date_add - envelope_to_add - return_path_add - diff --git a/etc/exim4/conf.d/transport/30_exim4-config_address_pipe b/etc/exim4/conf.d/transport/30_exim4-config_address_pipe deleted file mode 100644 index c5f1828..0000000 --- a/etc/exim4/conf.d/transport/30_exim4-config_address_pipe +++ /dev/null @@ -1,10 +0,0 @@ - -# This transport is used for handling pipe deliveries generated by -# .forward files. If the commands fails and produces any output on standard -# output or standard error streams, the output is returned to the sender -# of the message as a delivery error. -address_pipe: - debug_print = "T: address_pipe for $local_part@$domain" - driver = pipe - return_fail_output - diff --git a/etc/exim4/conf.d/transport/30_exim4-config_address_reply b/etc/exim4/conf.d/transport/30_exim4-config_address_reply deleted file mode 100644 index b2b8862..0000000 --- a/etc/exim4/conf.d/transport/30_exim4-config_address_reply +++ /dev/null @@ -1,8 +0,0 @@ - -# This transport is used for handling autoreplies generated by the filtering -# option of the userforward router. -# -address_reply: - debug_print = "T: autoreply for $local_part@$domain" - driver = autoreply - diff --git a/etc/exim4/conf.d/transport/30_exim4-config_maildir_home b/etc/exim4/conf.d/transport/30_exim4-config_maildir_home deleted file mode 100644 index 50795a0..0000000 --- a/etc/exim4/conf.d/transport/30_exim4-config_maildir_home +++ /dev/null @@ -1,17 +0,0 @@ - -### transport/30_exim4-config_maildir_home -################################# - -# Deliver email to the directory Maildir in the user's home directory. -maildir_home: - debug_print = "T: maildir_home for $local_part@$domain" - driver = appendfile - directory = $home/Maildir - create_directory - delivery_date_add - envelope_to_add - return_path_add - maildir_format - directory_mode = 0700 - mode = 0600 - mode_fail_narrower = false diff --git a/etc/exim4/conf.d/transport/30_exim4-config_procmail_pipe b/etc/exim4/conf.d/transport/30_exim4-config_procmail_pipe deleted file mode 100644 index 5fb03ff..0000000 --- a/etc/exim4/conf.d/transport/30_exim4-config_procmail_pipe +++ /dev/null @@ -1,10 +0,0 @@ - -procmail_pipe: - debug_print = "T: procmail_pipe for $local_part@$domain" - driver = pipe - path = "/bin:/usr/bin:/usr/local/bin" - command = "/usr/bin/procmail" - return_path_add - delivery_date_add - envelope_to_add - diff --git a/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp b/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp deleted file mode 100644 index 33622c1..0000000 --- a/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp +++ /dev/null @@ -1,8 +0,0 @@ - -### transport/30_exim4-config_remote_smtp -################################# -# This transport is used for delivering messages over SMTP connections. - -remote_smtp: - debug_print = "T: remote_smtp for $local_part@$domain" - driver = smtp diff --git a/etc/exim4/conf.d/transport/35_exim4-config_address_directory b/etc/exim4/conf.d/transport/35_exim4-config_address_directory deleted file mode 100644 index 6861426..0000000 --- a/etc/exim4/conf.d/transport/35_exim4-config_address_directory +++ /dev/null @@ -1,14 +0,0 @@ -# This transport is used for handling file addresses generated by alias -# or .forward files if the path ends in "/", which causes it to be treated -# as a directory name rather than a file name. - -address_directory: - debug_print = "T: address_directory for $local_part@$domain" - driver = appendfile - delivery_date_add - envelope_to_add - return_path_add - check_string = "" - escape_string = "" - maildir_format -