Why not adopt me?
NAME
App::Addex::Apple - create mail helper files from Apple Address Book
VERSION
version 0.001
$Id: /my/cs/projects/App-Addex/trunk/lib/App/Addex/Apple.pm 31044 2007-03-22T00:38:54.272282Z rjbs $
SYNOPSIS
This module iterates through all the entries in an Apple Address Book and produces configuration files for mutt, procmail, and spamassassin based on that data.
It is meant to be run with the aaabook command, which is bundled as part of this software distribution.
METHODS
Achtung! The API to this code may very well change. It is almost certain to be broken into smaller pieces, to support alternate sources of people, and it might just get plugins.
new
my $addex= App::Addex::Apple->new(\%arg);
This method returns a new Addex.
Valid paramters are:
muttrc - the file name to which to output mutt configuration
procmailrc - the file name to which to output procmail configuration
whitelists - the file name to which to output spamassassin whitelists
At least one of these three parameters must be given or an exception will be thrown.
_glue
my $glue = $abook->_glue;
This method returns the Mac::Glue "glue" for the Apple Address book.
muttrc
procmailrc
whitelists
These methods return the names of the files to which configuration will be written, if any.
muttrc_line
procmailrc_line
whitelists_line
$abook->muttrc_line($line);
These methods text to the correct configuration file, appending a trailing newline.
asciify
my $ascii_string = $abook->asciify($string);
This method converts a string to seven bit ASCII text, in theory. In reality it is terrible and needs to be fixed or eliminated.
aliasify
my $alias = $abook->aliasify($string);
Given a string containing a name or nickname, this routine returns a new, derived string that can be used (in mutt) as a one-word alias for the name.
people
my @people = $abook->people;
This method returns the people in the address book.
They're currently returned as a list of hashrefs, but this is likely to change.
run
App::Addex::Apple->new({ ... })->run;
This method performs all the work expected of an Addex: it iterates through the people, writing the relevant information to the relevant files.
Generally, this consists of:
mutt configuration
If requested, the muttrc file will contain a list of alias lines. The first email address for each person will be aliased to the person's aliasified nickname and name. Every other address will be aliased to one of those with an appended, incrementing counter. The person's name is added as the alias's "real name."
If the person has a "folder" value (given as a line in the card's "notes" that looks like "folder: value") a save-hook is created to save mail from the person to that folder and a mailboxes line is created for the folder. If the person has a "sig" value, a send-hook is created to use that signature when composing a message to the person.
procmail configuration
If requested, the procmailrc file will contain a list of simple recipies, filtering mail from any one of a person's addresses to his "folder" value (see above). People without "folder" settings do not appear in the created procmail configuration.
whitelists
If requested, the whitelists file will contain a list of whitelist_from
lines, whitelisting each email address seen in the address book.
AUTHOR
Ricardo SIGNES, <rjbs@cpan.org>
BUGS
Please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT
Copyright 2006-2007 Ricardo Signes, all rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.