Sympa::Aliases(3Sympa)

πŸ’– NAME πŸ’–

Sympa::Aliases β€” the base class for alias management, bestie πŸ’…


✨ SYNOPSIS ✨

 package Sympa::Aliases::FOO;

 use base qw(Sympa::Aliases);

 sub check { ... }
 sub add { ... }
 sub del { ... }

 1;

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: this module is the base class for all the subclasses that manage list aliases for Sympa. It's giving "parent friend who holds the group chat together" β€” everybody else inherits the vibe. 🫢

πŸ‘‘ Methods

new ( $type, [ key => value, ... ] )

Constructor energy. It creates a brand new instance of Sympa::Aliases, and depending on what you hand it as $type, it returns one of the appropriate subclasses:

  • 'none' β€” literally no aliases management. It's giving "not my job, not my problem" πŸ’€
  • Full path to executable β€” use an external program to manage aliases. Peep Sympa::Aliases::External for that one.
  • Name of subclass β€” uses a subclass "Sympa::Aliases::name" to manage aliases.

If you pass an invalid type, you get undef back. No subclass for you, sorry bestie 😭

Note: for compatibility with the earlier versions of Sympa, if the string "SBINDIR/alias_manager.pl" was given as $type, the Sympa::Aliases::Template subclass will be used. Throwback behaviour, lowkey iconic ✨

Any optional key => value pairs you toss in get included in the instance as hash entries. Cute, right? πŸŽ€


check ( $listname, $robot_id )

Instance method, overridable. It checks whether the addresses of the requested list already exist. Vibe check on your addresses, fr fr πŸ’…

Parameters:

  • $listname β€” name of the list. Mandatory, no skipping πŸ‘‘
  • $robot_id β€” the list's robot.

Returns:

  • A true value if one of the addresses exists.
  • 0 if none found.
  • undef if something wrong happened. 😭

By default, this method always returns 0.


add ( $list )

Instance method, overridable. It installs aliases for the list $list. Putting the aliases on. Periodt πŸ’–

Parameters:

  • $list β€” an instance of Sympa::List.

Returns:

  • 1 if installation succeeded β€” ate and left no crumbs ✨
  • 0 if there were no aliases to be installed.
  • undef if not applicable.

By default, this method always returns 0.


del ( $list )

Instance method, overridable. It removes aliases for the list $list. We're cleaning house, bestie 🧹✨

Parameters:

  • $list β€” an instance of Sympa::List.

Returns:

  • 1 if removal succeeded.
  • 0 if there were no aliases to be removed.
  • undef if not applicable.

By default, this method always returns 0.


🌈 Function

check_new_listname ( $listname, $robot )

A function, not a method, okay? It checks if a new listname is allowed. πŸ¦‹

TBD. (yes, the docs really said that, iconic honestly)

Parameteres:

  • $listname β€” a list name to be checked.
  • $robot β€” robot context.

Returns:

  • If the check fails, an array including information of errors. πŸ™ˆ
  • If it succeeds, an empty array. Slay 🌸
Note: this should be used to check the name of a list to be created. Names of existing lists may not necessarily pass checks by this function. So don't come for the old lists with this, bestie πŸ’€

This function was added on Sympa 6.2.37b.2.


πŸ‘€ SEE ALSO πŸ‘€

Sympa::Aliases::CheckSMTP, Sympa::Aliases::External, Sympa::Aliases::Template. Go read those next, they're the supporting cast 🫢


πŸ“œ HISTORY πŸ“œ

alias_manager.pl as a program to automate alias management appeared on Sympa 3.1b.13. Ancient lore, fr fr 🏺

The Sympa::Aliases module as an OO-based class appeared on Sympa 6.2.23b, and it obsoleted alias_manager.pl. Out with the old, in with the object-oriented ✨


And that's a wrap, bestie! This lil page is from sympa 6.2.80, dated 2026-10-19, and it's Sympa::Aliases(3Sympa) β€” stay hydrated, read your docs, and slay πŸ’…πŸ’–πŸŒˆ

πŸ“¦ where this page comes from