--- trunk/sender.pl 2005/05/16 22:32:58 32 +++ trunk/sender.pl 2005/05/17 21:37:06 38 @@ -40,7 +40,6 @@ "inbox=s" => \$opt->{'inbox'}, "debug" => \$debug, "verbose" => \$verbose, - "email=s" => \$opt->{'email'}, ); my $nos = new Nos( @@ -83,12 +82,12 @@ die "need e-mail address for list (as argument or on STDIN)\n" unless ($email); - my $l = $nos->_get_list($list_name) || $nos->_add_list( + my $id = $nos->new_list( list => $list_name, email => $email, ) || die "can't add list $list_name\n"; - print "added list $list_name with ID ",$l->id,"\n"; + print "added list $list_name with ID $id\n"; =item --list[=list_name] @@ -127,9 +126,6 @@ email@example.com Optional full name of person dpavlin@rot13.org Dobrica Pavlinusic -You may use C<--email> parametar at any time to set From: e-mail address for list. -B. - =cut } elsif ($list_name = $opt->{'add'}) { @@ -190,7 +186,7 @@ my $msg = $m->message_id->message; $msg =~ s/\s+/ /gs; - $l .= sprintf(" %-10s %15s : ", $m->list_id->name, $date); + $l .= sprintf(" %-15s %15s : ", $m->list_id->name, $date); $l .= substr($msg, 0, 79 - length($l)); print "$l\n"; @@ -217,9 +213,18 @@ =cut -} elsif ($opt->{'inbox'}) { +} elsif ($list_name = $opt->{'inbox'}) { + + my $message; + while(<>) { + $message .= $_; + } + + $nos->inbox_message( + list => $list_name, + message => $message, + ) || die "can't receive message for list $list_name"; - warn "inbox option is not implemented"; } else { die "see perldoc $0 for help\n"; @@ -241,10 +246,6 @@ Dump more info on screen. -=item --email - -Used to specify e-mail address where needed. - =back