Question:
Message/Email “Journaling” functionality is available on many email server platforms (such as MS Exchange and Ice Warp’s Merak Mail Server). When messages are sent from or pass through the mail server “Journaled” copies of the emails are sent to specified email addresses (set in your server settings). When the email is received at the destination journal address it is an “identical” copy of the message (the same to, from, cc, and bcc fields).
One of our most recent clients have requested something interesting of us. They have requested that I write an application (VB6) to do selective email journaling for them. They will be “Journaling” many messages to one address on our end. My application will then search through all to, from, cc, and bcc fields looking for specific email addresses and then “Journal” the email to a predetermined address (so basically I have a database holding addresses to look for and addresses to journal to when matches are found). I have looked through the various IMAP & MAILMAN documentation looking for a way to “Journal” email but have come up with nothing so far. If all else fails I can almost get there by adding the journal to address to the bcc filed of the email, but the problem with that is the message will be re-delivered to the original recipients.
Answer:
Email journaling can be accomplished by calling the mailman.SendMime method.
The SendMime method takes 3 arguments:
1) A "from" email address.
2) A recipients string, which is a comma separated list of email addresses.
3) The MIME source of an email.
When you Journal an email, pass the original email in the 3rd argument, and anything you want in the 1st two.