I’m thinking about adding mail subscription to Oddmuse. I used to oppose this, claiming that people should use rss2email and similar feed subscriptions as a replacement. I changed my mind when I joined the RPG Bloggers. I read a lot of posts from blogs I’m not subscribed to. When I leave a comment, I’m interested in getting notified of replies to this one post only. Email just works.
Visitors can add their email address and click a checkbox to subscribe to changes when they edit a page. The requirement to successfully edit a page acts as a defense mechanism against spammers and vandals (SoftSecurity).
Email addresses are stored in a file. Each mail contains an unsubscribe link, and from there users can see (and unsubscribe from) all other pages they are subscribed to. The link contains a hash of the email address which prevents others from guessing what email addresses have subscriptions.
There is also an admin interface that shows which email addresses are subscribed to which pages, allowing the easy removal of email addresses from the database.
The problem was that on my host, there is no C compiler, so I was unable to install Email::Sender. The web processes also run in an environment without access to sendmail. Net::SMTP does not support Transport Layer Security (TLS). Googling around I found a “Simple SMTP client with STARTTLS and AUTH support” by Michal Ludvig: Command line SMTP client.
On my Mac OS 10.4 system at home, I wasted a lot of time trying to install Bundle::CPAN. Gaaah! Some dependencies were not automatic, but a few good invocations of `reports` on the CPAN command-line followed by manual installation of the missing package did the job.
I also needed to install IO::Socket::SSL with all its dependencies. Yuck! And it turns out that there is a dependency on Net::SSLeay, which needs a C compiler to build.
Thus, the command-line script will also not do for me!
In the end, I think I will ask them to install libemail-send-perl and libnet-smtp-ssl-perl for Email::Send and Net::SMTP::SSL; there is also Email::Send::Gmail but no corresponding Debian package. We’ll see; I might get it to work without.
Anyway, I decided to invest some time into coding an Oddmuse extension. I was all enthusiastic about it. But now I spent hours fooling around with Perl installations and test programs, I think I will stop it now and read a book or something.
Bummer.
Thinking about it some more, sending mail after an edit might work for comment submission on comment pages, but it will never work for edits to ordinary pages. So right now I’m working on code that lets me subscribe and unsubscribe from pages, and a computer-readable output of said data. Then I will use a cron-job to send the appropriate emails.
#Oddmuse #Perl #Mail