Mail::Alias - Maniulates mail alias files of various formats. Works on files directly or loads files into memory and works on the buffer.
Mail::Alias can read various formats of mail alias. Once an object has been created it can be used to expand aliases and output in another format.
- new () Alias objects can be created in two ways; With a format specified- Mail::Alias::Sendmail->new([filename]) Without a format specified- Mail::Alias->new([filename]}. Format defaults to SENDMAIL In either case, the filename is optional and, if supplied, it will be read in when the object is created. Available formats are Sendmail, Ucbmail, and Binmail.
- read () Reads an alias file of the specified format into memory. Comments or blank lines are lost upon reading. Due to storage in a hash, ordering of the alias lines is also lost.
- write () The current set of aliases contained in the object memory are written to a file using the current format. If a filehandle is passed, data is written to the already opened file. If a filename is passed, it is opened and the memory is written to the file. Note: if passing a filename, include the mode (i.e. to write to a file named aliases pass >aliases). Before writing, the alias lines are sorted alphabetically.
- format () Set the current alias file format.
- exists () Indicates the presence of the passed alias within the object (if using memory access), or the current aliases file (if using direct file access). For direct file access, the return value is the address string for the alias.
- expand () Expands the passed alias into a list of addresses. Expansion properly handles :include: files, recursion, and continuation lines.Only works when memory access is being used. If the alias is not found in the object, you get back what you sent.
- alias_file () Sets or gets the name of the current alias filename for direct access.
- append () *-Sendmail only-* Adds an alias to an existing Sendmail alias file. The alias and addresses can be passed as two separate arguments (alias, addresses) or as a single line of text (alias: addresses)
- delete () *-Sendmail only-* Deletes the entry for an alias from the current alias file.
- update () *-Sendmail only-* Replaces the address string entry for an alias in the current alias file.
- usemem () Sets the working mode to use memory (indirect access). Use read(), write() and format() methods.
- usefile () Sets the working mode to use files (direct access). Use append() and delete() methods.
Tom Zeltwanger <firstname.lastname@example.org> (CPAN author ID: ZELT)
Copyright (c) 2000 Tom Zeltwanger. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Versions up to 1.06, Copyright (c) 1995-1997 Graham Barr. All rights reserved. This program is free software; you can distribute it and/or modify it under the same terms as Perl itself.