--- trunk/sender.pl 2005/05/18 09:46:49 42 +++ trunk/sender.pl 2005/05/24 15:19:44 48 @@ -19,7 +19,8 @@ In C something like: - mylist: "| /path/to/sender.pl --inbox=mylist" + mylist: "| cd /path/to && ./sender.pl --inbox=mylist" + mylist-bounce: "| cd /path/to && ./sender.pl --inbox=mylist --bounce" =head2 Command options @@ -40,6 +41,9 @@ "inbox=s" => \$opt->{'inbox'}, "debug" => \$debug, "verbose" => \$verbose, + "from=s" => \$opt->{'from'}, + "driver=s" => \$opt->{'email_send_driver'}, + "bounce" => \$opt->{'bounce'}, ); my $nos = new Nos( @@ -73,6 +77,9 @@ Adds new list. You can also feed list name as first line to C. +You can also add C<--from='Full name of list'> to specify full name (comment) +in outgoing e-mail. + =cut if ($list_name = $opt->{'new'}) { @@ -84,6 +91,7 @@ my $id = $nos->new_list( list => $list_name, + from => ($opt->{'from'} || ''), email => $email, ) || die "can't add list $list_name\n"; @@ -111,8 +119,8 @@ foreach my $list (@lists) { print $list->name," <",$list->email,">\n"; - foreach my $user_on_list ($user_list->search(list_id => $list->id)) { - print "\t",$user_on_list->user_id->full_name," <", $user_on_list->user_id->email, ">\n"; + foreach my $u ($nos->list_members( list => $list->name )) { + print "\t",$u->{'name'}, " <", $u->{'email'}, ">\n"; } } @@ -199,17 +207,23 @@ Send e-mails waiting in queue, or with optional argument, just send messages for single list. +Optional argument C<--driver=smtp> forces sending using SMTP server at +localhost (127.0.0.1). + =cut } elsif (defined($list_name = $opt->{'send'})) { - $nos->send_queued_messages($list_name); + $nos->send_queued_messages($list_name, $opt->{'email_send_driver'}); =item --inbox=list_name Feed incomming message back into notice sender. +Optional argument C<--bounce> define that this message is received to +bounce address. + =cut } elsif ($list_name = $opt->{'inbox'}) { @@ -222,6 +236,7 @@ $nos->inbox_message( list => $list_name, message => $message, + bounce => $opt->{'bounce'}, ) || die "can't receive message for list $list_name";