I'm trying to make it easy to manage mailing lists on my server. I have
created a user called "list" who managed all lists.
In order to avoid creating 3 .courier files for each list created,
I decided to create a single .courier-default file as follows:
The wrapper script is a little program that looks at the environment
variables and prints out the appropriate couriermlm command, which courier
is then supposed to execute. For example, if I send email to anand-help@,
then the wrapper print out:
|/usr/lib/courier/bin/couriermlm ctlmsg anand
But when I try to run this, I get deferrals with the following log entry:
Jun 27 14:51:08 dali courierlocal: id=000AE704.3D1B0976.00005192,from=<ana...@celtelplus.com>,addr=<list...@dali.celtelplus.com>: Invalid address.
Jun 27 14:51:08 dali courierlocal: id=000AE704.3D1B0976.00005192,from=<ana...@celtelplus.com>,addr=<list...@dali.celtelplus.com>,status: deferred
The wrapper looks like this:
import os, string
ext = os.environ['EXT']
mlm = '|/usr/lib/courier/bin/couriermlm'
sendmail = '|/usr/lib/courier/bin/sendmail'
owneraddress = 'post...@celtelplus.com'
if os.environ['EXT2'] == 'owner':
# dispatch to list owner
command = sendmail + ' -f "' + os.environ['SENDER'] + '" ' + owneraddress
elif '-' in ext:
# dispatch to list controller
command = mlm + ' ctlmsg ' + string.split(ext,'-')
# address has no special actions, so likely a list
# dispatch to list
command = mlm + ' msg ' + ext