Gordon Messmer wrote: > > On Wed, 12 Dec 2001, Alessandro Vesely wrote: > > > Ok, I wrote a couple of pages describing that solution > > and the pieces of code used > > <http://www.tana.it/sw/avfilter/> > > > > Meaningful comments will be appreciated > > I don't want to be critical, but I have a few: > > Don't be afraid to use external utilities. Courier includes 'reformime' > which can be used to list and extract MIME parts. The code required to > request parts from reformime will be smaller than a MIME parser, and keeps > you from reinventing that wheel.
The problem with using reformime is that one has to use it through a shell. And, if I understood it right, local filters are being called for each recipient, rather than for each message. Calling reformime via fork/exec implies parsing its output and interpreting its return code, which is generally not a very robust approach, specially across upgrades. However, since I get mime errors on some files, it is probably a good idea to try external parsing in those cases. Alternatively, I could have reused reformime source code instead of reinventing my own mime parser. I did not, also because I already had my parser (I used it for cgi file upload). It is certainly less compliant than reformime. However, reformime is not smaller: it is 157Kb while the whole avfilter takes 88Kb. What I would really like, is mime parsing integrated with archive unpacking, so that one could scan inside a mail file wrapped inside a zip sent as an attachment. > Know your libraries. I notice that you're reimplimenting functions like > vsnprintf, which is going to be available on most platforms, and > implimenting functions like strincmp, when strncasecmp is available. > Knowing what functions are available will again help you avoid reinventing > the wheel. Yes, that's true. I should revamp some code, but following a lazy approach, if it's not broken I keep not fixing it :-) Thanks for the insights Ciao Ale _______________________________________________ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
