How can I extend ListManager with my own programs?

 

ListManager allows you to add your own programs into the ListManager execution stream. Extensions can be added to match phrases, auto-responders, list postings, and the lyris@ ListManager address.

 

Your scripts can let the normal ListManager execution stream continue, or they can interrupt it.

 

For example, you can write an extension that logs each use of an auto-responder. This would allow you to keep track of when people received information, and you could this information to follow up with them. Or, perhaps your auto-responder is programmed to send one document to people inside your company and another document to people outside your company. In such a case, your program would actually replace the default auto-responder behavior.

 

Another use of technology would be to extend the checking ListManager does on list postings. For example, your script might count the number of greater-than symbols, (">") which indicate message quoting, and refuse messages postings where the bulk of the posting is a quote of someone else's message.

 

To add your own extensions to ListManager, you need to tell ListManager when you want it to run your program. In the configuration screens for Match Phrases and Auto-Responders, List Settings and Server Settings, there are two fields for extension scripts. This gives you the option to run a script before the default ListManager action takes place, and to run a script after the action has taken place.

 

With an auto-responder extension, your script will be run any time an email message comes in to the auto-responder's email address. This is similar to adding a program to the Sendmail "aliases" file.

 

With a match phrase extension, your script will be run any time the match phrase is found in the context it is defined for. For example, you could trap for offensive words in a message posting to your list, and your script would be run when the match phrase saw them. Note: Match phrases can be attached to auto-responders, list postings, and the lyris@ address, so that multiple scripts can be run. For instance, if you have a match phrase extension, and an auto-responder extension, if the match phrase is found on that auto-responder, it will run, and then the auto-responder extension will run.

 

With a List extension, your script is run any time a posting is made to the mailing list. Your can prevent the list posting from being accepted by deleting it before the default action is taken.

 

With a lyris@ extension (set in the server configuration page), you can add your own processing to the processing of ListManager commands, which ListManager does.

 

You can write your script using any programming language, though we recommend using a language that has access to the ListManager API, such as Perl or C/C++. You will need to pass the Message ID over the command line, by specifying $MESSAGEID on in your extension command line. So, for instance, if you are on Windows, and have a Perl script named "lyrext.pl" that you want to run, your command line might be:

c:\perl5\bin\perl.exe c:\scripts\lyrext.pl $MESSAGEID

 

This runs the Perl interpreter (perl.exe) against your lyrext.pl script, and passes the Incoming Message ID on the command line.

 

Normally, your script will use the Message ID to load the message in question, and perform some action. By default, when your program exits, ListManager will continue processing the message. However, if you want ListManager to stop processing the message after your script has run, you should delete the Message. In Perl, this is done with the command &InMailDelete($MessageID);

 

For more information about programming and ListManager, see the Programmer's Guide at http://www.lyris.com/lm_guide/.

 

More

 

1. How Can I Extend Lyris ListManager With My Own Programs?

2. How Do I Validate Email Addresses In My Perl Programs

3. Customizing the ListManager Web Interface

 



Duplicate Messages How Do I Validate Email Addresses In My Perl Programs