Chad Perrin <code / apotheon.net> wrote:
> On Tue, Apr 22, 2014 at 09:33:03PM +0000, Eric Wong wrote:
> > Chad Perrin <code / apotheon.net> wrote:
> > 
> > You could probably have most of your logic in the Sinatra app, and have
> > whatever MDA you use call "curl -T" to have your Sinatra webserver
> > process the PUT request.
> 
> I guess I'll have to look into how specifically I would do that.

For postfix, whatever script as mailbox_command will do in main.cf
	mailbox_command = /path/to/script
	(this is where procmail traditionally hangs)
----------------------------------------
#!/bin/sh
set -e
query=... # take relevant values from env
TMPMSG="$(mktemp -t msg.$USER.XXXXXX)"
cat > "$TMPMSG" # read stdin from postfix
curl -T "$TMPMSG" http://...$query
rm -f "$TMPMSG"
----------------------------------------
You could avoid the temporary file with "curl -T-" if your HTTP server
handles "Transfer-Encoding:chunked", even.  You could also do the
above in Ruby, of course.

Several years ago, I replaced procmail on my system with a small
shell script which might be useful as a reference:
  http://bogomips.org/public-inbox.git/plain/scripts/dc-dlvr
(I don't use curl in there, but the curl use above is analogous
 to spamc+spamd)

> > Wow, I didn't see Lamson's license changes until now.  Eeep!
> > (Disclaimer: I love copyleft, though).
> 
> It shouldn't matter whether you "love copyleft" -- the Lamson license is
> about nine kinds of awful.  It makes the WotC migration from Open Game
> License to Game System License look almost benign by comparison.

Yeah, I was under the impression it was (still) GPLv3, but it changed to
BSD and then BSD+OMFG-this-is-terrible-clause :(

I hadn't paid attention to Lamson in ages and librelist service is
spotty enough that I'll probably move all the ones I maintain to
public-inbox instances.