/[notice-sender]/trunk/sender.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/sender.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 33 by dpavlin, Tue May 17 11:09:08 2005 UTC revision 42 by dpavlin, Wed May 18 09:46:49 2005 UTC
# Line 40  my $result = GetOptions( Line 40  my $result = GetOptions(
40          "inbox=s" => \$opt->{'inbox'},          "inbox=s" => \$opt->{'inbox'},
41          "debug" => \$debug,          "debug" => \$debug,
42          "verbose" => \$verbose,          "verbose" => \$verbose,
         "email=s" => \$opt->{'email'},  
43  );  );
44    
45  my $nos = new Nos(  my $nos = new Nos(
# Line 113  on that list. Line 112  on that list.
112          foreach my $list (@lists) {          foreach my $list (@lists) {
113                  print $list->name," <",$list->email,">\n";                  print $list->name," <",$list->email,">\n";
114                  foreach my $user_on_list ($user_list->search(list_id => $list->id)) {                  foreach my $user_on_list ($user_list->search(list_id => $list->id)) {
115                          my $user = $users->retrieve( id => $user_on_list->user_id );                          print "\t",$user_on_list->user_id->full_name," <", $user_on_list->user_id->email, ">\n";
                         print "\t",$user->full_name," <", $user->email, ">\n";  
116                  }                  }
117          }          }
118    
# Line 127  argument) or read from C<STDIN>. List sh Line 125  argument) or read from C<STDIN>. List sh
125   email@example.com      Optional full name of person   email@example.com      Optional full name of person
126   dpavlin@rot13.org      Dobrica Pavlinusic   dpavlin@rot13.org      Dobrica Pavlinusic
127    
 You may use C<--email> parametar at any time to set From: e-mail address for list.  
 B<This seems somewhat cludgy, and it will probably change in future>.  
   
128  =cut  =cut
129    
130  } elsif ($list_name = $opt->{'add'}) {  } elsif ($list_name = $opt->{'add'}) {
# Line 190  add C<--verbose> flag, it will display a Line 185  add C<--verbose> flag, it will display a
185                          my $msg = $m->message_id->message;                          my $msg = $m->message_id->message;
186                          $msg =~ s/\s+/ /gs;                          $msg =~ s/\s+/ /gs;
187    
188                          $l .= sprintf(" %-10s %15s : ", $m->list_id->name, $date);                          $l .= sprintf(" %-15s %15s : ", $m->list_id->name, $date);
189                          $l .= substr($msg, 0, 79 - length($l));                          $l .= substr($msg, 0, 79 - length($l));
190    
191                          print "$l\n";                          print "$l\n";
# Line 217  Feed incomming message back into notice Line 212  Feed incomming message back into notice
212    
213  =cut  =cut
214    
215  } elsif ($opt->{'inbox'}) {  } elsif ($list_name = $opt->{'inbox'}) {
216    
217            my $message;
218            while(<>) {
219                    $message .= $_;
220            }
221    
222            $nos->inbox_message(
223                    list => $list_name,
224                    message => $message,
225            ) || die "can't receive message for list $list_name";
226    
         warn "inbox option is not implemented";  
227    
228  } else  {  } else  {
229          die "see perldoc $0 for help\n";          die "see perldoc $0 for help\n";
# Line 241  Turn on debugging output from C<Class::D Line 245  Turn on debugging output from C<Class::D
245    
246  Dump more info on screen.  Dump more info on screen.
247    
 =item --email  
   
 Used to specify e-mail address where needed.  
   
248  =back  =back
249    
250    

Legend:
Removed from v.33  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26