|
CfgTie::TieAliases -- an associative array of mail aliases to targets |
CfgTie::TieAliases -- an associative array of mail aliases to targets
Makes it easy to manage the mail aliases (/etc/aliases) table as a hash.
tie %mtie,'CfgTie::TieAliases'
#Redirect mail for foo-man to root
$mtie{'foo-man'}=['root'];
This Perl module ties to the /etc/aliases file so that things can be updated on the fly. When you tie the hash, you are allowed an optional parameter to specify what file to tie it to.
tie %mtie,'CfgTie::TieAliases'
or
tie %mtie,'CfgTie::TieAliases',I<aliases-like-file>
or
tie %mtie,'CfgTie::TieAliases',I<revision-control-object>
ImpGroups will import the various groups from /etc/group using
CfgTie::TieGroup. It allows an optional code reference to select which
groups get imported. This code is passed a reference to each group and needs
to return nonzero if it is to be imported, or zero if it not to be imported.
For example:
(tied %mtie)->ImpGroups
{
my $T=shift;
if ($T->{'id} < 100) {return 0;}
return 1;
}
The format of the /etc/aliases file is poorly documented. The format that
CfgTie::TieAliases understands is documented as follows:
#comments#) to the end of the line is treated as a
comment, and ignored.
::include:file:include: indicates that the
specified file should be read from. The file may only specify user names or
email addresses. Several include directives may used in the aliase. It is not
clear which of these files is the preferred file to modify.
Not all changes to are immediately reflected to the specified file. See the the CfgTie::Cfgfile manpage module for more information
/etc/aliases
the CfgTie::Cfgfile manpage, the CfgTie::TieRCService manpage, the CfgTie::TieGeneric manpage, the CfgTie::TieGroup manpage, the CfgTie::TieHost manpage, the CfgTie::TieNamed manpage, the CfgTie::TieNet manpage, the CfgTie::TiePh manpage, the CfgTie::TieProto manpage, the CfgTie::TieServ manpage, the CfgTie::TieShadow manpage, the CfgTie::TieUser manpage
aliases(5) newaliases(1)
Randall Maas (randym@acm.org, http://www.hamline.edu/~rcmaas/)
|
CfgTie::TieAliases -- an associative array of mail aliases to targets |