## ## Copyright (c) 2001-2002 The OSSP Project ## Copyright (c) 2001-2002 Cable & Wireless Deutschland ## ## This file is part of OSSP lmtp2nntp, an LMTP speaking local ## mailer which forwards mails as Usenet news articles via NNTP. ## It can be found at http://www.ossp.org/pkg/lmtp2nntp/. ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License ## as published by the Free Software Foundation; either version ## 2.0 of the License, or (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this file; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ## USA, or contact the OSSP project . ## ## lmtp2nntp.pod: LMTP to NNTP (manual page) ## =pod =head1 NAME B - mail to news gateway =head1 SYNOPSIS B [B<-C> I] [B<-D>] [B<-K>] [B<-P> I] [B<-V>] [B<-a> I/I[,I/I[,...]] [B<-b> I[I<:port>]|C<->|I[:perms]] [B<-c> I[I<:port>]] [B<-d> I[I<:port>][,I[I<:port>], ...]] [B<-g> I] [B<-h> I
:] [B<-l> I[:I]] [B<-m> I] [B<-n> I] [B<-o> I] [B<-r> I] [B<-s> I] [B<-t> I=I[,I=I[,...]] [B<-u> I] [B<-v>] I [I ...] =head1 DESCRIPTION The B program is an LMTP service for use in conjunction with an MTA (like Sendmail), providing a reliable real-time mail to news gateway. Input messages get their headers slightly reformatted to match Usenet news article format. The article is then posted or feeded into a remote NNTP service (like INN). Delivery must take place immediately or the transaction fails. B relies on the queuing capabilities of the MTA in order to provide a fully reliable service. For this the program returns proper delivery status notification which indicates successful completed action, persistent transient failure or permanent failure. The following command line options and arguments are available: =over 4 =item B<-C> I Childs the daemon spawns at maximum. Default is 10. =item B<-D> Daemonize program and detach from current terminal. =item B<-K> Kill the daemon. After processing this option the program is terminated so this option effectivly renders most other options invalid not including specification of a pidfile and logging. The pid must be listed in pidfile. =item B<-P> I Pidfile to remember the process ID when running as or killing the daemon. Care must be taken when using relative path names as daemonizing changes the current working directory to '/'. =item B<-V> Very verbose logging. This means logging is unbuffered. =item B<-a> I/I[,I/I[,...]] (LMTP daemon ACL) Access control list specifying TCP INET addresses and masks where incoming LMTP connections are accepted from. This option can be specified more than once and it is possible to specify more than one addr/ mask per option as a comma-separated list. Omitting a mask defaults to a host comparison. The mask is a CIDR style bitmask where /0 means no comparison and enforces a match. Omitting the wholly option defaults to 0.0.0.0/0 which allows access from everywhere. It is possible to specify both inclusive and exclusive addresses, the latter have to prefixed with an exclamation mark. In order to pass the ACL a client must match any inclusion and not match any exclusion. If you specify exclusions only a fake inclusion of 0.0.0.0/0 is appended internally. Any addr can be a name to be resolved first. FIXME should we resolv on startup only or for every access or using dns ttl =item B<-b> I[I<:port>]|C<->|I (LMTP daemon bind) Bind address accepting incoming LMTP connections. Supported are "C<->" for stdio, I[:perms] for Unix Domain socket with optional chmod-like permissions and I[I<:port>] for TCP INET socket. Omitting this option defaults to stdio. The path for a UNIX domain socket must start with a slash. The addr can be a name to be resolved first. =item B<-c> I[I<:port>] (NNTP client bind) Client connections for outgoing NNTP communication bind to this address. If an address is specified but port is omitted the kernel chooses an ephemeral port. If you want to specify a port but no address replace address with all zeroes. If completely omitted, 0.0.0.0:0 is assumed which causes the kernel to choose an address based on routing information and an ephemeral port. The addr can be a name to be resolved first. =item B<-d> I[I<:port>][,I[I<:port>], ...] (NNTP client peer) Destination 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<-d> 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 and it is possible to specify more than one host/ port per option as a comma-separated list. Any addr can be a name to be resolved first. 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<-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 and headers 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<-h> I
: Header with value to to be inserted into message before delivery. This option can be specified more than once. Useful for specifiying an moderator Email address to all outgoing news messages by applying an "Approved:" header. =item B<-l> I[:I] The level measures the degree and importance of output and can be any of PANIC, CRITICAL, ERROR, WARNING, NOTICE, INFO, TRACE or DEBUG. The recommended level for daily operations is NOTICE. The default name for logfile is "logfile". This program is using the logging library (l2) which is currently under development. An early access snapshot with limited functionality has been included. Currently the common denominator of usage between lmtp2nntp and l2 is to use logging into a file only. Note that this will change soon as during integration of l2 into lmtp2nntp logging channels for local syslog and a SMTP client were already finished and IRC and NNTP clients are under development. =item B<-m> I "MAIL From:" filter to limit sender addresses. If ommitted, anyone can send mail. The value to be compared includes the angle brackets. Use a PCRE (Perl compatible reguar expression) for I. =item B<-n> I Own FQDN used in LMTP and NNTP protocols. This overrides the nodename returned by uname(3). =item B<-o> I Possible values for I are C, C or a string in "LLL/D.D.D" format used to fake a LMTP return code. 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 and DSN replaces the post/ feed logic by a noop and assumes the given string must be returned to the LMTP side. 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". This is useful for debugging LMTP setups without engaging NNTP. Fake mode makes it possible to run without any B<-d> option. However, if B<-d> option is given the NNTP client tries to connect but it's return codes are ignored. =item B<-r> I Restricted headers. Messages with a matching restrictheader are rejected. If ommitted no restrictions apply. Matching is done before -h headers are appended. Use a PCRE (Perl compatible reguar expression) for I. =item B<-s> I Size limitation on message in bytes. Default is 8388608 (8M). =item B<-t> I=I[,I=I[,...] Timeout for various actions. Possible names are C for any LMTP and C for any NNTP actions. More granular actions can be specified according to the following table, which also lists the system defaults. Setting sec to zero means to wait infinite. Note that LMTP timeouts only apply to socket operations, stdio always waits infinite. lmtp:accept = 0 lmtp:read = 10 lmtp:write = 10 nntp:connect = 360 nntp:read = 60 nntp:write = 60 =item B<-u> I UID or login name to resolve to a UID to be set for program execution. =item B<-v> Print version information. =item I [I ...] Newsgroup to post the message to or filter, depending on groupmode. Multiple groups can be specified. Crosspostings succeed if delivery to I group succeeds. =back =head1 SIGNALS Sending a USR1 signal to the program will flush the logging stream. =head1 DIAGNOSTICS If invoked it returns 0 on successful execution (not neccessarily meaning successful delivery!) or 1 on failed execution. Returning proper delivery status notification is part of the LMTP protocol. =head1 STANDARDS =over 4 =item RFC0821 Simple Mail Transfer Protocol. J. Postel. Aug-01-1982. (Format: TXT=124482 bytes) (Obsoletes RFC0788 ) (Obsoleted by RFC2821) (Also STD0010) (Status: STANDARD ) =item RFC0822 Standard for the format of ARPA Internet text messages. D. Crocker. Aug-13-1982. (Format: TXT=109200 bytes) (Obsoletes RFC0733) (Obsoleted by RFC2822) (Updated by RFC1123, RFC1138, RFC1148, RFC1327, RFC2156) (Also STD0011) (Status: STANDARD) =item RFC0977 Network News Transfer Protocol. B. Kantor, P. Lapsley. Feb-01-1986. (Format: TXT=55062 bytes) (Status: PROPOSED STANDARD) =item RFC1035 Domain names - implementation and specification. P.V. Mockapetris. Nov-01-1987. (Format: TXT=125626 bytes) (Obsoletes RFC0973, RFC0882, RFC0883) (Updated by RFC1101, RFC1183, RFC1348, RFC1876, RFC1982, RFC1995, RFC1996, RFC2065, RFC2136, RFC2181, RFC2137, RFC2308, RFC2535, RFC2845) (Also STD0013) (Status: STANDARD) =item RFC1652 SMTP Service Extension for 8bit-MIMEtransport. J. Klensin, N. Freed, M. Rose, E. Stefferud, D. Crocker. July 1994. (Format: TXT=11842 bytes) (Obsoletes RFC1426) (Status: DRAFT STANDARD) =item RFC1854 SMTP Service Extension for Command Pipelining. N. Freed. October 1995. (Format: TXT=14097 bytes) (Obsoleted by RFC2197) (Status: PROPOSED STANDARD) =item RFC1893 Enhanced Mail System Status Codes. G. Vaudreuil. January 1996. (Format: TXT=28218 bytes) (Status: PROPOSED STANDARD) =item RFC1894 An Extensible Message Format for Delivery Status Notifications. K. Moore, G. Vaudreuil. January 1996. (Format: TXT=77462 bytes) (Updated by RFC2852) (Status: PROPOSED STANDARD) =item RFC2034 SMTP Service Extension for Returning Enhanced Error Codes. N. Freed. October 1996. (Format: TXT=10460 bytes) (Status: PROPOSED STANDARD) =item RFC2606 Reserved Top Level DNS Names. D. Eastlake, A. Panitz. June 1999. (Format: TXT=8008 bytes) (Also BCP0032) (Status: BEST CURRENT PRACTICE) =item RFC2821 Simple Mail Transfer Protocol. J. Klensin, Editor. April 2001. (Format: TXT=192504 bytes) (Obsoletes RFC0821, RFC0974, RFC1869) (Status: PROPOSED STANDARD) =item RFC2980 Common NNTP Extensions. S. Barber. October 2000. (Format: TXT=57165 bytes) (Status: INFORMATIONAL) =back =cut