Menu

#110 XRMS Mail Tracker (email->activity)

open
nobody
None
5
2006-02-17
2006-02-17
DennisN
No

XRMS Mail Tracker

Written by Dennis Nilsson.
Loosely based on XRMS-Receive by Gareth Oakley.

Tracks all incoming/outgoing emails that goes through
the XRMS server and insert them as activities into XRMS.

It can't handle html emails yet (working on it) but
still saves them as basic text with the code intact.

Attachments from emails is stored as files in XRMS, it
checks for duplicates (using md5 checksum) and only
links to the old file if the exact same file is
uploaded again.

The script stores From address, To address and Subject
in activity description as well so its easier to see
from who the mail was sent and who it was intended for.

When multiple To addresses is found it creates one
activity for each but you will still see everyone it
was sent to in activity description.

The idea is to use procmail to forward an carbon copy
(read about how to do this in the procmailrc manual) of
all emails, that is received/delivered with sendmail
through the XRMS server, to this script.
For information about how to configure procmail to
start an script on all incoming emails (or if you want
to just forward specific emails to XRMS) read the
procmailrc manual.

To do a test all that is needed is a working XRMS, this
script and its required files and of course an email.
I've added some mails in the 'Test E-Mails' folder to
run tests with.
You should be able to run this script from terminal ()
"php mail-tracker.php < *name of mail file*"
then press enter and it should have added an activity
if it was an working email.

!! Mail can only be sent from users to a contact or a
from an contact to an user NOT between users or contacts.
!! This script is a little complicated so study the
code before you attempt to use it, I've added a lot of
comments so it should not be any problems understanding
what each part does.

I doubt this is a finished script since I’ve done very
little testing on it but I hope to get some help from
people who have time to analyze it and add to it if
needed or just give comments.
Anything and everything is appreciated.

/ DennisN

Discussion


Log in to post a comment.

MongoDB Logo MongoDB