I'm getting some odd behaviour in a pipe transport which I've found whilst setting up spamassassin (although this is nothing to do with SA).
The problem appears to be that the transport_filter program I specify always wants an absolute path. If I make it relative and use the 'path = /usr/bin' then the router fails. It's quite possible that I've set something up wrong but if I have it's a little obscure.
In more detail, I have a router set as below which I was using to test SA.
spamcheck:
driver = pipe
command = /usr/exim/bin/exim -oMr spam-scanned -bS
use_bsmtp = true
path = /usr/bin
transport_filter = tee -a /tmp/spamcheck.log
home_directory = "/tmp"
current_directory = "/tmp"
# must use a privileged user to set $received_protocol on the way back in!
user = exim
group = exim
log_output = true
return_fail_output = true
return_path_add = false
message_prefix =
message_suffix =
However, this fails. The exim log shows:
14:56:10 17VYEs-0001Ea-00 <= Glenn.Carver@??? H=sheridan.atm.ch.cam.ac.uk (sheridan) [131.111.112.194] P=esmtp S=2128 id=20020719145610.Q28443@???
14:56:11 SMTP connection from exim lost while reading message data (header)
14:56:11 17VYEs-0001Ea-00 <glenn@???>: spamcheck transport output: An error was detected while processing a file of BSMTP input.
14:56:11 17VYEs-0001Ea-00 ** glenn@??? R=spamcheck_router T=spamcheck: Child process of spamcheck transport returned 2 from command: /usr/exim/bin/exim
.. which I take to mean that it couldn't find or run the 'tee' command. Certainly the file /tmp/spamcheck.log is empty. It doesn't seem to matter where I put the path line.
Now if I change the transport_filter line to read:
transport_filter = /usr/bin/tee -a /tmp/spamcheck.log
..it works! The log file shows a clean delivery and as expected I get a copy of the message in /tmp/spamcheck.log.
The spec clearly says that the path option specifies the string setup in the PATH env. variable of the subprocess. If the 'command' path is not absolute then it should look for the tee command in path. So I think my first attempt should work.
Either this is something subtle I don't understand or it's a bug.
Glenn
--
Dr. Glenn Carver, Centre for Atmospheric Science, Univ. of Cambridge,
Chemistry Dept., Lensfield Road, Cambridge, CB2 1EW, UK.
mailto:Glenn.Carver@atm.ch.cam.ac.uk http://www.atm.ch.cam.ac.uk/~glenn/
Phone: +44 (1223) 763827 ** please note new numbers **
Fax: +44 (1223) 763823