Operating System - HP-UX
1751883 Members
5586 Online
108783 Solutions
New Discussion юеВ

Automate email processing

 
SOLVED
Go to solution
Michael Resnick
Advisor

Automate email processing

Hi All,

Not sure if I can only do this using a list server (i.e. majordomo), but here goes...

I want to be able to receive email messages to a special alias and then process those messages via some script. The script will take data from the body and update database records based on the key info.

Anyone know of how to do this? Do you see any problems with this?
Thanks in advance,

mike
2 REPLIES 2
Scott Van Kalken
Esteemed Contributor

Re: Automate email processing

I did a similar thing many years ago when I was working as a namespace admin.

We would receive emails, the emails would them be sorted, and the information in them would be stored in an SQL database.

Then we'd generate billing info from our database.

We used a bunch of perl scripts and elm mailboxes.

We used elm's sorting features to sort based on subject: "domain name renewal" went to one mailbox and so forth.

We did find though that email was not the best because people do not follow standard formats - we found in the end that a web form that updated the database directly was much easier for us to handle (less crap ending up in our database).

We used mySQL databases as an interim solution before moving to a full java backend with oracle.

Hope this helps.

Scott.
Robin Wakefield
Honored Contributor
Solution

Re: Automate email processing

Hi Mike,

On your receiving server, create an alias with a pipe, e.g:

stats: "|/usr/local/bin/read_stats.sh"

Basically the message is read as input to the pipe, so for instance if you'd sent it as a uuencoded gzipped message, you could have something like this in the script:

/usr/bin/uudecode -p | /sbclocal/bin/gunzip -c > /tmp/message.$$ 2>>/tmp/message.out

etc...

Rgds, Robin