Aleksander Adamowski wrote:
When the xfilter module submits the modified message, it specifies the
esmtp transport for submission. It also provides the source IP address
of the message. If SMTP AUTH was used for submitting the original
message, the credentials aren't propagated - the xfilter-ed message
doesn't have them anymore.
I'd thought that the -src argument would be sufficient, but it appears
that I may need to additionally set RELAYCLIENT in the environment. (As
in the attached patch... though I should be locking os.environ)
A simple fix for this would be to submit the message using the local
transport - hence the attached patch for xfilter.py.
I'd prefer not to do that. 'local' mail isn't filtered by default, and
I prefer that it not be filtered. Changing to the 'local' transport
requires users to modify their configuration, and removes the option of
not filtering local mail.
It would be probably nice to have an optional argument to the submit()
method that would let us specify the desired transport when calling it,
but IMHO it should default to local, not esmtp, when left unspecified.
If there were a good reason for it, I'd consider it. However, you'd
need good documentation so that users know how changing their
configuration might affect filters.
### Eclipse Workspace Patch 1.0
#P courier-pythonfilter
Index: courier/xfilter.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/courier/xfilter.py,v
retrieving revision 1.5
diff -u -r1.5 xfilter.py
--- courier/xfilter.py 10 Jan 2007 19:08:01 -0000 1.5
+++ courier/xfilter.py 20 Jul 2007 18:20:17 -0000
@@ -170,6 +170,7 @@
submitArgs.append('-src=%s' % self.controlData['u'])
submitArgs.append('esmtp')
submitArgs.append(self.controlData['f'])
+ os.environ['RELAYCLIENT'] = ''
(sInput, sOutput) = os.popen2(submitArgs, 't', 0)
# Feed in the message sender