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:

||./wrapper

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=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>:
 Invalid address.
Jun 27 14:51:08 dali courierlocal: 
id=000AE704.3D1B0976.00005192,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,status:
 deferred

The wrapper looks like this:

#!/usr/bin/python2.1
import os, string
ext = os.environ['EXT']
mlm = '|/usr/lib/courier/bin/couriermlm'
sendmail = '|/usr/lib/courier/bin/sendmail'
owneraddress = '[EMAIL PROTECTED]'
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,'-')[0]
else:
  # address has no special actions, so likely a list
  # dispatch to list
  command = mlm + ' msg ' + ext
print command

-- 
Anand Buddhdev
http://anand.org


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to