mhonarc-users

Re: Notify sender about URL

1999-08-03 16:47:42
On July 30, 1999 at 08:46, "Bert Hiddink" wrote:

Would it be possible to notify a subscriber everytime he/she sends a 
message to a mailinglist, indicating where his/her message was 
published by Mhonarc on the web?

Many things are possible, it is just matter if they are practical :-)

    "Your message was published at:
    http://www.site.net/mailinglist/msg00897.html

To send he/she an autoresponder would be more a task for Procmail, I 
suppose but I would need then to include in this respons the 
%messagenumber which is a Mhonarc variable.

First, I have to question the usefulness of such an auto-response.
It could get annoying.

With that said, a solution is to access some of the guts of mhonarc
with a custom front-end that can return the filename of the messages
that were added.

New messages are denoted by the %mhonarc::AddIndex hash.  You
could create your own variation of mhonarc as follows:

MAIN: {
    require 'mhamain.pl';
    mhonarc::initialize();

    if (mhonarc::process_input()) {
        foreach (keys %mhonarc::AddIndex) {
            print "File added: ", mhonarc::get_filename_from_index($_), "\n";
        }
        exit(0);  # All is well
    }

    ## Get here, some error occurred
    exit($mhonarc::CODE);
}

Note, this will only generate filename output when ADD (-add) mode is
active.  Make sure to give a different name for your custom version of
mhonarc.

You can now parse stdout from mhonarc to extract the filename(s) so
you can generate your auto-reply.

        --ewh

<Prev in Thread] Current Thread [Next in Thread>