The faulty default

26.04.2010 12:34

In case anyone else is trying to use mlmmj mailing list manager in a procmail rule. You have to unset the DEFAULT environment variable in your procmailrc before calling mlmmj-recieve. For example, like this:

DEFAULT

:0w
|/usr/bin/mlmmj-recieve -F -L $MLMMJ_SPOOL_DIR/$LOCAL_PART

The idea is that DEFAULT is set automatically by procmail and contains a path to the default mailbox. On the other hand the same environment is for some reason used by mlmmj as an override for the LOCAL_PART_SUFFIX or Delivered-To: header.

In the most well respected tradition of broken software, neither the procmail nor mlmmj behavior is documented. In fact the procmail man page specifically says that DEFAULT is NOT SET automatically when -m option is used. And the reason for the fault is in no way apparent from error messages from mlmmj, which send you on a wild goose chase through the system.

Oh, and by the way, the binary really is called mlmmj-recieve, not mlmmj-receive.

Posted by Tomaž | Categories: Code

Comments

It might not be well documented, but mlmmj uses DEFAULT because qmail sets that environment variable.

/* address extension (the "foo" part of "user+foo@domain.tld") */
if((envstr = getenv("DEFAULT")) != NULL) {
/* qmail */
recipextra = mystrdup(envstr);
} else if((envstr = getenv("EXTENSION")) != NULL) {
/* postfix */
recipextra = mystrdup(envstr);
} else if((envstr = getenv("LOCAL_PART_SUFFIX")) != NULL) {
/* exim */
listdelim = getlistdelim(listdir);
...

Posted by Morten Shearman Kirkegaard

Add a new comment


(No HTML tags allowed. Separate paragraphs with a blank line.)