eximconf: log information about MIME parts
[mirror/dsa-puppet.git] / modules / exim / templates / eximconf.erb
index 6dc0a59..a11e8d5 100644 (file)
@@ -303,7 +303,12 @@ GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
                        {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}}}} : \
                        ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}
 <%- if @is_rtmaster -%>
-RT_SUBJECT = Subject: ${if and {{first_delivery}{match {${sg {$rh_Subject:}{\N\n\s+\N}{ }}}{\N(?is)(.*?)\[?debian rt\]?[:\s]*(.*)\N}}} {$1$2}{$h_subject:}}
+# This subject rewrite is embedded in double-quoted strings. As such, some of
+# the items need more escaping than usual, otherwise \N becomes simply "N" and
+# the following "\[" a literal "[".
+# Note that the lack of space in "Subject:${" is intentional, as the raw Subject
+# header will include the leading space, if present.
+RT_SUBJECT = Subject:${if and {{first_delivery}{match {${sg {$rh_Subject:}{\\n([ \\t])}{ }}}{\\N(?i)(.*?)\\[?debian rt\\]?[:\\t ]*(.*)\\N}}}{$1$2}{$h_subject:}}
 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
 <%- end -%>
 
@@ -937,6 +942,14 @@ acl_check_mime:
          condition     = ${if !eq{$acl_m_srb}{false}}
          message       = X-Surbl-Hit: $primary_hostname: $acl_m_srb
 
+  # Dump MIME parts to disk. "default" creates sequentially-named files
+  # in <spool_directory>/scan/<message_id>/ which should then be
+  # automagically unlinked after processing.
+  warn   decode        = default
+
+  # Log some information about attachments for debugging
+  warn   log_message   = MIME part [$mime_part_count] -> [${extract{-1}{.}{${lc:$mime_filename}}}] [$mime_content_type]
+
   accept
 
 <%- end -%>