my thought would be: make it like amavis ... 1. your mta forwards you the mail via smtp. 2. you munch the email (although i seriously wonder why) 3. you send it back to your mta via smtp 4. mta calls dovecot to deliver the mail
for better suggestions, it would be nice to know what kind of modifications you want to do. -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org