[exim-dev] making transport_filter conditional

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Jasen Betts
Ημερομηνία:  
Προς: exim-dev
Αντικείμενο: [exim-dev] making transport_filter conditional
currently (unless it's been changed since 4.80)
there's no way to use expansion to disable the transport_filter
transport option.

This brief patch skips the transport_filter code if filter_argv[0] is empty.
thus allowing the transport filter to be ignored when the expansion
gives an empty string for the first argument.


I was considering using expansion to return

argv[0] /bin/cat
argv[1] -
argv[2] /dev/null
argv[3] /dev/null

etc... to turn the filter off, but decided that the extra expansions
that needed were way too ugly, and that I should fix the source instead.




diff --git a/build/exim/src/transport.c b/build/exim/src/transport.c
index 6894e96..86ae083 100644
--- a/build/exim/src/transport.c
+++ b/build/exim/src/transport.c
@@ -1167,7 +1167,9 @@ transport_filter_timed_out = FALSE;
 /* If there is no filter command set up, call the internal function that does
 the actual work, passing it the incoming fd, and return its result. */
+/* also bail if the argv[0] is NULL or empty - this allows a way to programatically disable the
+filter */
+
+if (transport_filter_argv == NULL || ! *transport_filter_argv || ! **transport_filter_argv )
-if (transport_filter_argv == NULL)
   return internal_transport_write_message(addr, fd, options, size_limit,
     add_headers, remove_headers, check_string, escape_string,
     rewrite_rules, rewrite_existflags);








--
⚂⚃ 100% natural