Lyris User's Guide
[previous] [next] [contents]
How can I extend Lyris List Manager with my own programs?
Table of Contents
· Introduction
· Email Commands
· Web Interface for Users
· Server Administrator
· Site Administrator
· List Administrator
· Other Topics
· Add-On Packages
· Installing and Upgrading
· Appendix
· Frequently Asked Questions
· · DocBots
· · Running Lyris List Manager
· · Email
· · · How can I extend Lyris List Manager with my own programs?
· · · How can I be certain my Email Messages were delivered?
· · · What Email Commands does Lyris List Manager support?
· · · Why does Lyris List Manager not use Sendmail?
· · · How do I subscribe people automatically?
· · Lyris List Manager Administration
· · Web Browsers
· · Usenet Newsgroups
· · International
· · Other FAQ issues
· · Mailing List Features
· · Perl/LCP Toolkit
· · Unix Administration

How can I extend Lyris List Manager with my own programs?

Lyris List Manager allows you to add your own programs into the Lyris List Manager execution stream. Extensions can be added to action phrases, auto-responders, list postings, and the lyris@ list manager address.

Your scripts can let the normal Lyris List Manager 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 autoresponder 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 Lyris List Manager 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 Lyris List Manager, you need to tell Lyris List Manager when you want it to run your program. In the configuration screens for Action 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 Lyris List Manager 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 an action-phrase extension, your script will be run any time the action 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 action phrase saw them. Note: Action phrases can be attached to auto-responders, list postings, and the lyris@ address, that multiple scripts can be run. For instance, if you have an action phrase extension, and an auto-responder extension, if the action 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 list manager commands, which Lyris List Manager does.

You can write your script using any programming language, though we recommend using a language that has access to the Lyris List Manager API, such as Perl or C/C++. When Lyris List Manager runs your script, it passes the Incoming Message ID of the message in question through the environment variable MESSAGEID. You also have the option of specifying 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 (as well as over the environment variable MESSAGEID).

Normally, your script will use the Message ID to load the message in question, and perform some action. By default, when your program exits, Lyris List Manager will continue processing the message. However, if you want Lyris List Manager 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);

Your Lyris List Manager installation includes a sample extension script, written in perl, with the filename "lyrext.pl". By default, it is located in your ~/lyris/scripts directory. It is a minimal script that loads the fields for the message in question, displays the fields on the screen, and optionally deletes the message to stop the normal message processing.

Other pages which link to this page:
  • Run program before lyris@
  • Run program after lyris@
  • Run a program before Phrase
  • Run a program after Phrase
  • Run a program before Auto-Responder
  • Run a program after Auto-Responder
  • Run a program before Posting
  • Run a program after Posting
  • Before Subscribing
  • After Subscribing
  • Before Unsubscribing
  • After Unsubscribing
  • New in Version 2.5
  • New in Version 2.0
  • Email
  • Page 591 of 629