It depends on what you're trying to do. "Directly" using milter,
I assume, means using Sendmail's reference libmilter and writing your
filter in C.
MIMEDefang is written in Perl. Using libmilter directly means writing
C or C++ code. So:
Pros of MIMEDefang:
o Perl is way more appropriate than C for mangling chunks of text.
o MIMEDefang is much easier to start using than straight libmilter.
o You can take advantage of 100001 CPAN modules, so your filter is probably
98% written already.
o You don't need to worry about buffer overflows, pthreads
synchronization issues, etc. because those issues have be taken care
of by MIMEDefang. (I'm fairly confident of that, anyway!)
Cons of MIMEDefang:
o Perl uses way more memory than C (unless you write bizarre C.)
o Perl is potentially much slower than C, depending on what you're trying to do.
o MIMEDefang doesn't map all of libmilter's callbacks, so you do lose a little
flexibility.
All in all, I'd strongly recommend going with MIMEDefang first because
you can whip up a filter in a few minutes. Then if (and only if) you
determine that the function can't be done efficiently/effectively in
Perl, write a C milter.
Regards,
David.