| Perlbug documentation | view source | Contained in the Perlbug distribution. |
Perlbug::Interface::Email - Email interface to perlbug database.
Email interface to perlbug database.
use Perlbug::Interface::Email;
use Mail::Internet;
my $o_int = Mail::Internet->new(*STDIN);
my $o_email = Perlbug::Interface::Email->new;
my $call = $o_email->switch($o_int);
my $result = $o_email->$call($o_int);
print $result; # =1 (hopefully :-)
Create new Perlbug::Interface::Email object:
my $o_email = Perlbug::Interface::Email->new();
Given a mail (Mail::Internet) object, parses it into command hash,
Checks the header for X-Perlbug loop and the address of the sender via check_user(), calls input2args(). Replaces switch().
my $h_cmds = $o_email->parse_input($Mail::Internet->new(\$STDIN)));
Wrap email message options
my $wanted = $o_email->return_type($cmd);
Take given input, command and email object, and translate to appropriate format.
Handles opts(...) in $str
my $cmd_args = $o_email->input2args($cmd, $str, \%inf);
Process email given, return results via email when /bugdb/ in address.
my @res = $o_email->process_commands($h_cmds, $o_int);
Get new perlbug Mail::Header, filled with appropriate values, based on given header.
my $o_hdr = $o_email->get_header(); # completely clean my $o_hdr = $o_email->get_header($o_old_header, 'default');# default (coerced as from us) my $o_hdr = $o_email->get_header($o_old_header); # as default my $o_hdr = $o_email->get_header($o_old_header, 'ok'); # maintain headers (nearly transparent) my $o_hdr = $o_email->get_header($o_old_header, 'remap'); # maintain headers (nearly transparent)
Takes data ($a_stuff), which may be a ref to the result array, and mails
it to the From or Reply-To address, Cc:-ing it to any address given by the -e flag.
my $i_ok = $o_email->return_info($a_stuff, $o_int);
Switch mailing on(1) or off(0)
my $i_onoff = $o_mail->mailing(1);
Sort out the wheat from the chaff, use the first valid ck822 address:
my $from = $o_email->from($replyto, $from, @alternatives);
Returns obj and ids for any given email Message-Id line
my ($obj, $ids) = $self->messageid_recognised($messageid_line);
Checks (incoming) email header against our X-Perlbug flags, also slurps up the Message-Id for future reference.
my $i_ok = $o_email->check_incoming($o_hdr); #
Checks the address given (From usually) against the db_user table, sets user or admin access priviliges via the switches mechanism accordingly.
Returns admin name
my $admin = $o_email->check_user($o_int->('From')); # -> user_id || blank
Return email specific specification info
Appends a couple of extra email specific switches to Perlbug::Base::switches()
my @switches = $o_email->switches();
Operates on given tag, from bugdb@perl.org: we're sending this out from here.
Affects Message-Id(new), From(bugdb), Reply-To(maintainer) lines
Keeps Subject|To|Cc for later modification?
Filters anything else
my @lines = $o_email->default($tag, @lines);
my @lines = $o_email->ok($tag, @lines);
Operating on a given tag, remaps (To|Cc) -> forwarding address, removes duplicates.
Attempt to remain moderately invisible by maintaining all other original headers.
my @lines = $o_email->remap($tag, @lines); # _only_ if in target list!
Send a mail with protection.
my $i_ok = $o_email->send_mail($o_hdr, $body);
Add urls to header object for given target and id
my $o_hdr = $o_email->addurls($o_hdr, 'bug', $bugid);
Set mail defaults for _all_ mail emanating from here, calls trim_to().
my $o_hdr = $o_email->defense($o_hdr);
Takes the header and returns it without any dodgy to, or cc addresses (or undef):
my $o_hdr = $o_email->trim_to($o_hdr);
Operating on a single (or blank) address, returns a list of forwarding addresses.
my $to = $o_email->get_forward('perlbug@perl.org'); # perl5-porters@perl.org
my $to = $o_email->get_forward('perl-win32-porters@perl.org'); # perl-win32-porters@perl.org
my $to = $o_email->get_forward(); # perl5-porters@perl.org
my $to = $o_email->get_forward('unknown@some.addr');# perl5-porters@perl.org
my @to = $o_email->get_forward(); # perl5-porters@perl.org perl-win32-porters@perl.org etc...
Given a Mail::Header object attempts to return a valid create admin command
my $h_data = $o_email->header2admin($o_hdr);
Only handles (bugdb|perlbug)@perl.(com|org) and tracking addresses now.
parse_input() now wraps this method and should be called instead.
This returns any of (B|M|bounce|nocommand|quiet) and parsable relations.
my ($call, $opts) = $o_email->switch(Mail::Internet->new(\$STDIN);
Assign to this admin, so many, of these unclaimed bugs.
N.B. the claimed bugs are shifted off the end of the referenced array!
$i_ok = $o_email->assign_bugs($admin, 5, \@unclaimed);
Scan a typical *@bugs.perl.org header - instead of parse_input($subject).
my $h_cmd = $o_email->parse_header($o_hdr, $body);
To: line can be any of:
close_<bugid>_@bugs.perl.org = bug admin request register@bugs.perl.org = admin registration request admins@bugs.perl.org = admin mail forward
Subject: line may look like:
-h -o -H -d2 -l -A close 20000721.002 lib -r patch -e some@one.net
Unrecognised commands will be passed to bugmongers (should possibly return help instead?)
Checks given address against ok-to-be-administrator email address list
my $i_ok = $o_obj->in_master_list($address, [$list]);
Send out reminders to relevant parties for given bugid
my $i_ok = $o_email->reminder($bid, @addresses);
Deal with a new bug
my $bugid = $o_email->doB($h_args);
Mail me a copy of the latest database dump, with 8-figure time filter
my $i_ok = $o_email->doD([($date, $addr)]);
Send an email renotification(->p5p) about this data, as if the email was newly recieved.
my $i_ok = $o_obj->doE(\%input);
Wraps help message
my $help = $o_email->doh;
Returns more detailed help.
my $help = $o_email->doH;
Just test for a response
my @res = $o_email->doj(@args);
Deal with a bounced mail
my $bouncedbugid = $o_email->dobounce($h_args);
Deal with a mail with no commands found
my $reply = $o_email->donocommand($h_args);
Drop out quietly, no entry in database, silent dump into black hole;
my $i_ok = $o_email->doquiet($h_args);
Richard Foley perlbug@rfi.net 1999 2000 2001
| Perlbug documentation | view source | Contained in the Perlbug distribution. |