2 messages in net.sourceforge.lists.courier-usersRe: [courier-users] courier-pythonfil...
FromSent OnAttachments
Aleksander AdamowskiJul 19, 2007 2:51 am.patch
Gordon MessmerJul 20, 2007 11:24 am.patch
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] courier-pythonfilter xfilter - change estmp to local transport (patch)Actions...
From:Gordon Messmer (yiny@eburg.com)
Date:Jul 20, 2007 11:24:41 am
List:net.sourceforge.lists.courier-users
Attachments:

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