Once again - thanks for being so patient :-)

My fault . My script is written in Perl so need to change the $1 to $ARGV[0] 
then
It worked.


Best regards

Peter

-----Oprindelig meddelelse-----
Fra: Mark Sapiro [mailto:[email protected]] 
Sendt: 21. februar 2012 18:10
Til: Peter Sørensen
Cc: [email protected]
Emne: Re: [Mailman-Users] run script when virtual-mailman is updated

On 2/21/2012 12:25 AM, Peter Sørensen wrote:
> Thanks Mark - exactly what I needed. Not quite sure on the $1.
> This I could'nt make work. 


Mailman invokes the POSTFIX_MAP_CMD command with one argument equal to the path 
to the virtual-mailman file. The intent is that this will run

/usr/sbin/postmap /path/to/data/virtual-mailman

which will update virtual-mailman.db with the changed virtual-mailman.
Presumably, when you replace /usr/sbin/postmap with /path/to/your/script, you 
still want virtual-mailman.db to be updated so you need

/usr/sbin/postmap $1

somewhere in your script so when Mailman invokes

/path/to/your/script /path/to/data/virtual-mailman

The $1 inside the script is replaced with the first argument and the script runs

/usr/sbin/postmap /path/to/data/virtual-mailman

You could of course hard code the path to virtual-mailman in the postmap 
command in your script instead of using $1 to get it from the invoking command, 
but the $1 is more general.

If it failed when you tested your script by hand, that is because you didn't 
invoke the script with the /path/to/data/virtual-mailman argument as Mailman 
does.

-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list [email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to