As MimeDefang is running during the SMTP session, are you certain you really want to do this? Wouldn't it be more appropriate to perform conversions after message acceptance (e.g.during delivery)?