Name
CatalystX::Usul::MailAliases - Manipulate the mail aliases file
Version
0.3.$Revision: 584 $
Synopsis
use CatalystX::Usul::MailAliases;
$alias_obj = CatalystX::Usul::MailAliases->new( $app, $config );
Description
Management model file the system mail alias file
Subroutines/Methods
new
Sets these attributes:
- aliases_file
-
The real mail alias file. Defaults to /etc/mail/aliases
- commit
-
Boolean indicating whether source code control tracking is being used. Defaults to false
- file
-
Path to the copy of the aliases file that this module works on. Defaults to aliases in the ctrldir
- prog
-
Path to the appname_misc program which is optionally used to commit changes to the local copy of the aliases file to a source code control repository
- new_aliases
-
Path to the
newaliases
program that is used to update the MTA when changes are made - suid
-
Path to the
suid
root wrapper program that is called to enable update access to the real mail alias file
create
$alias_obj->create( $fields );
Create a new mail alias. Passes the fields to the suid
root wrapper on the command line. The wrapper calls the "update_file" method to get the job done. Adds the text from the wrapper call to the results section on the stash
delete
$alias_obj->delete( $name );
Deletes the named mail alias. Calls "update_file" via the suid
wrapper. Adds the text from the wrapper call to the results section on the stash
retrieve
$response_obj = $alias_obj->retrieve( $name );
Returns an object containing a list of alias names and the fields pertaining to the requested alias if it exists
update
$alias_obj->update( $fields );
Update an existing mail alias. Calls "update_file" via the suid
wrapper
update_file
$alias_obj->update_file( $alias, $recipients, $owner, $comment );
Called from the suid
root wrapper this method updates the local copy of the alias file as required and then copies the changed file to the real system alias file. It will also run the newaliases
program and commit the changes to a source code control system if one is being used
_init
Initialises these attributes in the object returned by "retrieve"
- aliases
-
List of alias names
- comment
-
Creation comment associated with the selected alias
- created
-
Date the selected alias was created
- found
-
Boolean indicating whether the selected alias was found in the alias file
- owner
-
Who created the selected alias
- recipients
-
List of recipients for the selected owner
_read_file
Reads the local copy of the mail alias file with locking
Diagnostics
None
Configuration and Environment
None
Dependencies
Incompatibilities
There are no known incompatibilities in this module
Bugs and Limitations
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Author
Peter Flanigan, <Support at RoxSoft.co.uk>
License and Copyright
Copyright (c) 2008 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE