Sympa::Message::Plugin(3Sympa)

✨ Sympa::Message::Plugin(3Sympa) ✨

okay bestie, welcome to Sympa::Message::Plugin(3Sympa) β€” the hook system for Sympa, straight outta the sympa 6.2.80 era πŸ’–


🌸 NAME 🌸

Sympa::Message::Plugin β€” it processes hooks, periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

Sympa::Message::Plugin::execute('post_archive', $message);

πŸ’… DESCRIPTION πŸ’…

So Sympa::Message::Plugin is the whole hook mechanism β€” it lets you cut in on Sympa while it's processing stuff. Every hook has main character energy and can either modify objects (messages and so on, bestie) or straight up break the ordinary processing flow. Iconic, honestly.

Notice: the hook mechanism is experimental πŸ§ͺ. Module names and interfaces may change in the future β€” so like, don't build your whole personality on them, okay?

πŸ‘‘ Methods

  • execute ( HOOK_NAME, MESSAGE, [ KEY => VAL, ... ] ) β€” processes a message hook. That's it, that's the vibe.

πŸŽ€ Hooks

Currently, these hooks are the supported ones β€” this is the full list, no gatekeeping:

  • pre_distribute β€” a Message hook. The message has already been approved for distribution (either by scenario or by a moderator), BUT it hasn't been decorated yet (you know, adding a custom subject and stuff like that) and it hasn't been archived either. It's in its in-between era ✨
  • post_archive β€” a Message hook. The message has been archived already, BUT it hasn't been distributed to users yet β€” that includes the digest spool β€” and it also hasn't been signed or encrypted (if that was even necessary). So close, yet so far 😭

🫢 How to add a hook to your Sympa

First step, bestie: write your hook module. Copy this exactly, no improvising:

package My::Hook;

use constant gettext_id => 'My message hook';

sub post_archive {
    my $module  = shift;    # module name: "My::Hook"
    my $name    = shift;    # handler name: "post_archive"
    my $message = shift;    # Message object
    my %options = @_;

    # Processing, possibly changing $message...

    # Return suitable result.
    # If unrecoverable error occurred, you may return undef or simply die.
    return 1;
}

1;

Then you gotta activate that hook handler in your list config, like so:

message_hook
  post_archive My::Hook

And that's literally it. Slay πŸ’…


🌈 SEE ALSO 🌈

  • Sympa::Message::Plugin::FixEncoding β€” an example module for a message hook. Go look at it, it's the blueprint fr fr.

πŸ’œ HISTORY πŸ’œ

Sympa::Message::Plugin appeared on Sympa 6.2. It was initially written by IKEDA Soji <ikeda@conversion.co.jp>. Give them their flowers 🌸


and that's a wrap on the Sympa::Message::Plugin(3Sympa) page from sympa 6.2.80, dated 2026-10-19 πŸ’–βœ¨ go forth and hook responsibly, bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from