=pod =head1 NAME B - mail to nntp gateway =head1 SYNOPSIS B [B<-o> I] [B<-j> I] [B<-i> I] [B<-t> I] [B<-p> I] [B<-l> I] [B<-h> I[I<:port>]] [B<-d> I] [B<-g> I] [B<-t> I] [B<-v>] I [I ...] =head1 DESCRIPTION The B program reads mail from stdin and posts it to one or more newsgroups using NNTP. It delivers the message immediately or fails. If queuing is desired it can operate as a LMTP server. The following options are available: =over 4 =item B<-o> I Outgoing network IP address or hostname to bind to. =item B<-j> I Own FQDN used in LMTP and NNTP protocols. =item B<-i> I Message id of MTA (for logging purposes only). =item B<-t> I LMTP and NNTP protocol timeouts (in seconds). =item B<-p> I Incoming protocol. Default is C which means B reads the incoming mail from F in RFC822 message format and reports errors to F. Alternatively if I is C, B speaks Local Mail Transport Protocol (LMTP) according to RFC 2033 on F/F. =item B<-l> C =item B<-l> C[C<:>I] =item B<-l> CI Logging target. This option can be specified more than once. Default is no logging. Default I for C is C. =item B<-h> I[:] Hostname or address and optional TCP port of a NNTP service. Unless a port is specified, getserbyname(nntp) is queried with fallback to 119/tcp. If C<-h> option is ommited, the environment variable C is read, if this is undefined or empty C is used and if this doesn't resolve, C is assumed. This option can be specified more than once. It is assumed that multiple servers are used to increase the reliability of the news system and to speed up distribution by posting the same article to more than one server. In regard to this program they must provide the same groups and talk to each other. =item B<-d> I Possible values for I are C, C or a string used to fake a LMTP return code and DSN in "LLL/D.D.D" format. The slash is replaced by a space internally. The default is "553/5.7.1" meaning "Requested action not taken: mailbox name not allowed/ Delivery not authorized, message refused". In C mode articles are sent to the NNTP server(s) using POST command. Before posting, a duplicate check using STAT command is issued. In C mode articles are sent to the NNTP server(s) using IHAVE command. Specifying a return code/ DSN replaces the post/ feed logic by a noop and assumes the given string must be returned to the LMTP side. This is useful for debugging LMTP setups without engaging NNTP. =item B<-g> I Possible values for I are C (default), C and C
. In C mode, the Cs specified as command line arguments are ultimate destinations for the received messages. Addresses from envelope are ignored. In C mode the newsgroup(s) are taken from the LMTP envelope, in C
mode the newsgroup(s) are taken from the header. In all modes C header is rewritten. In C and C
mode groups must still be specified as command line arguments. However, in these modes the command line arguments are filters representing allowed groups. Filters can be specified as wildmat's. =item B<-t> I Enable LMTP and NNTP protocol tracing into tracefile. When using C these messages are logged with C level. =item B<-v> Enable verbose processing messages in logfile. When using C these messages are logged with C level. =item I Newsgroup to post the message to. Multiple groups can be specified. Crosspostings only succeed if delivery to I groups succeed. =back =head1 SENDMAIL INTEGRATION Mlmtp2nntp, P=/... /*FIXME*/ =head1 EXAMPLE $ cat rfc822.message | lmtp2nntp -l /tmp/log -v -h mynews foo.bar reads rfc822.message and posts it into group "foo.bar" using NNTP service on host "mynews". Activity is logged to /tmp/log. If posting is successful, the exit status is 0. $ cat rfc822.message | lmtp2nntp -h news1 -h news2 -h news3 foo.bar reads rfc822.message and posts it into group "foo.bar" using NNTP service on all hosts "news1", "news2" and "news3". Activtiy is not logged. If at least one posting is successful, the exit status is 0. $ cat rfc822.message | lmtp2nntp -l stderr foo.bar quux.bar test.bar reads rfc822.message and posts it into groups "foo.bar", "quux.bar" and "test.bar" using NNTP service on host C<${NNTPSERVER:-news}>. Activity is logged to stderr. Only if all three crosspostings succeed, the exit status is 0. =head1 DIAGNOSTICS when invoked from command line 0 = successful execution and delivery 1 = execution failed 2 = cannot deliver to any nntpserver when invoked as LMTP server 0 = successful execution 1 = execution failed delivery status is part of the LMTP protocol =head1 STANDARDS RFC1891 Delivery Status Notification (DSN) FIXME =head1 AUTHOR The OSSP Project Cable & Wireless Deutschland GmbH Thomas Lotterer =cut