Procmail is a seriously powerful tool for managing mail on a unix server. I've been playing around with it for the last two days. My initial goal was to make it so that I could post to my page here by sending an email to a special mail address at this domain. It's a little rough around the edges still, but it works.
Procmail looks at every piece of incoming mail. If the mail is to autopost@digitalmediatree.com it moves it to a special folder, and then initiates a perl script. The perl script looks to see if anything is in the special folder, and if so it grabs the to:, from:, and subject: lines plus the body of the message. It creates an HTTP useragent (using HTTP::Request::Common qw(POST) and LWP::UserAgent) which calls a variation of the php posting script that already controls posting to these web pages. The PHP script grabs a password from the first line of the body, checks for permissions, and then posts the message to the appropriate page (specified in the subject line.) Pretty cool. I hadn't used Perl in some time. It's powerful, but the syntax seems a little weird to me now after using PHP for so long. I think PHP is more straightforward (although I wouldn't want to do system stuff with it.)
Anyway, today I was working on extending this. I made a mail web page for myself here (it's private, so you can't see it.) Then I had procmail forward a copy of any incoming mail to my address here (jimb at digitalmediatree.com) to that special folder, and initiate the process above. But this time it doesn't look for a password, it just posts it to my mail web page, making the username ('posted by username') be the return address of the mail.
My idea next is to use the new framed archive view to act as the front end to this new mail system. I think that might work well. Not sure exactly where I'm going with this, but the general idea is to close the gap between weblogs, discussion groups, mailing lists, and mail. They are sort of the same, but they are not integrated together well. Hopefully I can make some small progress.
|
Procmail looks at every piece of incoming mail. If the mail is to autopost@digitalmediatree.com it moves it to a special folder, and then initiates a perl script. The perl script looks to see if anything is in the special folder, and if so it grabs the to:, from:, and subject: lines plus the body of the message. It creates an HTTP useragent (using HTTP::Request::Common qw(POST) and LWP::UserAgent) which calls a variation of the php posting script that already controls posting to these web pages. The PHP script grabs a password from the first line of the body, checks for permissions, and then posts the message to the appropriate page (specified in the subject line.) Pretty cool. I hadn't used Perl in some time. It's powerful, but the syntax seems a little weird to me now after using PHP for so long. I think PHP is more straightforward (although I wouldn't want to do system stuff with it.)
Anyway, today I was working on extending this. I made a mail web page for myself here (it's private, so you can't see it.) Then I had procmail forward a copy of any incoming mail to my address here (jimb at digitalmediatree.com) to that special folder, and initiate the process above. But this time it doesn't look for a password, it just posts it to my mail web page, making the username ('posted by username') be the return address of the mail.
My idea next is to use the new framed archive view to act as the front end to this new mail system. I think that might work well. Not sure exactly where I'm going with this, but the general idea is to close the gap between weblogs, discussion groups, mailing lists, and mail. They are sort of the same, but they are not integrated together well. Hopefully I can make some small progress.
- jim 11-26-2001 7:37 pm