put in /etc/forward:

[EMAIL PROTECTED]: "|/home/orly/myprocess.pl"

then in your program, read STDIN and do your thing.

if you're using Perl, you will want Graham Barr's Mail::Internet package to decode the string you read from STDIN into a mail folder.

if you want to successfully decode MIME-encoded body, you will also need MIME::Parser.

note that MIME-encoded attachments can be NESTED (a severe pain in the butt). so if the mail body is multipart/mixed or multipart/related, use MIME::Parser to iterate over the attachments and look for the text/plain one.

also, if you discover that the email has NO text/plain attachment, only text/html, you will want to have a function which will strip the HTML tags from the text/html attachment.

have some regular expressions to remove quoted text (the part of the email which begins with > or | or a bunch of whitespace), extraneous whitespace, and signatures (this is tricky..)

you might also want to use Compress::GSM to compress the mail text to "txt" form so you can cram more words into your precious 160 characters.

finally, to send the SMS to kannel, you will want to use LWP::UserAgent.

that should be enough for a start. read the "Fine" manuals, or in this case, perldoc.

note that if you just want simple/dumb mail processing, the above is not necessary. but if you want *complete* mail processing, then this is (one) way of doing it.


On 1/30/06, fluxbox <[EMAIL PROTECTED]> wrote:
can you send me a sample?
tia.

 

i wrote such a script (in Perl), and it's been in production for a few years.



_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph


_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to