Forum OpenACS Development: Re: Incoming email handling

Collapse
Posted by Sean Redmond on

It will then send the mail to OpenACS, either with a HTTP POST or an XML-RPC call. (Possibly it could also put the mail contents directly into the database with nstcl. However this would not be very different from the next approach.)

Why use something like an HTTP POST instead of having the script insert the data itself, via DBI, for instance if it's a Perl script? (I guess nstcl-database is the equivalent of Perl's DBI, but I'm willing to bet that even in the OACS community a lot more people are familiar with the basic Perl modules.) I've done this on a couple of occasions for an intranet, giving the script a different DB user with just as much read and write privilege as it needs to do it's job. It's a lot easier to install, debug and enhance, and it adds hardly any complexity proportional to the overall complexity of OACS. It is also more Unix-y (it conforms to the rules of modularity, clarity, simplicity and separation, and I would argue also of parsimony, transparency, robustness, least surprise and diversity)

Also, instead of .qmail-default which will handle any otherwise unhandled address, you should use a more specific alias, e.g. .qmail-blogger (which would handle only emails to blogger@whatever.com). This leaves open the possibility of using other addresses for other purposes, and using subaliases, such as blogger-bob or blogger-alice, which would both be handled by .qmail-blogger, but the script would know that one was intended for Bob's blog and one for Alice's (à la ezmlm), without having to set up any mailboxes (not even the one required to use a sweeper.)

I'm curious about the "many hours of frustration with qmail" since I've found it to be about the least frustrating piece of software ever (no experience with vpopmail, though).

Collapse
Posted by Guan Yang on

Sean: It would of course be possible to have the incoming email handler put the contents directly into the database. Perhaps that's a better way of implementing it. I just thought that using HTTP POST or XML-RPC would involve slightly fewer dependencies for the script. A pure Perl implementation is easier to install than having to compile/link database libraries. For example Oracle client libraries are a bit hairy to link against.

Regarding the dot-qmail files, that should be up to the user/administrator and would depend on the application. On some sites you would obviously want more granular control of what email goes where. If you were implementing OpenACS Webmail (there was actually a webmail package for ACS Classic once) you would use a .qmail-default file. But using .qmail-default does not preclude the possibility of having other .qmail files; .qmail-blah-default would IIRC override .qmail-default.

I agree that qmail is a breeze to install and administer. But let's not turn this into a mail server flamewar 😉. Both of the approaches I've outlined work equally well with all mail servers (I think; if that turns out not to be the case, then start the flamewar).

Collapse
Posted by Sean Redmond on

I certainly don't mean to open a flame war! I'm just wondering if people think the sweeper approach is easier because they had trouble configuring qmail, when their trouble with qmail could easily be cleared up. Delivering mail to a script is so easy and reliable (from the perspective of the MTA) that, to me, setting a mailbox and having a sweeper read the mail like a human would, just faster, seems like a hopeless kludge.