From m.mach at uptime.at Tue Nov 4 07:10:17 2008 From: m.mach at uptime.at (Michal Mach) Date: Tue, 04 Nov 2008 13:10:17 +0100 Subject: [Pymilter] pymilter segfaults Message-ID: <49103BA9.5090401@uptime.at> Hi I am using pymilter with postfix and implemented a milter for disclaimer appending. The problem is that occasionally it simply crashes because of a segfault. The error in dmesg: mimemilter.py[23082]: segfault at 0000000000000130 rip 00002acb089e8900 rsp 00000000410010f0 error 4 Similar problem was discussed in this mailing list here: http://www.bmsi.com/pipermail/pymilter/2007-January/000143.html But it seams this discussion had no result what could be the problem. OS and packages are as follows: Debian lenny libmilter1.0.1 8.14.3-5 python-milter 0.8.9-3 python2.5 2.5.2-11 Using only standard python2.5 packages (email, logging, cStringIO, codecs, os, sys) Can you give me some suggestions what could be the problem? If you need more info please drop me an mail. From stuart at bmsi.com Tue Nov 4 13:46:11 2008 From: stuart at bmsi.com (Stuart D. Gathman) Date: Tue, 4 Nov 2008 13:46:11 -0500 (EST) Subject: [Pymilter] pymilter segfaults In-Reply-To: <49103BA9.5090401@uptime.at> References: <49103BA9.5090401@uptime.at> Message-ID: On Tue, 4 Nov 2008, Michal Mach wrote: > mimemilter.py[23082]: segfault at 0000000000000130 rip 00002acb089e8900 rsp > 00000000410010f0 error 4 > > Similar problem was discussed in this mailing list here: > > http://www.bmsi.com/pipermail/pymilter/2007-January/000143.html Never heard back from that guy, so I assumed it was the mysql module. (No one else has had the problem since.) > Can you give me some suggestions what could be the problem? > If you need more info please drop me an mail. One thing to try is to get version 1.9 of milter_module.c from here: http://pymilter.cvs.sourceforge.net/pymilter/milter/miltermodule.c?view=log and rebuild milter.so ("python setup.py build" and move into place or adjust PYTHON_PATH). If the problem goes away, then that means that more than one thread was accessing a milter ctx (maybe because of something libmilter does). I'll document that and revert. -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial. From stuart at bmsi.com Wed Nov 12 12:57:35 2008 From: stuart at bmsi.com (Stuart D. Gathman) Date: Wed, 12 Nov 2008 12:57:35 -0500 (EST) Subject: [Pymilter] Splitting milter into pymilter and bmsmilter In-Reply-To: <200811130114.57135.dragonheart@gentoo.org> References: <200811080006.16864.dragonheart@gentoo.org> <200811130114.57135.dragonheart@gentoo.org> Message-ID: On Thu, 13 Nov 2008, Daniel Black wrote: > or a register() function that takes a map of callbacks (again my python > skills not strong enough to know if this is possible). Nothing to do with python. Libmilter requires that the C callbacks cannot be changed once smfi_register() is called. By hooking all the callbacks to python functions, they are easily changed at any time thanks to the dynamic nature of python - but we have to hook them all since we can't predict what an application will need. -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial. From robert.dudley at fortressms.com Fri Nov 21 11:41:20 2008 From: robert.dudley at fortressms.com (Rob Dudley) Date: Fri, 21 Nov 2008 16:41:20 +0000 Subject: [Pymilter] Documentation Message-ID: <20081121164120.GC20721@rcwdxpsm1330.fortressms.local> Hi All, First post to this list so please forgive me if I'm asking something that is answered elsewhere. I was wondering if there was any documentation of the methods, etc. made available by the Milter module. I'm looking to implement some quite complex bits and pieces and have already had a hankering for a look "under the hood". Thanks (both for anticipated reposnses and for maintaining such a fantastic piece of software) Rob From stuart at bmsi.com Fri Nov 21 13:05:15 2008 From: stuart at bmsi.com (Stuart D. Gathman) Date: Fri, 21 Nov 2008 13:05:15 -0500 (EST) Subject: [Pymilter] Documentation In-Reply-To: <20081121164120.GC20721@rcwdxpsm1330.fortressms.local> References: <20081121164120.GC20721@rcwdxpsm1330.fortressms.local> Message-ID: On Fri, 21 Nov 2008, Rob Dudley wrote: > I was wondering if there was any documentation of the methods, etc. > made available by the Milter module. I'm looking to implement some > quite complex bits and pieces and have already had a hankering for a > look "under the hood". The "milter" module implements the C API pretty directly. The new features introduced in 8.14 (notably smfi_chgfrom) are not done yet (need to get sendmail-8.14 compiled for EL5). Check the C API link. The "Milter" module is a thin wrapper. It hooks all the callbacks, so you just need to derive from Milter.Milter and override the stub methods (which just log the call). Ok, you probably already figured that much out, what you *really* want to know about is the other miscellaneous modules in Milter. While they are in there because I think they are general purpose, the docs are just the doc comments. Here are the ones most likely to be useful in your own milter: Milter.dns high level wrapper around pydns Milter.config extend ConfigParser with nobrainer stuff Milter.dynip heuristically decide whether a hostname is "dynamic" (created automatically based on IP by the ISP) Milter.greylist Keep a greylisting database Milter.utils iniplist check if an ip is in a CIDR list parseaddr split email into fullname and address parse_addr split address into localpart and hostname parse_header remove obfuscated encoding from header -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial. From stuart at bmsi.com Fri Nov 21 15:44:30 2008 From: stuart at bmsi.com (Stuart D. Gathman) Date: Fri, 21 Nov 2008 15:44:30 -0500 (EST) Subject: [Pymilter] Splitting milter into pymilter and bmsmilter In-Reply-To: <200811080006.16864.dragonheart@gentoo.org> References: <200811080006.16864.dragonheart@gentoo.org> Message-ID: I have checked support for smfi_chgfrom and smfi_addrcpt_par into CVS. This requires sendmail-8.14, of course. 8.14 also provides xxmi_negotiate, which would be useful for the following: On Sat, 8 Nov 2008, Daniel Black wrote: > is it worth/are you interested, in moving the def envfrom/hello/envrcpt etc. > functions to a subclass called MilterDebug. Then, after this separation, > runmilter then can only attach binding for those that exist reducing context > swtiching on busy MTAs (or x-network on remote milters). Is this desireable? In reading the new APIs for sendmail-8.14, there is now an xxfi_negotiate() callback. This callback is made at the start of each connection, and with it you may opt out of any protocol steps, thus reducing the context switching as you desired. There is probably a way for python to figure out which callbacks are overridden, and automatically negotiate only the needed protocol steps. I haven't done this yet. -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.