\input texinfo  @c -*-texinfo-*-
@c
@c FIDOGATE documentation
@c
@c $Id: fidogate.texi,v 4.36 1997/11/20 18:30:36 mj Exp $
@c

@setfilename fidogate.info

@iftex
@c A4 paper
@afourpaper
@finalout
@end iftex


@ifinfo
This file documents the usage of FIDOGATE version 4

Copyright (C) 1994-1996, Martin Junius

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@ignore
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into other languages, under the above conditions for modified versions.
@end ifinfo

@c @setchapternewpage odd
@settitle{FIDOGATE}

@titlepage
@title FIDOGATE
@subtitle Fido-Internet Gateway
@subtitle Fido FTN-FTN Gateway
@subtitle Fido Mail Processor
@subtitle Fido File Processor
@subtitle Fido Areafix/Filefix
@subtitle Version 4
@author by Martin Junius

@page

Copyright @copyright{} 1994-1996 Martin Junius

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into other languages, under the above conditions for modified versions.

@end titlepage
@page


@node Top, Introduction, , (DIR)
@top Introduction
@cindex Introduction

@noindent
This manual documents how to install and use FIDOGATE. It is the first
step toward a concise documentation. Alas, writing documentation is a
somewhat tedious business, so this manual is far from complete.

@menu
* Introduction::Introduction to FIDOGATE
* Installation::Compiling and installing FIDOGATE
* Programs::    FIDOGATE programs and scripts
* Config files::FIDOGATE config files
* Basic::       Basic configuration
* Usage::       FIDOGATE usage

* Index::       Index

 --- The Detailed Node Listing ---

Compiling and installing FIDOGATE

* Point::       Installing a FIDOGATE point system
* config.h::    The @code{config.h} header file
* config.make:: The @code{config.make} Makefile configuration
* Compiling::   Compiling and installing FIDOGATE
* Integration:: Integrating FIDOGATE and the mail/news system
* Testing::     Testing FIDOGATE operation
* Connecting::  Connecting to FIDONET

FIDOGATE Programs

* ffx::         Remote execution via FIDO mailer
* ffxbatch::    Remove execution via FIDO mailer - batched
* ffxmail::     @code{ffx} frontend for sending mail
* ffxqt::       Execute @code{ffx} requests
* ffxrmail::    @code{rmail} command for @code{ffxqt}
* ffxrun::      Script for running @code{ffxqt}
* ftn2ftn::     FTN-FTN NetMail gateway
* ftn2rfc::     FTN-Internet mail/news gateway
* ftnaf::       Areafix
* ftnafmail::   Areafix mail frontend
* ftnbounce::   Bounce mail to unknown FTN address
* ftnbsy::      Create/delete Binkley busy files
* ftnconfig::   Retrieve information from FIDOGATE config files
* ftnhatch::    Hatch new file into file
* ftnin::       Frontend for @code{ftn2rfc}
* ftninpost::   Mail/news processing script
* ftninrecomb:: Mail/news recombining script
* ftnlock::     Create/delete lock files
* ftnlog::      Write message to log file
* ftnpack::     Pack (ArcMail) FTN mail packets
* ftnroute::    Route FTN mail packets
* ftnseq::      Access sequencer file
* ftntick::     Process incoming file echos
* ftntoss::     Toss/remap/rewrite FTN mail packets
* ftnfattach::  Binkley outbound file attach utility
* pktdebug::    FTN mail packet debugger
* rfc2ftn::     Internet-FTN gateway
* rundf::       Script for checking free disk space
* runin::       Script for processing inbound packets
* runout::      Script for processing gateway output packets
* runtoss::     Script for running tosser
* rununpack::   Script for unpacking arcmail archives
* sumcrc::      CRC checksum utility

FIDOGATE Config Files

* Config::      @code{config.*} configuration files
* Hosts::       @code{hosts} FTN address to host name conversion
* Aliases::     @code{aliases} user aliases
* Areas::       @code{areas} FTN area to newsgroup conversion
* Bounce::      Bounce messages of @code{ftn2rfc}
* Passwd::      @code{passwd} password config file
* Routing::     @code{routing} file for @code{ftntoss} and @code{ftnroute}
* Packing::     @code{packing} file for @code{ftnpack}
* Areas.bbs::   @code{areas.bbs} EchoMail distribution

Basic Configuration

* Sendmail::	       Sendmail configuration
* Example Point::      Example point configuration
* Example Point 2::    Example configuration with 2 point addresses
* Example Node::       Example leaf node configuration

FIDOGATE Usage

* RFC Headers:: RFC Headers in FTN Messages
* X Headers::   X Headers in RFC Messages
@end menu

@c ***************************************************************************
@page
@node Introduction, Installation, Top, Top
@chapter Introduction to FIDOGATE

@cindex Introduction


@noindent
FIDOGATE is a Fido-Internet gateway and a Fido tosser.  It is placed
under the GNU General Public License, see COPYING for details.

The gateway converts between the worlds of Fido NetMail/EchoMail (or
FTNs, Fido Technology Networks in general) and the UNIX mail/news
system. FIDOGATE will convert Fido mail packets to RFC822/1036-style
messages and vice versa.

FIDOGATE also includes a complete FIDO mail processor (NetMail/EchoMail
scanner and tosser), an FTN-FTN gateway (NetMail only), a file processor
(TIC file areas) and an Areafix/Filefix.


@section How to Get FIDOGATE

@noindent
The latest version of FIDOGATE is available at the locations.

@noindent
Internet WWW FIDOGATE home page:
@example
http://www.fido.de/fidogate/
@end example

@noindent
Internet anonymous ftp:
@example
ftp://ftp.fido.de/pub/fidogate/
ftp://ftp.comnets.rwth-aachen.de/pub/mail+news/fidogate/
@end example

@noindent
BBS and FIDO frequest:
@example
@r{2:2452/110 111  242:1000/1 2  +49-241-876604  (V.34, ISDN V.110, X.75)}
@r{Magic name }FIDOGATE
@end example


@section Requirements for FIDOGATE:

@itemize @bullet

@item
Something that gets you FIDONET mail. If you want a UNIX-based FIDO
mailer, I recommend using ifcico from Eugene Crosser's ifmail package.

@item
Installed news system. (CNews, INN)

@item
A news reader. (nn, tin, Emacs GNUS, netscape, slrn, trn, knews, xrn, ...)

@item
A mail transport agent. (sendmail, smail)

@item
A mail user agent. (mail, elm, pine, Emacs VM, netscape, xfmail, ...)

@item
Perl. (version 4.036 or 5.000+)

@item
M4 for compiling the sendmail config files.

@end itemize


@section FIDOGATE Mailing List

@noindent
There is a @i{NEW} mailing list for FIDOGATE discussions and
announcements:

@example
fidogate@@fido.de
@end example

To @i{subscribe} to this mailing list, send a message to

@example
majordomo@@fido.de
@end example

@noindent
with the command 

@example
subscribe fidogate
@end example

@noindent
in the message @i{body} (not subject!). This will not immediately put
your email address into the mailing list. A confirmation mail with an
authentication code will be send to you, which must be returned to
majordomo to finally enable your subscription.

To @i{unsubscribe} from this mailing list, send the command

@example
unsubscribe fidogate
@end example



@section Credits
This stuff is a derived version of a posting called @code{rfmail} to
Usenet's alt.sources some time ago. I rewrote the entire code by now.

The original @code{rfmail} authors were: Teemu Torma, who wrote the first
version, and Heikki Suonsivu, who did some changes and improvements and
posted version 0.3.3 to the net.

Also used:

@noindent
The parsedate.y date/time parser, from INN 1.4:
@example
Originally written by Steven M. Bellovin <smb@@research.att.com> while
at the University of North Carolina at Chapel Hill.  Later tweaked by
a couple of people on Usenet.  Completely overhauled by Rich $alz
<rsalz@@osf.org> and Jim Berets <jberets@@bbn.com> in August, 1990.
Further revised (removed obsolete constructs and cleaned up timezone
names) in August, 1991, by Rich.  Paul Eggert <eggert@@twinsun.com>
helped in September, 1992.
@end example
(Changed slightly and adopted for FIDOGATE)

@noindent
The xstrtok() function:
@example
16/10/1991      Wolfram Roesler         wr@@bara.oche.de
@end example

@noindent
GNU @code{getopt}.

@noindent
The wildmat() function from GNU tar, modified and adopted for FIDOGATE.



@c ***************************************************************************
@node Installation, Point, Introduction, Top

@chapter Compiling and installing FIDOGATE

@cindex Installation

@menu
* Point::       Installing a FIDOGATE point system
* config.h::    The @code{config.h} header file
* config.make:: The @code{config.make} Makefile configuration
* Compiling::   Compiling and installing FIDOGATE
* Integration:: Integrating FIDOGATE and the mail/news system
* Testing::     Testing FIDOGATE operation
* Connecting::  Connecting to FIDONET
@end menu

@noindent
This chapter describes the FIDOGATE configuration and installation.  You
must also edit the config files to be installed in the LIBDIR
directory. Create @code{config.common}, @code{config.gate},
@code{config.main}, @code{config.ffx}, @code{areas}, @code{hosts},
@code{passwd}, @code{routing}, @code{packing}, @code{aliases} according
to your setup (examples in the examples subdirectory).

The chapter on config files describes them in detail.



@c ***************************************************************************
@node Point, config.h, Installation, Installation

@section Installing a FIDGATE Point System
@cindex Point

@noindent
Hints for setting up a FIDOGATE point system without Internet mail
connectivity:

@itemize @bullet

@item
Choose a host name and a domain name. Since both won't be visible to the
outside world, you may choose whatever you want.

@item
Put the @code{NoFromLine} keyword into @code{config}!!!

@item
Comment out @code{PASSTHRU_NETMAIL} and @code{PASSTHRU_ECHOMAIL} in
@code{src/config.h}. These functions are not necessary for a point system
and may cause trouble.

@item
If you want to send Internet mail via a Fido-Internet gateway, set its
address with @code{Gateway} in @code{config.gate}. FIDOGATE can then be
used as your default mailer, delivering all non-Fido mail to this
gateway.

@end itemize

See also @code{doc/Fido-Point-HOWTO} (German) and
@code{doc/Fido-Point-eng-HOWTO} (English) for a complete description how
to install a point system. Furthermore, there is a section on point
configuration at the end of this document.




@c ***************************************************************************
@node config.h, config.make, Point, Installation

@section The @code{config.h} Header File

@noindent
Comment/uncomment/change the @code{#define}s to suit your requirements.

@noindent
Common configuration:

@table @code

@item LOCAL_FTN_ADDRESSES
Generate ``local'' FTN addresses: @i{User_Name%p.f.n.z@@hostname.domain}
instead of @i{User_name@@p.f.n.z.domain}.

@item DO_BSY_FILES
Create Binkley-style busy files while accessing the Binkley outbound.

@item SECURE
Enable secure permissions for packet and data files.

@item MAXMSGSIZE
Maximum size of FIDO messages generated by @code{rfc2ftn}, larger
messages will be split. Alas, less than 16K seems to be the only safe
setting. This is the default value.

@item FTN_INVALID_DOMAIN
Domain address to be used for invalid FTN addresses.

@end table


@noindent
@code{ftn2rfc} configuration:

@table @code

@item ALIASES_ARE_LOCAL
Addresses found in the @code{aliases} config file are rewritten so
that the sender's address is the gateway.

@item CHARSET_DEFAULT_IBMPC
Make IBMPC the default char set (no @code{^ACHRS} kludge).

@end table

@noindent
@code{rfc2ftn} configuration:

@table @code

@item PASSTHRU_NETMAIL
Passthru operation for NetMail: if the sender of the message is an FTN
address, the origin address of the resulting FTN message will be that
FTN address.

@item PASSTHRU_ECHOMAIL
Passthru operation for EchoMail: X-FTN-Tearline, X-FTN-Origin,
X-FTN-Seen-By, X-FTN-Path headers will be used for tear line, *
Origin, SEEN-BY, ^APATH, when gating from Internet to FTN.

@item FTN_FORCE_INTL
Always generate a @code{^AINTL} kludge, even if sender and receiver are
in the same default zone (first @code{Address} in @code{config}).

@item NO_CONTROL
Do not pass news control messages (newgroup, cancel, etc.) to the FTN
side of the gateway.

@end table

@noindent
System dependent configuration:

This configuration contains several groups of #define/#undef. First, the
definitions for a standard POSIX UNIX, followed by #ifdef'ed definitions
for SunOS, Linux, FreeBSD, Interactive UNIX, MSDOS DJGPP, NextStep,
GNU-WIN32.

If you want to port FIDOGATE to a new system, please add a #ifdef'ed
section similar to the already existing ones.

The gory details:

@table @code

@item DO_HAVE_FCNTL_LOCK
Define, if the system support fcntl() file locking.

@item DO_HAVE_GETTIMEOFDAY
Define, if the system has the gettimeofday() function.

@item DO_HAVE_TM_GMTOFF
Define, if the system has a tm_gmtoff field in struct tm.

@item DO_HAVE_SYSEXITS_H
Define, if the system support the @code{sysexits.h} header file.

@item DO_HAVE_TM_ZONE
Define, if the system has a tm_zone field in struct tm.

@item DO_HAVE_STRFTIME
Define, if the system has the Standard-C strftime() function.

@item DO_HAVE_TZNAME    
Define, if the system has @code{extern char *tzname[2]}.

@item DO_HAVE_STRCASECMP
Define, if the system has the @code{strcasecmp()} and
@code{strncasecmp()} functions.

@item DO_HAVE_STRICMP
Define, if the system has the @code{stricmp()} and
@code{strnicmp()} functions.

@item DO_HAVE_STERROR
Define, if the system has the @code{strerror()} function.

@item DO_BINARY
Define, if files must be opened in binary mode.

@item DO_DOSIFY
Define, if filenames must be converted to DOS, OS2-style @code{\}.

@end table

Define only one of @code{DO_HAVE_TM_ZONE}, @code{DO_HAVE_STRFTIME},
@code{DO_HAVE_TZNAME}, and also only one of @code{DO_HAVE_STRCASECMP},
@code{DO_HAVE_STRICMP}.



@noindent
@i{THE FOLLOWING DEFINES SHOULD NORMALLY LEFT AS IS!!!}

@noindent
Message ID configuration:

@table @code

@item FIDODOMAIN
Default Internet domain for standard FIDO addresses (zone 1--6). Used
for Message-IDs only, so DO NOT CHANGE.

@item MSGID_ORIGID
Generate Gatebau '93 @code{^AORIGID}, @code{^AORIGREF}
kludges.

@end table



@noindent
Files and directories used by FIDOGATE:

@table @code

@item CONFIG_GATE
@item CONFIG_MAIN
@item CONFIG_FFX
Names of FIDOGATE config files.

@item DEF_ALIASES
Default user aliases config file.

@item DEF_AREAS
Default FTN area / newsgroup conversion config file.

@item DEF_HOSTS
Default FTN addresses / host names registration config file.

@item DEF_PASSWD
Default password config file.

@item DEF_PACKING
Default packing config file.

@item DEF_ROUTING
Default routing config file.

@item DEF_HISTORY
Default database of @code{^AMSGID}s for dupe checking.

@item HOSTS
@item ALIASES
@item AREAS
@item PASSWD
@item PACKING
@item ROUTING
Definitions from config file.

@item LOG
Default log file.

@item SEQ_MAIL
Sequencer file used by @code{ftn2rfc} for mail messages.

@item SEQ_NEWS
Sequencer file used by @code{ftn2rfc} for news messages.

@item SEQ_MSGID
Sequencer file used by @code{rfc2ftn} for @code{^AMSGID}s.

@item SEQ_PKT
Sequencer file used by @code{rfc2ftn} for outbound packet names.

@item SEQ_SPLIT
Sequencer file used by @code{rfc2ftn} for split messages number.

@item SEQ_FF
Sequencer file used by @code{ffx} for control and data files.

@item SEQ_TOSS
Sequencer file used by @code{ftntoss}, @code{ftnroute} for output
packet files.

@item SEQ_PACK
Sequencer file used by @code{ftnpack} for packet names in arcmail
archives.

@item SEQ_MQ
Sequencer file used by @code{queuemail}. NOT YET IMPLEMENTED.

@item SEQ_TICK
Sequencer file used by @code{ftnhatch} and @code{ftntick}.

@item LOCK_HISTORY
Name of lock file for history access.

@item INDIR
Input directory for @code{ftn2rfc}, relative to @code{SPOOLDIR}.

@item INSECUREDIR
Insecure input directory for @code{ftn2rfc}, relative to @code{SPOOLDIR}.

@item INDIR_MAIL
Directory where @code{ftn2rfc} creates converted mail messages,
relative to @code{SPOOLDIR/INDIR}.

@item INDIR_NEWS
Directory where @code{ftn2rfc} creates converted news messages,
relative to @code{SPOOLDIR/INDIR}.

@item OUTDIR
Directory where @code{rfc2ftn} creates output packets, relative to
@code{SPOOLDIR}. 

@item SEQ
Directory where FIDOGATE creates its sequencer files, relative to
@code{SPOOLDIR}.

@item LOCKS
Directory where lock files are created, relativ to @code{SPOOLDIR}.

@item TOSS_IN
@item TOSS_TMP
@item TOSS_OUT
@item TOSS_PACK
Tosser input, temporary, output, and arcmail packet directory, relative
to @code{SPOOLDIR}. Used by @code{ftntoss}, @code{ftnroute},
@code{ftnpack}.

@item TOSS_BAD
Directory where tosser puts packets with bad messages, e.g. insecure,
dupes, etc.

@item QUEUE
Directory for queueing. NOT YET IMPLEMENTED.

@item TICK_HOLD
Hold directory for TIC files, relative to OUTBOUND. Used by
@code{ftnhatch} and @code{ftntick}.

@item @i{xxxx}_MODE
Permissions for files processed by FIDOGATE.

@item FTN_RFC_HEADERS
RFC headers recognized at the beginning of FTN messages.

@item RFC_LVL_1_HEADERS
RFC headers put into FTN messages for RFC level 1.

@end table



@noindent
Program constants, increase the MAX values if needed.

@table @code

@item @i{xx}_MODE
Modes (@code{fopen}) for opening files.

@item DATE_DEFAULT
Default date format string.

@item DATE_NEWS
Date format string for news articles.

@item DATE_MAIL
Date format string for mail.

@item DATE_FIDO
Date format string for FTN messages.

@item PRODUCT_CODE
FIDO product code used by @code{rfc2ftn}. Should be left as is
(@code{0xfe}). 

@item MAX_LINELEN
Maximum line length for formatting (line break) FIDO messages.

@item MAXADDRESS
Maximum number of @code{Address} and @code{Zone} statements in
@code{config} file.

@item MAXDOSDRIVE
Maximum number of @code{DosDrive} statements in @code{config} file.

@item MAXPATH
Maximum length of a pathname in FIDOGATE.

@item MAXINETADDR
Maximum length of the address part of an Internet address in FIDOGATE.

@item MAXUSERNAME
Maximum length of the user name part of an Internet address in FIDOGATE.

@item MAXOPENFILES
Maximum number of packet files concurrently opened by tosser
programs. The maximum possible value is operating system and
configuration dependent, see UNIX ulimits.

@end table



@c ***************************************************************************
@node config.make, Compiling, config.h, Installation

@section The @code{config.make} Makefile Configuration

@noindent
This file is included in all FIDOGATE Makefiles.

A special convention is used for defining macros: a macros definition
which starts in the first column (no leading white space) will be used
by @code{subst.pl} to replace @i{<something>} in the various shell and
perl scripts. Be careful and keep the formatting when editing this file.

@noindent
The following definitions @b{must} start in the first column.

@table @code

@item BINDIR
The directory for user programs.

@item LIBDIR
The directory for FIDOGATE's programs and config files.

@item SPOOLDIR
FIDOGATE's spool directory.

@item LOGDIR
Directory for FIDOGATE log files.

@item INFODIR
Directory for installing info documentation files.

@item HTMLDIR
Directory for installing HTML documentation files.

@item OUTBOUND
Default BinkleyTerm-style outbound base directory. This is the base
directory, not the actual zone outbound directory.

@item INBOUND
Default BinkleyTerm-style inbound directory.

@item PINBOUND
Default BinkleyTerm-style protected inbound directory.

@item UUINBOUND
Default BinkleyTerm-style inbound directory for the @code{recvuu} script.

@item NEWSETCDIR
INN directory: config files

@item NEWSVARDIR
INN directory: active, history files.

@item NEWSLIBDIR
INN directory: scripts.

@item NEWSSPOOLDIR
INN news spool.

@item PERL
Full path name of perl executable.

@end table


@noindent
The following definitions should have leading white space.

@table @code

@item SHELL
The shell for executing commands.

@item OWNER
Owner of FIDOGATE files.

@item GROUP
Group of FIDOGATE files.

@item PERM_PROG
Permissions for installing programs.

@item PERM_DATA
Permissions for installing data files.

@item PERM_SETUID
Permissions for installing setuid @code{OWNER} programs.

@item PERM_DIR
Permissions for installing directories.

@item CC
C compiler.

@item YACC
@code{yacc} or a clone like @code{bison -y}.

@item AR
@code{ar} monkey ... (@@!#$%&... ouch!) ... librarian.

@item RANLIB
Library utitility, if needed.

@item DEBUG
Optimize or debugging flags for compiling.

@item CFLAGS
Flags for compiling FIDOGATE.

@item LFLAGS
Flags for linking FIDOGATE.

@item LIBS
Libraries for linking FIDOGATE, including the FIDOGATE library
@code{libfidogate.a}.

@item INSTALL_PROG
Install command for installing programs.

@item INSTALL_DATA
Install command for installing data files.

@item INSTALL_SETUID
Install command for installing setuid programs.

@item INSTALL_DIR
Install command for installing directories.

@item LIB
Name of the FIDOGATE library.

@end table

If the directories in @code{SPOOLDIR} are different from the default
ones in @code{config.h}, the commands for the @code{install-dirs} target
of @code{Makefile} must be changed as well.



@c ***************************************************************************
@node Compiling, Integration, config.make, Installation

@section Compiling and Installing FIDOGATE
@cindex Compiling
@cindex Installation

@noindent
Compile the beast by entering
@example
make depend
make
@end example

Alternatively an optimized version can be compiled with
@example
make DEBUG=-O2
@end example


If everything works, you must create the necessary directories:
@example
make install-dirs
@end example
Then install all FIDOGATE programs:
@example
make install
@end example

Next you must create the configuration files. Have a look at the various
configuration in directory @code{examples/} and use them to build your
own configuration.



@c ***************************************************************************
@node Integration, Testing, Compiling, Installation

@section Integrating FIDOGATE and the Mail/News System
@cindex Integration

@noindent
More documentation is included in the @code{doc}
directory, especially the @code{FIDOGATE-Point-HOWTO}. Most of it is
written in German, though.

@table @code

@item scripts/inn
Scripts for INN.

@item scripts/cnews
Scripts for CNews.

@item sendmail/cf
Sendmail V8 configuration files (m4) and example .mc files for
FIDOGATE: Fido.DE domain gateway morannon, orodruin, point setup.

@end table

Much more concise instructions should be here!!! ;-)



@c ***************************************************************************
@node Testing, Connecting, Integration, Installation

@section Testing FIDOGATE Operation
@cindex Testing

@subsection @code{ftn2rfc}

@noindent
To verify proper operation of FIDOGATE, copy a FIDO mail packet to the
directory SPOOLDIR/in, then execute LIBDIR/ftn2rfc as user
@code{OWNER}. Add some @code{-v} options for verbose debug messages:
@example
@i{libdir}/ftn2rfc -vvvvv
@end example

This should result in one or more files named @code{nnnnnnnn.msg} in the
directories SPOOLDIR/in/mail and SPOOLDIR/in/news. Check these files and
verify that they at least look like RFC headers. ;-)

Next execute
@example
@i{libdir}/ftninpost
@end example
this will feed those files to @code{rnews} and @code{sendmail}. After
some processing you should find the messages in your mail folder and/or
newsgroups.


@subsection @code{rfc2ftn}

@noindent
Grab a single news posting in a FIDO linked newsgroup and feed
it to @code{rfc2ftn}:
@example
@i{libdir}/rfc2ftn -vvvvv -n <ARTICLE
@end example
This should result in a FIDO mail packet @code{nnnnnnnn.pkt} in the
directory SPOOLDIR/out.

Do the same with a mail message addressed to a FIDO recipient:
@example
@i{libdir}/rfc2ftn -vvvvv USER_NAME@@FIDO.ADDRESS <MESSAGE
@end example
Again you should get a packet @code{nnnnnnnn.pkt} in
SPOOLDIR/out.

If this is working and you have integrated FIDOGATE and mail/news, you can
try posting an article to a FIDO linked newsgroups and/or mailing a
message to a recipient on FIDONET.  The resulting packets should be in
SPOOLDIR/out.



@c ***************************************************************************
@node Connecting, Programs, Testing, Installation

@section Connecting to FIDONET
@cindex Connecting
@cindex FIDONET

@noindent
FIDOGATE does NOT include a FIDO mailer, so you have to transfer FIDO
mail to and from the UNIX system by some other means.

If you want everything running on the UNIX system, you need a FIDO
mailer for UNIX. To my knowledge there are two working FIDO mailers:
@itemize @bullet
@item BinkleyTerm 3.02pl10a
@item ifcico 2.x from Eugene Crosser's ifmail package
@end itemize

Another solution is a separate PC running DOS or OS/2 and BinkleyTerm as
a mailer. The Fido.DE gateway currently comprises a LINUX PC for the
gateway/tosser and Samba server, and an OS/2 PC running BinkleyTerm for
the analog phone and ISDN lines. The BinkleyTerm outbound is kept on the
LINUX server, so the OS/2 PC and the gateway have access to it.



@c ***************************************************************************
@node Programs, ffx, Connecting, Top

@chapter FIDOGATE Programs
@cindex Programs

@noindent
The current FIDOGATE distribution includes the following programs and
scripts:

@iftex
@table @code
@item ffx
Remote execution via FIDO mailer
@item ffxbatch
Remove execution via FIDO mailer - batched
@item ffxmail
@code{ffx} frontend for sending mail
@item ffxqt
Execute @code{ffx} requests
@item ffxrmail
@code{rmail} command for @code{ffxqt}
@item ffxrun
Script for running @code{ffxqt}
@item ftn2ftn
FTN-FTN NetMail gateway
@item ftn2rfc
FTN-Internet mail/news gateway
@item ftnaf
Areafix
@item ftnafmail
Areafix mail frontend
@item ftnbounce
Bounce mail to unknown FTN address, NOT YET IMPLEMENTED.
@item ftnbsy
Create/delete Binkley busy files
@item ftnconfig
Retrieve information from FIDOGATE config files
@item ftnhatch
Hatch new file into file echo
@item ftnin
Frontend for @code{ftn2rfc}
@item ftninpost
Mail/news processing script
@item ftninrecomb
Mail/news recombining script
@item ftnlock
Create/delete lock files
@item ftnlog
Write message to log file
@item ftnpack
Pack (ArcMail) FTN mail packets
@item ftnroute
Route FTN mail packets
@item ftnseq
Access sequencer file
@item ftntick
Process incoming file echos
@item ftntoss
Toss/remap/rewrite FTN mail packets
@item ftnfattach
Binkley outbound file attach utility
@item pktdebug
FTN mail packet debugger
@item rfc2ftn
Internet-FTN gateway
@item rundf
Script for checking free disk space
@item runin
Script for processing inbound packets
@item runout
Script for processing gateway output packets
@item runtoss
Script for running tosser
@item rununpack
Script for unpacking arcmail archives
@item sumcrc
CRC checksum utility
@end table

@end iftex

@menu
* ffx::         Remote execution via FIDO mailer
* ffxbatch::    Remove execution via FIDO mailer - batched
* ffxmail::     @code{ffx} frontend for sending mail
* ffxqt::       Execute @code{ffx} requests
* ffxrmail::    @code{rmail} command for @code{ffxqt}
* ffxrun::      Script for running @code{ffxqt}
* ftn2ftn::     FTN-FTN NetMail gateway
* ftn2rfc::     FTN-Internet mail/news gateway
* ftnaf::       Areafix
* ftnafmail::   Areafix mail frontend
* ftnbounce::   Bounce mail to unknown FTN address
* ftnbsy::      Create/delete Binkley busy files
* ftnconfig::   Retrieve information from FIDOGATE config files
* ftnhatch::    Hatch new file into file
* ftnin::       Frontend for @code{ftn2rfc}
* ftninpost::   Mail/news processing script
* ftninrecomb:: Mail/news recombining script
* ftnlock::     Create/delete lock files
* ftnlog::      Write message to log file
* ftnpack::     Pack (ArcMail) FTN mail packets
* ftnroute::    Route FTN mail packets
* ftnseq::      Access sequencer file
* ftntick::     Process incoming file echos
* ftntoss::     Toss/remap/rewrite FTN mail packets
* ftnfattach::  Binkley outbound file attach utility
* pktdebug::    FTN mail packet debugger
* rfc2ftn::     Internet-FTN gateway
* rundf::       Script for checking free disk space
* runin::       Script for processing inbound packets
* runout::      Script for processing gateway output packets
* runtoss::     Script for running tosser
* rununpack::   Script for unpacking arcmail archives
* sumcrc::      CRC checksum utility
@end menu

Almost all FIDOGATE programs support standard options, which aren't
listed in the following sections describing the individual programs:

@table @code

@item -v --verbose
Increase the verbosity/debug level.

@item -h --help
Help on usage and options.

@item -c --config @i{name}
Read an alternate config file. @code{""} means none. @i{name} may
start with @code{%L/}, indicating a file relative to LIBDIR.

@item -L --lib-dir @i{name}
Set the FIDOGATE library directory (LIBDIR).

@item -S --spool-dir @i{name}
Set the FIDOGATE spool directory (SPOOLDIR).

@item -a --addr @i{Z:N/F.P}
Set the main address of this system.

@item -u --uplink-addr @i{Z:N/F.P}
Set the uplink address (boss node) of this system.

@end table


The option @code{-a} and @code{-u} also support Internet-style FTN
addresses, e.g. @code{p10.f110.n2452.z2}. If any of these options is
specified, all addresses from the config file are disabled.

All options and config statements which take file or directory names
accept the following @code{%} abbreviations:

@table @code

@item %L
The value of @code{LibDir}

@item %S
The value of @code{SpoolDir}

@item %G
The value of @code{LogDir}

@item %O
The value of @code{Outbound}

@item %I
The value of @code{Inbound}

@item %P
The value of @code{PInbound}

@item %U
The value of @code{UUInbound}

@end table



@c ***************************************************************************
@node ffx, ffxbatch, Programs, Programs

@section ffx --- Remote Execution via FIDO Mailer
@cindex ffx
@cindex Remote execution

@noindent Usage:

@example
ffx  @r{[}@i{-options}@r{]}  @i{Z:N/F.P}  @i{command}
@end example

@noindent Options:

@table @code

@item -b --batch-dir @i{dir}
Operate in batch mode, using @i{dir}. Control and data files are not
immediately appended to the node's FLO file, but rather written to a
separate batch directory SPOOLDIR/out.ZZZ/@i{dir}. Implies @code{-n}.

@item -B --binkley @i{name}
Set Binkley outbound directory.

@item -F --flavor @i{flavor}
Set flavor of outbound FLO file: @code{Hold}, @code{Normal},
@code{Direct}, or @code{Crash}.

@item -g --grade @i{grade}
Set grade of control and data files to @i{grade} (single letter [a-z0-9]).

@item -n --nocompression
Don't compress data files.

@end table

The compression program (@code{gzip}) and other are hardcoded in the
@code{ffx.c} source code.



@c ***************************************************************************
@node ffxbatch, ffxmail, ffx, Programs

@section ffxbatch --- Batches Remote Executon via FIDO Mailer
@cindex ffxbatch
@cindex Remote execution

@noindent Usage:

@example
ffxbatch  @r{[}@i{-options}@r{]}  @i{Z:N/F.P}  @i{command}
@end example

@noindent Options:

@table @code

@item -b --batch-dir @i{dir}
Select batch directory as used by @code{ffx -b}@i{dir}. The files in this
directory will be archived and transfered as a single @code{ffx} command.

@item -B --binkley @i{name}
Set Binkley outbound directory.

@item -F --flavor @i{flavor}
Set flavor of outbound FLO file: @code{Hold}, @code{Normal},
@code{Direct}, or @code{Crash}.

@item -g --grade @i{grade}
Set grade of control and data files to @i{grade} (single letter [a-z0-9]).

@item -w --wait-bsy
Wait, if busy file for the node exists. Default: terminate, don't archive
batched @code{ffx}-Jobs.

@end table

The name of the archiving program (@code{zip}) is hardcoded in the
@code{ffxbatch.c} source.



@c ***************************************************************************
@node ffxmail, ffxqt, ffxbatch, Programs

@section ffxmail --- ffx Frontend for Sending Mail
@cindex ffxmail
@cindex Mail

@noindent Usage:

@example
ffxmail  @i{Z:N/F.P}  @i{address} @r{...}
@end example

@noindent No options.

@code{ffxmail} calls @code{ffx} in batch mode (@code{-b}), selecting the
batch directory from the node address. Modify the script
(@code{src/ffxmail.sh}) for other addresses/batch directories.



@c ***************************************************************************
@node ffxqt, ffxrmail, ffxmail, Programs

@section ffxqt --- Execute ffx Requests
@cindex ffxqt
@cindex Remote Execution

@noindent Usage:

@example
ffxqt  @r{[}@i{-options}@r{]}
@end example

@noindent Options:

@table @code

@item -g  --grade @i{grade}
Process ffx jobs with @i{grade} only. @i{grade} must be a single letter.

@item -I --inbound @i{name}
Select the input directory where the @code{f???????.ffx} control files
are read from. Default: INBOUND

@item -t --insecure
Process ffx files without password. Default: ffx file must contain a
password.

@end table

@code{ffxqt} searches the input directory for control files and executes
the requested commands. Commands are executed by running
LIBDIR/ffxqt-dir/@i{command}, so every allowed command must reside as a
script or symbolic link there.

Some program/paths are hard coded in the @code{ffxqt.c} code.



@c ***************************************************************************
@node ffxrmail, ffxrun, ffxqt, Programs

@section ffxrmail --- Script for Processing FFX @code{rmail} Commands
@cindex ffxrmail
@cindex ffxqt

@noindent Usage:

@example
ffxrun  @r{[}-v@r{]}
@end example

Perl script to be called as @code{rmail} by @code{ffxqt}. This replaces
@code{/bin/rmail} (UUCP), calling @code{/usr/lib/sendmail} directly with
appropiate options.

Installed as LIBDIR/ffxqt-dir/@code{rmail}.



@c ***************************************************************************
@node ffxrun, ftn2ftn, ffxrmail, Programs

@section ffxrun --- Script for Running ffxqt
@cindex ffxrun
@cindex ffxqt

@noindent Usage:

@example
ffxrun  @r{[}@i{ffxqt options}@r{]}
@end example

This script runs @code{ffxqt} twice (the second run for processing batch
archives unpacked by the first one). All command line arguments are passed
to @code{ffxqt}.



@c ***************************************************************************
@node ftn2ftn, ftn2rfc, ffxrun, Programs

@section ftn2ftn --- FTN-FTN NetMail Gateway
@cindex ftn2ftn
@cindex Gateway

@noindent Usage:

@example
ftn2ftn  @r{[}@i{-options}@r{]}  @r{[}@i{packet} @r{... ]}
@end example

@noindent Options:

@table @code

@item -A --address-a @i{Z:N/F.P}
Set FTN address in network A.

@item -B --address-b @i{Z:N/F.P}
Set FTN address in network B.

@item -o --out-packet-file @i{NAME}
Set output packet file name.

@item -O --out-packet-dir @i{NAME}
Set output packet directory.

@end table

This program provides a NetMail gateway between different FTNs, using
the (somewhat) standard "User Name%Z:N/F.P" addressing in the FTN from
and to fields.

If no @i{packet} is given on the command line, @code{ftn2ftn} looks for
packets addressed to the gateway addresses (A and B) in the Binkley
outbound. Both gateway addresses must be specified with the @code{-A} and
@code{-B} options.

If a @i{packet} name is passed on the command line, @code{ftn2ftn} will
gate this to the other network A. The gateway address (sender of the mails
in network A) is set with @code{-A} option.



@c ***************************************************************************
@node ftn2rfc, ftnaf, ftn2ftn, Programs

@section ftn2rfc --- FTN-Internet Gateway
@cindex ftn2rfc
@cindex Gateway

@noindent Usage:

@example
ftn2rfc  @r{[}@i{-options}@r{]}  @r{[}@i{packet} @r{... ]}
@end example

@noindent Options:

@table @code

@item -1 --single-articles
Write single articles to output files (in @code{tmpnews}), not news
batches containing several articles (batch is default).

@item -I --inbound-dir @i{NAME}
Set the input directory for FTN packets.

@item -i --ignore-hosts
Don't bounce unknown hosts (unknown = not registered in @code{hosts})

@item -l --lock-file
Create lock file while processing.

@item -n --no-remove
Don't remove or rename input packet files, return exit code 1 if
processing fails.

@item -t --insecure
Operate in insecure mode. All messages containing a To line for gateway
addressing will be bounced. Also sets the input directory to
SPOOLDIR/insecure.

@item -x --exec-program @i{SCRIPT}
Run @i{SCRIPT} after processing all FTN packets. Typically this is
@code{%L/ftninpost}.

@end table

@code{ftn2rfc} reads packet files from the input directory or the
command line and converts the FTN packets to Internet RFC mail and news,
written as mail files and news batches to the directories
SPOOLDIR/in/mail and SPOOLDIR/in/news, respectively.



@c ***************************************************************************
@node ftnaf, ftnafmail, ftn2rfc, Programs

@section ftnaf --- Areafix
@cindex ftnaf
@cindex Areafix

@noindent Usage:

@example
ftnaf  @r{[}@i{-options}@r{]}  @r{[}@i{Z:N/F.P}  @i{command} @r{]}
@end example

@noindent Options:

@table @code

@item -m --mail
Process Areafix mail message (RFC) on stdin.

@item -r --no-reply
Don't send reply via mail, write to stdout.

@item -n --no-rewrite
Don't rewrite AREAS.BBS.

@item -b --areas-bbs @i{NAME}
Use alternate AREAS.BBS.

@item -F --filefix
Run as Filefix program, using FAREAS.BBS.
@end table

@noindent Commands:

@table @code

@item listall
List all areas.

@item list
List areas available to node.

@item query
List subscribed areas.

@item unlinked
List unsubscribed areas.

@item passwd @i{Z:N/F.P} @i{PASSWORD}
@item password @i{Z:N/F.P} @i{PASSWORD}
@item pass @i{Z:N/F.P} @i{PASSWORD}
Set address and password.

@item add @i{AREA}
@item +@i{AREA}
@item @i{AREA}
Subscribe to @i{AREA}.

@item remove @i{AREA}
@item delete @i{AREA}
@item del @i{AREA}
@item -@i{AREA}
Unsubscribe from @i{AREA}.

@item create @i{AREA}  @r{[}@i{-options} @r{]}
Create new area. AUTHORISATION NOT YET IMPLEMENTED, command works only
from command line. Allowed @code{areas.bbs} @i{options}: @code{-r},
@code{-#}, @code{-l}, @code{-k}, and @code{-d}. If you want to set an
area description using @code{-d "Some Text"}, enclose the whole
@i{command} in single quotes @code{'...'}.

@item vacation @i{AREA}
Set vacation flag for @i{AREA}.

@item help
Help on Areafix commands.

@end table

All command keywords may be prefixed by @code{%}. @code{ftnaf} also
recognizes the @code{-q} (= query) and @code{-l} (= list) options
following the password in the subject header.

For proper operation @code{ftnaf} requires the @code{X-FTN-From} header
generated by @code{ftn2rfc} (see @code{config.h} configuration).



@c ***************************************************************************
@node ftnafmail, ftnbounce, ftnaf, Programs

@section ftnafmail --- Areafix Mail Frontend
@cindex ftnaf
@cindex Areafix

@noindent Usage:

@example
ftnafmail  @r{[}@i{-options}@r{]}
@end example

@noindent Options:

@table @code

@item -F --filefix
Run @code{ftnaf} as Filefix program.

@end table

This is the setuid mail frontend for @code{ftnaf} to be run from the
sendmail aliases:

@example
# Areafix/Filefix - FIDOGATE ftnaf
areafix: "|/usr/local/lib/fidogate/ftnafmail"
areamgr: areafix
filefix: "|/usr/local/lib/fidogate/ftnafmail -F"
filemgr: filefix
@end example



@c ***************************************************************************
@node ftnbounce, ftnbsy, ftnafmail, Programs

@section ftnbounce --- Bounce Mail to Unknown Addresses
@cindex ftnbounce
@cindex Bounce

@noindent Usage:

@example
ftnbounce  @r{[}@i{-options}@r{]}  @r{[}@i{packet} @r{... ]}
@end example

@noindent Options:

NOT YET IMPLEMENTED. (Only program skeleton is there.)



@c ***************************************************************************
@node ftnbsy, ftnconfig, ftnbounce, Programs

@section ftnbsy --- Create/delete Binkley Busy Filess
@cindex ftnbsy
@cindex Busy files

@noindent Usage:

@example
ftnbsy  @r{[}@i{-options}@r{]}  @i{Z:N/F.P} @r{...}
@end example

@noindent Options:

@table @code

@item -t --test
Test for existing busy file.

@item -l --lock
Create busy file, fail if it already exists.

@item -u --unlock
Remove busy file.

@item -w --wait
Wait for busy file to be released (when @code{-l} option is given).

@end table



@c ***************************************************************************
@node ftnconfig, ftnhatch, ftnbsy, Programs

@section ftnconfig --- Retrieve information from FIDOGATE config files
@cindex ftnconfig
@cindex Config

@noindent Usage:

@example
ftnconfig  @r{[}@i{-options}@r{]}  @i{parameter}
@end example

@noindent Options:

@table @code

@item -l --no-newline
No output of newline after the parameter value.

@item -n --no-output
No output, exit code only.

@item -t --test-only
Output @code{1} if the parameter is present, @code{0} if not.

@end table

@noindent Special parameters:

@table @code

@item =fqdn
Fully qualified domain name.

@item =hostname
Hostname.

@item =domainname
Domainname.

@item =hostsdomain
Domain for entries in @code{hosts} config files.

@end table



@c ***************************************************************************
@node ftnhatch, ftnin, ftnconfig, Programs

@section ftnhatch --- Hatch new file into file echo
@cindex ftnhatch

@noindent Usage:

@example
ftnhatch  @r{[}@i{-options}@r{]}  @i{area}  @i{file}  "@i{description}"
@end example

@noindent Options:

@table @code

@item -b --fareas-bbs @i{NAME}
Use alternate FAREAS.BBS.

@end table



@c ***************************************************************************
@node ftnin, ftninpost, ftnhatch, Programs

@section ftnin --- Frontend for @code{ftn2rfc}
@cindex ftnin
@cindex ftn2rfc

@noindent Usage:

@example
ftnin  @r{[}@i{-options}@r{]}
@end example

@noindent Options:

@table @code

@item -n --no-toss
Don't call @code{ftn2rfc} for processing.

@item -x --exec-program @i{SCRIPT}
Execute @i{SCRIPT} after @code{ftn2rfc} processing, typically
@code{%L/ftninpost}.

@end table

All standard options are passed to the called @code{ftn2rfc}.

@code{ftnin} looks for mail packets addressed to the gateway addresses
(all @code{Address} statements in @code{config}) and calls @code{ftn2rfc}
for each packet.



@c ***************************************************************************
@node ftninpost, ftninrecomb, ftnin, Programs

@section ftninpost --- Mail/News Processing Script
@cindex ftninpost

@noindent Usage:

@example
ftninpost  @r{[}@i{-options}@r{]}
@end example

This script is run by @code{ftn2rfc} or @code{ftnin}, feeding the output
in SPOOLDIR/in/mail and SPOOLDIR/in/news to @code{sendmail} and
@code{rnews}, respectively.



@c ***************************************************************************
@node ftninrecomb, ftnlock, ftninpost, Programs

@section ftninrecomb --- Mail/News Recombining Script
@cindex ftninrecomb

@noindent Usage:

@example
ftninrecomb  @r{[}@i{-options}@r{]}
@end example

If @code{FTNInRecombine} is enabled in @code{config.gate}, this script
wil be run by @code{ftninpost} to recombine split messages.



@c ***************************************************************************
@node ftnlock, ftnlog, ftninrecomb, Programs

@section ftnlock --- Create/Remove Lock Files
@cindex ftnlock
@cindex Lock files

@noindent Usage:

@example
ftnlock  @r{[}@i{-options}@r{]}  @r{[}@i{NAME}@r{]}  @r{[}@i{ID}@r{]}
@end example

@noindent Options:

@table @code

@item -l --lock
Create lock file @i{NAME}, fail if it already exists (exit code=2). If
@i{NAME} is not specified, the default @code{ftnlock} is used. The
optional parameter @i{ID} specifies the contents of the lock file, the
default is @code{-none-}.

@item -u --unlock
Remove lock file @i{NAME}.

@item -w --wait
Wait while creating lock file. Default: immediately return, if the lock
file can't be created because it already exists.

@end table

Lock files are created as SPOOLDIR/locks/@i{NAME}.



@c ***************************************************************************
@node ftnlog, ftnpack, ftnlock, Programs

@section ftnlog --- Write Message to Log File
@cindex ftnlog
@cindex Log file
@cindex Logging

@noindent Usage:

@example
ftnlog  @r{[}@i{-options}@r{]}  @i{message text}
@end example

@noindent Options:

@table @code

@item -p --program @i{NAME}
Set program name for logging.

@end table

This program is used to write a log message from a shell script. The log
file name may be specified with the @code{LOGFILE} environment variable.



@c ***************************************************************************
@node ftnpack, ftnroute, ftnlog, Programs

@section ftnpack --- Pack FTN ArcMail Packets
@cindex ftnpack
@cindex ArcMail

@noindent Usage:

@example
ftnpack  @r{[}@i{-options}@r{]}  @r{[}@i{packet} @r{... ]}
@end example

@noindent Options:

@table @code

@item -B --binkley @i{dir}
Set Binkley outbound directory.

@item -f --ffx @i{Z:N/F.P}
Pack ffx control and data files for FTN address @i{Z:N/F.P}. You must
also set the appropiate input directory with the @code{-I} option.

@item -F --file-dir @i{dir}
Sets directory, where @code{ftnpack} looks for file attachments. Should
be the appropiate inbound directory, see also the @code{runtoss}
script. If this option is not specified, no file attachments are
processed.

If @code{-F /} is specified, @code{ftnpack} accepts a complete path name
in the subject and doesn't search the directory. Warning: this option
compromises security to some degree, because it allows @b{any} user to
send @b{any} file readable by the user id running the tosser and
mailer!!!

@item -g --grade @i{grade}
Only process packets with @i{grade} (single letter).

@item -I --in-dir @i{dir}
Set input directory. Default: SPOOLDIR/toss/out

@item -O --out-dir @i{dir}
Set directory for temporary packets. Default: SPOOLDIR/toss/pack. This
is the directory, where packets to be put into arcmail archives will be
created.

@item -l --lock-file
Create lock file while processing.

@item -m --maxarc @i{size}
Set maximum size of an archive to @i{size} KByte. If an existing
ArcMail archive exceeds this size, @code{ftnpack} creates a new one.

@item -p --packing-file @i{name}
Read alternate @code{packing} config file. Default: LIBDIR/packing

@item -P --pkt
Process *.pkt files in the input directory. Default: output files of
@code{ftnroute}.

@end table



@c ***************************************************************************
@node ftnroute, ftnseq, ftnpack, Programs

@section ftnroute --- Route FTN Mail Packets
@cindex ftnroute
@cindex Routing

@noindent Usage:

@example
ftnroute  @r{[}@i{-options}@r{]}  @r{[}@i{packet} @r{... ]}
@end example

@noindent Options:

@table @code

@item -g --grade @i{grade}
Only process packets with @i{grade} (single letter).

@item -I --in-dir @i{name}
Set input directory. Default: SPOOLDIR/toss/tmp

@item -O --out-dir @i{name}
Set output directory. Default: SPOOLDIR/toss/out

@item -l --lock-file
Create lock file while processing.

@item -r --routing-file @i{name}
Read alternate @code{routing} config file. Default: LIBDIR/routing

@item -M --maxopen @i{n}
Set maximum number of concurrently open packet filess to
@i{n}. Default: 10 (@code{MAXOPENFILES} from @code{config.h})

@end table



@c ***************************************************************************
@node ftnseq, ftntick, ftnroute, Programs

@section ftnseq --- Command Line Interface to Sequencer Files
@cindex ftnseq

@noindent Usage:

@example
ftnseq  @r{[}@i{-options}@r{]}  @i{sequencer}
@end example

This utilitity increments the named @i{sequencer} file outputs the
resulting value to standard output. Useful for accessing FIDOGATE
sequencer files from perl and shell scripts.



@c ***************************************************************************
@node ftntick, ftntoss, ftnseq, Programs

@section ftntick --- Process incoming file echos
@cindex ftntick

@noindent Usage:

@example
ftntick  @r{[}@i{-options}@r{]}
@end example

@noindent Options:

@table @code

@item -b --fareas-bbs @i{file}
Use alternate FAREAS.BBS.

@item -I --inbound @i{dir}
Use alternate inbound directory.

@item -t --insecure
Insecure processing, do TIC files without password.

@end table



@c ***************************************************************************
@node ftntoss, ftnfattach, ftntick, Programs

@section ftntoss --- Toss FTN Mail Packets
@cindex ftntoss
@cindex Tossing

@noindent Usage:

@example
ftntoss  @r{[}@i{-options}@r{]}  @r{[}@i{packet} @r{... ]}
@end example

@noindent Options:

@table @code

@item -d --no-dupecheck
Disabled dupe check (if @code{DupeCheck} is enabled in
@code{config.main}).

@item -g --grade @i{grade}
Only process packets with @i{grade} (single letter).

@item -I --in-dir @i{name}
Set input directory. Default: SPOOLDIR/toss/in

@item -O --out-dir @i{name}
Set output directory. Default: SPOOLDIR/toss/tmp

@item -l --lock-file
Create lock file while processing.

@item -t --insecure
Insecure EchoMail tossing, don't check sender against nodes listed in
AREAS.BBS.

@item -n --toss-all
Toss all EchoMail, even messages not addressed to one of our own AKAs
(most probably routed EchoMail).


@item -n --passthru
Make all areas passthru (see also @code{#} in areas.bbs).

@item -r --routing-file @i{name}
Read alternate @code{routing} config file. Default: LIBDIR/routing

@item -s --strip-attribute
Strip Hold and Crash attribute from incoming NetMails.

@item -m --maxmsg @i{n}
Flush/close all output packet files after reading @i{n} messages.

@item -x --maxmsg-exit @i{n}
Flush/close all output packet files after reading @i{n} messages and
processing the current input packet, then exit.

@item -M --maxopen @i{n}
Set maximum number of concurrently open packet filess to
@i{n}. Default: 10 (@code{MAXOPENFILES} from @code{config.h})

@end table



@c ***************************************************************************
@node ftnfattach, pktdebug, ftntoss, Programs

@section ftnfattach --- Outbound file attaches
@cindex ftnfattach
@cindex File attach

@noindent Usage:

@example
ftnfattach  @r{[}@i{-options}@r{]}  @i{Z:N/F.P}  @i{file} @r{...}
@end example

@noindent Options:

@table @code

@item -B --binkley @i{name}
Set Binkley outbound directory.

@item -F --flavor @i{name}
Set flavor of outbound FLO file to @i{name}: @code{Hold},
@code{Normal}, @code{Direct}, or @code{Crash}.

@end table

The file name may start with @code{^} or @code{#}, indicating that
the file should be deleted or truncated, respectively, after sending.



@c ***************************************************************************
@node pktdebug, rfc2ftn, ftnfattach, Programs

@section pktdebug --- FTN mail packet debugger
@cindex pktdebug


@noindent Usage:

@example
pktdebug  @r{[}@i{-options}@r{]}  @i{file} @r{...}
@end example

@noindent Options (standard options not supported):

@table @code

@item -m --msg-header
Print message header.

@item -t --msg-text
Print message text. Implies @code{-m}.

@item -v --verbose
Increase verbose/debug level.

@item -h --help
Help on @code{pktdebug} usage.

@end table

This utility displays the packet header and optionally the message
header and message body contents.

See also the @code{util/pktmore} utitility, which pipes the output of
@code{pktdebug} to @code{$PAGER}.



@c ***************************************************************************
@node rfc2ftn, rundf, pktdebug, Programs

@section rfc2ftn --- Internet-FTN Gateway
@cindex rfc2ftn
@cindex Gateway


@noindent Usage:

@example
rfc2ftn  @r{[}@i{-options}@r{]}  @r{[}@i{address} @r{...]}
@end example

@noindent Options:

@table @code

@item -b --news-batch
Process news batch (implies @code{-n}).

@item -B --binkley @i{name}
Set Binkley outbound directory.

@item -i --ignore-registration
Do not bounce mail to FTN nodes not registered in HOSTS (if
@code{HOSTS_RESTRICTED} in @code{config.h} is enabled).

@item -n --news-mode
Process news message in stdin. Default: mail

@item -o --out-packet-file  @i{name}
Write output to FTN packet file @i{name}.

@item -O --out-packet-dir  @i{name}
Set output directory for FTN packets. Default: SPOOLDIR/out

@item -t --to
Get recipient addresses from To, Cc, Bcc headers instead of command line.

@item -w --write-outbound  @i{flav}
Write output directly to Binkley .?UT packets in outbound.

@item -W --write-crash
Write only crash mail directly to Binkley .CUT file.

@end table



@c ***************************************************************************
@node rundf, runin, rfc2ftn, Programs

@section rundf --- Script for Checking Free Disk Space
@cindex rundf
@cindex Tossing

@noindent Usage:

@example
rundf  @i{dir}
@end example

@noindent No options.

This shell script returns the free disk space (kB) of the file system
containing @i{dir}. It is called by @code{runtoss} for the directories
@code{OUTBOUND} and @code{SPOOLDIR}.

As distributed with FIDOGATE this script requires @code{df} from the GNU
file utilities. If you don't have this one, you must adapt
@code{src/rundf.sh} to the output of your @code{df}.



@c ***************************************************************************
@node runin, runout, rundf, Programs

@section runin --- Script for Processing Inbound Packets
@cindex runin
@cindex Tossing

@noindent Usage:

@example
runin
@end example

@noindent No options.

Runs the tosser for the inbound directories:

@itemize @bullet

@item
Unpacking ArcMail archives from the insecure inbound (@code{rununpack})

@item
Tossing packets from the insecure inbound (@code{runtoss})

@item
Unpacking ArcMail archives from the protected inbound (@code{rununpack})

@item
Tossing packets from the protected inbound (@code{runtoss})

@end itemize

All log messages are written to LIBDIR/log-in.

Edit this script (@code{src/runin.sh}) to meet your local
requirements.



@c ***************************************************************************
@node runout, runtoss, runin, Programs

@section runout --- Script for Processing Gateway Output Packets
@cindex runout
@cindex Tossing

@noindent Usage:

@example
runout
@end example

@noindent No options.

Runs the tosser for the gateway output directory, all log messages are
written to LIBDIR/log-out.

Edit this script (@code{src/runout.sh}) to meet your local
requirements.



@c ***************************************************************************
@node runtoss, rununpack, runout, Programs

@section runtoss --- Script for Running Tosser
@cindex runtoss
@cindex Tossing


@noindent Usage:

@example
runtoss  @i{type}
@end example

@noindent No options.

@noindent Types:

Please the the script source code (@code{src/runtoss.sh}) for available
@i{type} parameters and feel free to adapt it to your requirements.



@c ***************************************************************************
@node rununpack, sumcrc, runtoss, Programs

@section rununpack --- Script for Unpacking ArcMail Archives
@cindex rununpack
@cindex Tossing

@noindent Usage:

@example
rununpack  @i{type}
@end example

@noindent No options.

@noindent Types:

Please the the script source code (@code{src/rununpack.sh}) for available
@i{type} parameters and feel free to adapt it to your requirements.

It requires the @code{file} command and the following definitions in
LIBDIR@code{/magic} to work properly (done by make install):

@example
# ----- Archiver ----------------------------------
0       string          PK              ZIP Archive
0       byte            0x1a            ARC Archive
2       string          -lh             LHA Archive
0       string          ZOO             ZOO Archive
0       short           0xea60          ARJ Archive
0       short           0x60ea          ARJ Archive
@end example

Edit the script (@code{src/rununpack.sh}) if necessary, changing
unpacker names. The required programs are @code{unzip}, @code{unarj},
@code{lha}(@code{rc}), @code{zoo}, @code{arc}.



@c ***************************************************************************
@node sumcrc, Config files, rununpack, Programs

@section sumcrc --- CRC Checksum Utility
@cindex sumcrc
@cindex CRC
@cindex Checksum


@noindent Usage:

@example
sumcrc  @r{[}@i{-options}@r{]}  @i{file} @r{...}
@end example

@noindent Options (standard options not supported):

@table @code

@item -1 --skip-first-line
Skip first line in @i{file}. Useful for computing nodelist CRC.

@item -3 --crc32
Compute 32 bit CRC checksum, using the standard 32 bit polynomial (same as
in ZModem, ZIP). Default: 16 bit CRC CCITT polynomial.

@item -6 --crc16
Use alternate 16 bit CRC16 polynomial.

@item -x --hex
Output CRC value in hex. Default: decimal

@item -z --eof-at-ctrl-z
The Ctrl-Z character (@code{^Z}) indicates end-of-file (MSDOS kludge).

@item -v --verbose
Increase verbose/debug level.

@item -h --help
Help on @code{sumcrc} usage.

@end table

Use @code{sumcrc -1z} to compute the checksum for a standard FIDO
nodelist.




@c ***************************************************************************
@node Config files, Config, sumcrc, Top

@chapter FIDOGATE Config Files
@cindex Config files

@noindent
FIDOGATE uses the following config files:

@iftex

@table @code
@item config.common
@item config.gate
@item config.main
@item config.ffx
Configuration file: common settings, gateway, node, ffx programs
@item hosts
FTN address to host name conversion
@item aliases
User aliases
@item areas
FTN area to newsgroup conversion
@item bounce.*
Bounce messages of @code{ftn2rfc}
@item passwd
Password config file
@item permissions
Permissions config file
@item routing
Routing file for @code{ftntoss} and @code{ftnroute}
@item packing
Packing file for @code{ftnpack}
@item areas.bbs
@item fareas.bbs
EchoMail / file echo distribution
@end table

FIDOGATE tries to find these config files in @code{LIBDIR} (compiled-in
default), if no @code{-L} command line option is used. In addition,
FIDOGATE 4.2.7 and newer supports the environment variable
@code{FIDOGATE}, which tells the various programs where to look for
their config files.

@end iftex

@menu
* Config::      @code{config.*} configuration files
* Hosts::       @code{hosts} FTN address to host name conversion
* Aliases::     @code{aliases} user aliases
* Areas::       @code{areas} FTN area to newsgroup conversion
* Bounce::      Bounce messages of @code{ftn2rfc}
* Passwd::      @code{passwd} password config file
* Routing::     @code{routing} file for @code{ftntoss} and @code{ftnroute}
* Packing::     @code{packing} file for @code{ftnpack}
* Areas.bbs::   @code{areas.bbs} EchoMail distribution
@end menu

All config files use the @code{#} character for introducing a comment
and ignore empty lines. Keywords and commands are not case-sensitive.

All config files (with the execption of @code{areas.bbs} support an
@code{include} command for reading in other config files. @code{include}
must be the first keyword on the line, the filename is the next
argument.

All options and config statements which take file or directory names
accept the following @code{%} abbreviations:

@table @code

@item %L
The value of @code{LibDir}

@item %S
The value of @code{SpoolDir}

@item %G
The value of @code{LogDir}

@item %O
The value of @code{Outbound}

@item %I
The value of @code{Inbound}

@item %P
The value of @code{PInbound}

@item %U
The value of @code{UUInbound}

@end table



@c ***************************************************************************
@node Config, Hosts, Config files, Config files

@section @code{config.*} Configuration Files
@cindex Config

@noindent
FIDOGATE uses different config files:

@table @code
@item config.common
Common settings.
@item config.gate
The config file for the gateway related programs @code{ftn2rfc},
@code{ftnin}, @code{ftninpost}, @code{ftninrecomb}, @code{rfc2ftn}.
@item config.main
The config file for the tosser related programs @code{ftn2ftn},
@code{ftnaf}, @code{ftnbounce}, @code{ftnbsy}, @code{ftnconfig},
@code{ftnhatch}, @code{ftnlock}, @code{ftnlog}, @code{ftnpack},
@code{ftnroute}, @code{ftnseq}, @code{ftntick}, @code{ftntoss},
@code{ftnfattach}.
@item config.ffx
The config file for the ffx programs @code{ffx}, @code{ffxbatch},
@code{ffxqt}
@end table

The format of these files is

@example
@i{keyword} @r{[} @i{arg ...} @r{]}
@end example

Keywords and arguments may be quoted in @code{""}, keywords are
case-insensitive.



@c ---------------------------------------------------------------------------
@noindent
Common configuration:

@table @code

@item include @i{file}
Include another config file, may be nested.

@item Address @i{node}
Your FTN address (Z:N/F.P). There may be up to 32 @code{Address}
statements (@code{MAXADDRESS} from @code{config.h}).

@item Uplink @i{node}
The FTN address of your uplink, must be in the same order as the
corresponding @code{Address} statements. There may be up to 32
@code{Uplink} statements.

@item LibDir @i{directory}
The FIDOGATE lib directory (default specified in @code{config.make}).

@item SpoolDir @i{directory}
The FIDOGATE spool directory (default specified in @code{config.make}).

@item LogDir @i{directory}
The FIDOGATE log file directory (default specified in
@code{config.make}).

@item Outbound @i{directory}
The BinkleyTerm-style outbound base directory, without the
@code{out.}@i{nnn} zone directory.

@item Inbound @i{directory}
The BinkleyTerm-style inbound directory.

@item PInbound @i{directory}
The BinkleyTerm-style protected inbound directory (default is the
directory specified by @code{Inbound}).

@item UUInbound @i{directory}
The BinkleyTerm-style inbound directory for UUENCODEd packets.

@item Hostname @i{name}
The host name part of your Internet address.

@item Domain @i{name}
The domain part of your Internet address.

@item HostsDomain @i{name}
The domain used for entries in the @code{hosts} config file. Default is
the same as @code{Domain}.

@item Origin @i{text}
FTN default EchoMail origin line, the text used for the origins line
generated by @code{rfc2ftn}. Quote @i{text} in @code{""} if it contains
spaces. Individual origin lines may be specified in the @code{areas}
file using the @code{-o} option.

@item Organization @i{text}
Organization header for mail and news generated by
@code{ftn2rfc}. Quote @i{text} in @code{""} if it contains spaces.

@item Zone @i{zone} @i{domain} @i{ftndomain} @i{out}
Specifies Internet domain @i{domain}, FTN domain @i{ftndomain},
and outbound directory @i{out} (relative to @code{Outbound}) for the
FTN zone @i{zone}. @i{zone} may be @code{default}, then this is the
default entry for not explicitely specified zones. Up to 32 @code{Zone}
entries may be specified (@code{MAXADDRESS} from @code{config.h}).

@item DosDrive @i{drive} @i{directory}
OPTIONAL: specify translation of a DOS @i{drive} (e.g. @code{H:}) to a
directory. This is useful, if you keep your outbound on a UNIX server
and run BinkleyTerm on a DOS client. If one or more @code{DosDrive}
statements are specified, FIDOGATE will automatically translate file
attaches to the file names seen by the DOS client. Up to 16
@code{DosDrive} entries may be specified (@code{MAXDOSDRIVE} from
@code{config.h}).

@item AreasXlate @i{area-chars} @i{newsgroup-chars}
Automatic translation (-H option in @code{areas} file) of characters for
Fido area <-> Internet newsgroup name conversion.
  
@item Aliases @i{file}
Use @i{file} instead of the default @code{aliases} config file.

@item Areas @i{file}
Use @i{file} instead of the default @code{areas} config file.

@item Hosts @i{file}
Use @i{file} instead of the default @code{hosts} config file.

@item Passwd @i{file}
Use @i{file} instead of the default @code{passwd} config file.

@item Packing @i{file}
Use @i{file} instead of the default @code{packing} config file.

@item Routing @i{file}
Use @i{file} instead of the default @code{routing} config file.

@item History @i{file}
Use @i{file} instead of the default @code{history} database.

@end table



@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ffx} (config file @code{config.ffx}):

@table @code

@item FFXDataFlav @i{flavour}
Flavour to be used for file attachments created by the @code{ffx} program.

@item FFXDataCompr @i{command ...}
Program to be used for creating compressed @code{ffx} data files.

@item FFXDataExt @i{parameter}
File name extension to be used for compressed @code{ffx} data files.

@item FFXDataDecompr @i{parameter}
Uncompressor name for compressed @code{ffx} data files (will be run by
@code{ffxqt}).

@item FFXDataComprN @i{parameter}
Program to be used for creating uncompress @code{ffx} data files (option
@code{-n}).

@item FFXDataExtN @i{parameter}
File name extension to be used for uncompressed @code{ffx} data files
(option @code{-n}).

@item FFXDataDecomprN @i{parameter}
Uncompressor name for uncompressed @code{ffx} data files (option
@code{-n}, will be run by @code{ffxqt}).

@noindent Special configuration @code{ffx} (config file @code{config.ffx}):

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ffxbatch} (config file @code{config.ffx}):

@table @code

@item FFXBatchArc @i{command ...}
Command for creating archive of batched @code{ffx} files.

@item FFXBatchArcV @i{command ...}
Command for creating archive of batched @code{ffx} files if option
@code{-v} is given.

@item FFXBatchArcExt @i{parameter}
File name extension for archive.

@item FFXBatchArcCmd @i{parameter}
Command name for unbatching archive by @code{ffxqt}.

@item FFXDataFlav @i{parameter}
Flavour to be used for file attachments created by the @code{ffxqt} program.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ffxqt} (config file @code{config.ffx}):

@table @code

@item FFXCommand @i{name} @i{command ...}
List of command names and corresponding commands to be used by
@code{ffxqt}. Only the commands listed can be executed. This replaces
the old LIBDIR/ffxqt-dir/@i{name} structure of previous FIDOGATE
versions.

@item FFXUncompress @i{name} @i{command ...}
List of uncompressor names and corresponding commands to be used by
@code{ffxqt}.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftn2rfc} (config file @code{config.gate}):

@table @code

@item DotNames
Generate @i{User.Name@@host.do.main} instead of
@i{User_Name@@host.do.main}. @code{rfc2ftn} recognizes both address
types.

@item X-FTN @i{header}
Include the various X-FTN header in the output of @code{ftn2rfc}:
@table @code
@item f
@code{X-FTN-From}
@item t
@code{X-FTN-To}
@item T
@code{X-FTN-Tearline}
@item O
@code{X-FTN-Origin}
@item V
@code{X-FTN-Via}
@item D
@code{X-FTN-Domain}
@item S
@code{X-FTN-Seen-By}
@item P
@code{X-FTN-Path}
@end table
@code{X-FTN-From} is required for the proper operation of @code{ftnaf}.

@item BounceCCMail @i{user@@do.main}
Send CC of bounced messages to this address.

@item TrackerMail @i{user@@do.main}
Forward mail from message trackers to this address.

@item KillUnknownMSGIDZone
Kill messages that contain a @code{^AMSGID} from an unknown zone (not
listed in @code{Zone} statements).

@item KillNoMSGID
Kill messages that don't contain a @code{^AMSGID} kludge.

@item KillSplit
Kill messages that contain a @code{^ASPLIT} kludge.

@item UseOriginForOrganization
Put the text from the * Origin line (excluding the @i{(z:n/f.p)}
address) into the Organization header.

@item UseFTNToAddress
Use FTN to address for mail addressed to the gateway without a To line,
e.g. mail to
@example
Max Mueller @ 2:2452/110.2
@end example
with a HOSTS entry
@example
2:2452/110.2  orodruin-ftn.fido.de
@end example
is converted to
@example
To: Max_Mueller@@orodruin-ftn.fido.de
@end example
Without this option the standard local HOST.DOMAIN is used, e.g.
@example
To: Max_Mueller@@orodruin.fido.de
@end example

@item HostsRestricted
Restrict usage of the gateway to FTN addresses listed in @code{hosts}.

@item FTNJunkGroup @i{name}
@i{name} of the FTN junk newsgroup (newsgroup for unknown FTN areas).

@item ErrorsTo @i{user@@do.main}
Insert additional Errors-To header into Internet mails, sending bounced
mails from gateway users to @i{user@@do.main}.

@item NoAddressInToField
Do not allow @code{@@ ! %} chars in the FTN to field, thus preventing
users from putting Internet addresses in the to field.

@item NetMail8bit
Use the ISO-8859-1 MIME 8BIT character set when gating Fido NetMail.

@item NetMailQuotedPrintable
@item NetMailQP
Use the ISO-8859-1 MIME QUOTED-PRINTABLE character set when gating Fido
NetMail. @code{NetMailQuotedPrintable} overrides @code{NetMail8bit} if
both are specified.

@item SingleArticles
Write single articles to output files (in @code{tmpnews}), not news
batches containing several articles (batch is default).

@item RFCAddrMode @i{mode}
Mode for RFC address generated by FIDOGATE:
@table @code
@item ()  p  0
@i{user@@do.main (Real Name)}-type addresses
@item <>  a  1
@i{Real Name <user@@do.main>}-type addresses
@end table

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftninpost} (config file @code{config.gate}):

@table @code

@item FTNInSendmail @i{command ...}
Sendmail program to be run by @code{ftninpost} with options. The option
@code{-fsender} will be automatically added by @code{ftninpost}. For
compatibility with old FIDOGATE configurations, any @code{-f%s} option
will be removed.

@item FTNInRnews @i{command ...}
Rnews program to be run by @code{ftninpost}.

@item FTNInRecombine
Automatically run @code{ftninrecomb} to recombine split messages.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{rfc2ftn} (config file @code{config.gate}):

@table @code

@item Gateway @i{node}
Specifies an FTN-Internet gateway for routing Internet mail to. If
enabled, FIDOGATE can be used as the default delivery agent for all
Internet mail.

@item NoFromLine
Don't generate @code{From:} header and FSC-0035 kludges. Must be set for
a non-gateway, point FIDOGATE configuration.

@item NoFSC0035
Don't generate FSC-0035 @code{^AREPLYADDR}, @code{^AREPLYTO}.

@item NoFSC0047
Don't generate FSC-0047 @code{^ASPLIT}, use old @code{ * Large message
split by } ... text line.

@item MaxMsgSize @i{bytes}
Maximum size of FTN messages (default value), larger messages will be split.

@item LimitMsgSize @i{bytes}
Maximum limit for messages (default value), larger messages will be
bounced (mail) and simply not gated (news).

@item MausDomain @i{.do.main}
@item MausGate @i{address}
Enables and sets the processing of addresses for the German MAUS
network, replacing the old @code{maus} config file. @code{MausDomain}
sets the Internet domain of MAUS addresses, @code{MausGate} the address
of the Fido-MAUS gateway.

If set, @i{User_Name@@xy.maus.domain} will be converted to @i{User Name %
XY} for the Fido-MAUS gateway.

@item EchoMail4D
Generate 4D EchoMail control lines, when the gateway operates at a point
address. @b{This is required when using the gateway and the tosser for a Fido
point!}

@item HostsRestricted
Restrict usage of gateway to FTN addresses listed in @code{hosts}.

@item RFCLevel @i{n}
Set the default RFC level. See also @code{-R} option in @code{areas}.

@item UseOrganizationForOrigin
Put the text from the Organization header into the * Origin line.

@item XFlagsPolicy
Controls policy for X-Flags processing (default is 0, no processing):
@table @code
@item n   N   0
No X-Flags processing at all.
@item s   S   1
X-Flags processing for local sender (check From and Received
headers). This is not really secure!!! If your system is directly
connected to the Internet and runs an SMTP daemon such as sendmail, mail
can easily be faked to look like local!!!
@item a   A   2
X-Flags processing for all. Totally open, totally insecure!!!
@end table

@item DontUseReplyTo
Don't try to get real name from Reply-To header. Particularly useful for
mailing lists which set the Reply-To header to the mailing list.

@item RFCAddrMode @i{mode}
Mode for RFC address generated by FIDOGATE:
@table @code
@item ()  p  0
@i{user@@do.main (Real Name)}-type addresses
@item <>  a  1
@i{Real Name <user@@do.main>}-type addresses
@end table

@item ReplyAddrIfMailTX
Force @code{^AREPLYADDR} (if @code{FSC0035} is enabled) to only contains
@code{^AREPLYADDR <user@@do.main>} for compatibility with ifmail-TX.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftnhatch} (config file @code{config.main}):

@table @code

@item TickFlav @i{flavour}
Flavour of file attaches generated by @code{ftnhatch}.

@end table


@noindent Special configuration @code{ftntick} (config file @code{config.main}):

@table @code

@item TickFlav @i{flavour}
Flavour of file attaches generated by @code{ftntick}.

@item TickReplacedDir @i{directory}
Directory for old files replaced by @code{ftntick}.

@item UnknownTickArea @i{area}
File area to be used to TIC files with an unknown area. Incoming files
with an unknown area will be moved to this unknown area's directory.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftnaf} (config file @code{config.main}):

@table @code

@item AreasBBS @i{name}
Specifies the @code{areas.bbs} EchoMail distribution file used by
@code{ftnaf} and @code{ftntoss}.

@item FAreasBBS @i{name}
Specifies the @code{fareas.bbs} file echo distribution file used by
@code{ftnaf -F} and @code{ftnhatch}/ @code{ftntick}.

@item CCMail @i{user@@do.main}
Send CC of @code{ftnaf}'s replies to this address.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftnexpire} (config file @code{config.main}):

@table @code

@item MaxHistory @i{days}
Maximum length of history database. Keep entries for @i{days} days.

@end table


@noindent Special configuration @code{ftnpack} (config file @code{config.main}):

@table @code

@item MaxArc @i{Kbyte}
Maximum size of ArcMail archives created by @code{ftnpack}. See also
@code{-m} option.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftnroute} (config file @code{config.main}):

@table @code

@item MaxOpenFiles @i{n}
Set maximum number of concurrently open packet files to @i{n}. Default: 10
(@code{MAXOPENFILES} from @code{config.h}), see also @code{-M} option.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftntoss} (config file @code{config.main}):

@table @code

@item AddToSeenBy @i{area} @i{nodes}
Add the listed @i{nodes} to the SEEN-BYs for EchoMail tossed in
@i{area}. @i{area} may be specified using shell-style wildcards
@code{*?[a-z]}.

@item ZoneGate @i{node} @i{seenby}
Zone gate operation: strip SEEN-BYs for EchoMail addressed to @i{node}
and replace with listed @i{seenby} nodes. @i{seenby} must include both
the link's and our address. Example:

@example
ZoneGate  1:105/42  105/42 2452/110
@end example

@item KillEmpty
@item KillBlank
Kill empty (blank) messages addressed to one of our AKAs. These are
typically file attach and file request messages.

@item KillUnknown
Kill messages for unknown EchoMail areas (not listed in
areas.bbs).

@item KillRouted
Kill routed EchoMail messages (not addressed to one of our
AKAs).

@item KillInsecure
Kill insecure EchoMail messages (sender not listed in @code{areas.bbs}).
@item KillCircular
Kill EchoMail with circular path (own address already in @code{^APATH}).

@item LogNetMail
@item Track
Log all NetMail messages in log file.

@item CheckPath
Enable EchoMail circular path check (see @code{KillCircular}).

@item DupeCheck
Enable dupe check (using SPOOLDIR@code{/history} database).

@item KillNoMSGID
Kill EchoMail messages without a @code{^AMSGID}, i.e. treat as dupes.

@item KillDupe
@item KillDupes
Kill duplicate EchoMail messages if @code{DupeCheck} is enabled.

@item KillOld
Kill messages with @i{date} < @i{now} - @code{MaxHistory}, i.e. treat as
dupes.

@item MaxMsg @i{n}
Set maximum number of messages in output files to @i{n}, restricting the
maximum size of packets. See also @code{-m} option.

@item MaxOpenFiles @i{n}
Set maximum number of concurrently open packet files to @i{n}. Default: 10
(@code{MAXOPENFILES} from @code{config.h}), see also @code{-M} option.

@item AreasBBS @i{name}
Specifies the @code{areas.bbs} EchoMail distribution file used by
@code{ftnaf} and @code{ftntoss}.

@item MaxHistory @i{days}
Maximum length of history database. Keep entries for @i{days}
days. Messages with @i{date} < @i{now} - @code{MaxHistory} are
considered old.

@item EchoMail4D
Generate 4D EchoMail control lines, i.e. SEEN-BY and PATH will include
point addresses.

@item NoEmptyPath
Do not generate an empty PATH line.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{runtoss} (config file @code{config.main}):

@table @code

@item MinDiskFree @i{Kbyte}
Minimum free disk space required by the @code{runtoss}
script. @code{runtoss} will terminate if there is less than @i{Kbyte}
free disk space in SPOOLDIR.

@end table


@c ---------------------------------------------------------------------------
@noindent
Special configuration @code{ftnfattach} (config file @code{config.main}):

@table @code

@item FAttachFlav @i{flavour}
Default flavour for file attaches created by @code{ftnfattach}.

@end table



@c ***************************************************************************
@node Hosts, Aliases, Config, Config files

@section @code{hosts} FTN Address to Host Name Conversion
@cindex Hosts

@noindent
This file contains the FTN addresses and host names for registered FTN
nodes. If @code{HostsRestricted} is defined in @code{config.gate}, this
file controls the access to the gateway.

@noindent The format of this file is

@example
@i{node}  @i{hostname}  @r{[} @i{options} @r{]}
@end example

@noindent Fields:

@table @i

@item node
FTN address. An address for a node will match all points of this node,
see example below.

@item hostname
Host name, one of

@table @i
@item local host name
A name without a trailing @code{.} is a hostname in the local
domain (specified by @code{HostsDomain} or default @code{Domain}
in @code{config}).
@item fully qualified domain name
A name with a trailing @code{.} is a fully qualified domain name
for this node.
@item @code{-}
A @code{-} specifies a listed node, but without a host name
translation, using the standard @i{p.f.n.z} address.
@end table

@item options

@table @code
@item -p
Generate addresses with point part, e.g. @code{p99.hippo.fido.de}.
Default is omitting the point part.
@item -d
Mark the node as down, mail to this address will be bounced with
an appropiate error message.
@end table

@end table

The @code{hosts} file is read into memory during startup of FIDOGATE.
The first entry found matches, so a host name for a point must be
specified @i{before} the boss node, if there are entries for both.

Example:

@noindent @code{config}:

@example
HostsDomain   .Fido.DE
@end example

@noindent @code{hosts}:

@example
2:2452/110    hippo
2:2452/990    test     -p
2:2452/991    test.wusel.org.
2:2452/999    -
@end example

@noindent
Resulting data base read into memory:

@example
Node:     2:2452/110.0
Hostname: hippo.Fido.DE
Flags:    

Node:     2:2452/990.0
Hostname: test.Fido.DE
Flags:    POINT

Node:     2:2452/991.0
Hostname: test.wusel.org
Flags:

Node:     2:2452/999.0
Hostname:
Flags:
@end example

@noindent This results in the following conversion of addresses from FTN
to Internet:

@example
2:2452/110     ->  hippo.Fido.DE
2:2452/110.99  ->  hippo.Fido.DE
2:2452/990.99  ->  p99.test.Fido.DE
2:2452/991.1   ->  test.wusel.org
2:2452/999.2   ->  p2.f999.n2452.z2.Fido.DE
@end example



@c ***************************************************************************
@node Aliases, Areas, Hosts, Config files

@section @code{aliases} User Aliases
@cindex Aliases

@noindent
This file contains user aliases, the FTN address, and the full name of
the user.

@noindent The format of this file is

@example
@i{alias}  @i{node}  "@i{full name}"
@end example

@noindent Fields:

@table @i

@item alias
Alias for the user.

@item node
FTN address of the user.

@item full name
Full name of the user.

@end table

The FTN address @i{node} may be a point address. In this case mail
addressed to the user at the boss node address will be readdressed to
this point, see example below.

Example:

@noindent @code{aliases}:

@example
mvr         2:2452/110.6    "Marc van.Rey"
@end example

Using the definitions from the section on @code{hosts}, this results in
the following address conversion:

@example
Marc van.Rey @@ 2:2452/110.6  <->  mvr@@hippo.Fido.DE
@end example



@c ***************************************************************************
@node Areas, Bounce, Aliases, Config files

@section @code{areas} FTN Area to Newsgroup Conversion
@cindex Areas

@noindent
This file contains FTN areas with corresponding newsgroups and options.

@noindent The format of this file is

@example
@i{area}  @i{newsgroup}  @r{[} @i{options} @r{]}
@end example

@noindent Fields:

@table @i

@item area
FTN area.

@item newsgroup
Usenet newsgroup.

@item options
IMPORTANT: there must be spaces between the option and its argument!

@table @code

@item -a @i{address}
Select alternate FTN address for this area/newsgroup.

@item -z @i{zone}
Select zone AKA @i{zone} for this area/newsgroup.

@item -d @i{distribution}
Use Usenet @code{distribution} for this newsgroup when gating from FTN
to Internet.

@item -o "@i{origin}"
Use an alternate origin line for this area when gating from Internet to
FTN.  (Default specified in @code{config}.)

@item -g
Don't send messages from another SomeNet-FTN gateway across the gateway.

@item -l
Only local crosspostings are allowed in this newsgroup/area.

@item -x
No crosspostings are allowed in this newsgroup/area.

@item -8
Use the ISO-8859-1 MIME 8BIT character set when gating to this
newsgroup.

@item -Q
Use the ISO-8859-1 MIME quoted-printable character set when gating to
this newsgroup.

@item -H
Area/newsgroup matches entire hierarchy. Names are converted
automatically, using upper case for area names and lower case for
newsgroups.

Example:
@example
GNU.    gnu.    -z 242  -H
@end example
@code{gnu.announce} will be converted to @code{GNU.ANNOUNCE},
@code{gnu.bug.gcc} to @code{GNU.BUG.GCC}, similar for all other.

@item -!
Don't gate this area/newsgroup or hierarchy (if combined with
@code{-H}). Usefull to exclude certain newsgroups from a hierarchy for
gating.

Example:
@example
ALT.BINARIES.    alt.binaries.    -z 242  -H -!
ALT.             alt.             -z 242  -H
@end example
This is roughly equivalent to INN's @code{alt.*,!alt.binaries.*}. Please
note that the first @code{areas} entry matches, so any @code{-!} must be
placed before the @code{-H} hierarchy definition.

@item -R @i{level}
Select level of @code{^ARFC-}Header put into FIDO messages for this
area. Level:
@table @r
@item 0
No @code{^ARFC-}header at all.
@item 1
Only important @code{^ARFC-}header.
@item 2
All @code{^ARFC-}header.
@end table

@item -m @i{bytes}
Sets @code{MaxMsgSize} for this area (0 = no limit).

@item -M @i{bytes}
Sets @code{LimitMsgSize} for this area (0 = no limit).

@item -X "@i{RFC-Header: text}"
Add extra RFC header to output of @code{ftn2rfc}. Multiple @code{-X}
options are possible.

@end table

@end table

Only newsgroups listed in this file will be gated from Internet to FTN.
FTN area not listed in this file will be gated into the
@code{FTNJunkGroup} newsgroup specified in @code{config.gate}.



@c ***************************************************************************
@node Bounce, Passwd, Areas, Config files

@section Bounce Messages of @code{ftn2rfc}
@cindex Bounce messages

@noindent
@code{ftn2rfc} uses the following files for messages sent to the FTN
user when bouncing mail for some reason:

@table @code

@item bounce.noto
Message addressed to user @code{UUCP} or @code{GATEWAY} without a
@code{To} line at the very beginning of the message.

@item bounce.down
Message addressed from/to node currently marked as @i{down} in
@code{hosts} (@code{-d} flag).

@item bounce.restricted
Messages from nodes not listed in @code{hosts}, gateway running in
restricted mode.

@item bounce.insecure
Messages came via an insecure (i.e. not password protected) link and
contain a @code{To} line. This requires the @code{-t} option to
@code{ftn2rfc}.

@end table

Within a bounce message, the following substitutions can be used:

@table @code

@item %F
FTN address of message sender.
@item %T
FTN address of message recipient (the gateway, that is).
@item %O
FTN address of message origin.
@item %d
Date/time of message.
@item %t
Name of message recipient.
@item %f
Name of message sender.
@item %s
Message subject.
@item %R
@code{To} line, Internet address.
@item %M
The entire message body.

@end table



@c ***************************************************************************
@node Passwd, Routing, Bounce, Config files

@section @code{passwd} Password Config File
@cindex Password

@noindent
This file contains passwords used by @code{ftnaf}, @code{ffx}, and the
tosser programs.

@noindent The format of this file is:

@example
@i{context}  @i{node}  @i{password}  @i{options}
@end example

@noindent Contexts:

@table @code

@item packet
FTN packet passwords, checked by @code{ftntoss}, inserted by all
FIDOGATE programs which create FTN packets. Password checking for
incoming packets is NOT YET IMPLEMENTED.

@item af
Areafix passwords for requests to @code{ftnaf}.

@item ff
Filefix passwords for requests to @code{ftnaf -F}.

@item ffx
@code{ffx} command passwords, checked by @code{ffxqt}, inserted by
@code{ffx} into the @code{.ffx} command files.

@end table

Optional stuff (@i{options}) is used for @code{ftnaf} permission
settings:

@example
@i{lvl}  @i{key}  "@i{Sysop Name}"
@end example

@i{lvl} is the access level, which must be greater or equal than the one
in @code{areas.bbs}. @i{key} is the access key, which must be a super
set of the one in @code{areas.bbs}.


Example:

@example
packet      2:1234/5678     WUERG
ffx         242:1111/99     BLAHBLUB
af          2:1234/5678     WUSEL       1   F     "Test Sysop"
ff          242:1234/5678   WUSEL       4   UQ    "Yet Another Sysop"
@end example



@c ***************************************************************************
@node Routing, Packing, Passwd, Config files

@section @code{routing} Config File
@cindex Routing

@noindent
This file contains the routing commands performed by @code{ftntoss}
(commands @code{remap} and @code{rewrite}) and @code{ftnroute}
(everything else). The first routing command found matches.

The syntax of the @code{routing} commands is very similar to the routing
file used by the well-known FIDO tossers QMail and SQUISH.

@noindent The format of this file is:

@example
remap      @i{src-node}  @i{dest-node}  @i{name}
remapto    @i{src-node}  @i{dest-node}  @i{name}
remapfrom  @i{src-node}  @i{dest-node}  @i{name}
rewrite    @i{src-node}  @i{dest-node}

echomail
netmail

send       @i{flavor}    @i{nodes}
route      @i{flavor}    @i{dest-node} @i{nodes}
hostroute  @i{flavor}    @i{nodes}
hubroute   @i{flavor}    @i{nodes}
xroute     @i{flavor}    @i{dest-node} @i{from-node} @i{to-node}
bossroute  @i{flavor}    @i{nodes}

change     @i{old-flavor}  @i{new-flavor}  @i{nodes}

sendmove   @i{flavor}    @i{nodes}
@end example

@noindent Commands:

@table @code

@item remap
@item remapto
Remaps NetMail addressed to @i{name} at @i{src-node} to the new address
@i{dest-node}. Most usefull for remapping to points based on their name.
@i{name} supports shell-style wildcard patterns. Remapping to 0:0/0.0
means killing the message.

@item remapfrom
Remaps NetMail from @i{name} at @i{src-node} to the new address
@i{dest-node}. @i{name} supports shell-style wildcard
patterns. Remapping to 0:0/0.0 means killing the message.

@item rewrite
Rewrites NetMail from and to addresses. A node address matching
@i{src-node} will be changed to @i{dest-node}.

@item echomail
Starts routing commands for EchoMail.

@item netmail
Starts routing commands for NetMail.

@item allmail
Starts routing commands for both EchoMail and NetMail. NOT YET
IMPLEMENTED.

@item send
Send normal mail addressed to @i{nodes} with @i{flavor}.

WARNING: there is a bug in the current implementation of @code{send}
(when compared to the operation of e.g. SQUISH). A command @code{send
hold 2:123/456} actually equals @code{send hold 2:123/456.*}, i.e. mail
for every single point of this node is put onto hold. Use the command
@code{route hold 2:123/456} instead to get the desired behaviour!!!

@item route
Route normal mail addressed to @i{nodes} via @i{dest-node}, using
@i{flavor}.

@item hostroute
Route normal mail addressed to @i{nodes} via their host (i.e. Z:N/0),
using @i{flavor}.

@item hubroute
Route normal mail addressed to @i{nodes} via their hub,
using @i{flavor}. NOT YET IMPLEMENTED.

@item xroute
Route normal mail from @i{from-node} to @i{to-node} via @i{dest-node},
using @i{flavor}. NOT YET IMPLEMENTED.

@item bossroute
Route @i{flavor} mail addressed to @i{nodes} via their boss node, not
changing the flavor.

@item change
Change flavor of mail packet from @i{old-flavor} to @i{new-flavor}.

@item sendmove
Like @code{send}, but @code{ftnroute} doesn't copy the mail packets,
they are moved instead. This requires that SPOOLDIR/toss/tmp and
SPOOLDIR/toss/out are on the same file system/disk drive.

@end table

Node addresses @i{nodes}, @i{src-node}, @i{dest-node} support wildcards
using @code{*} and @code{all}, which can be used for the zone, net,
node, and point component of an address. @code{*} alone matches all
addresses. @code{rewrite} wildcards in the destination address are
replaced with the corresponding component of the source address.

@noindent The outbound flavor string @i{flavor} can be any of
@code{normal}, @code{hold}, @code{crash}, @code{direct}, @code{out},
@code{hut}, @code{cut}, @code{dut}.

Example:

@example
Remap     2:2452/110.0 2:2452/110.7  "Martin Koser"
Rewrite   242:241/*    2:241/*

NetMail
send      hold         242:1000/1.all
change    crash  hold  242:1000/1.all 2.all
send      hold         242:1000/3
route     hold         242:1000/50 51 52 53 54 55 56 57 58 59
@end example



@c ***************************************************************************
@node Packing, Areas.bbs, Routing, Config files

@section @code{packing} Config File
@cindex Packing

@noindent
This file contains the packer (archiver) definitions and packing
commands for @code{ftnpack}.

@noindent The format of this file is:

@example
arc        @i{name}  @code{"}@i{archiver}@code{"}
prog       @i{name}  @code{"}@i{program}@code{"}

pack       @i{name}  @i{nodes}
rpack      @i{name}  @i{dest-node}  @i{nodes}
fpack      @i{name}  @i{dest-node}  @i{nodes}
dirpack    @i{dir}  @i{name}  @i{nodes}
@end example

@noindent Packer/program definitions:

@table @code

@item arc
Defines the archiver @i{name} as program @i{archiver}. The @i{archiver}
string must contain two @code{%s}, the first one is replaced with the
archive name, the second one with the packet name.

@item prog
Defines the program @i{name} as @i{program}. The @i{program} string must
contain a @code{%s}, which is replaced with the name of the packet to be
processed.

@end table


@noindent Packing definitions:

@table @code

@item pack
Pack all mail addressed to @i{nodes} using the archiver defined as
@i{name}. The archiver name @code{noarc} indicates that the mail packet
should not be packed, but copied to the OUT file of the node.

@item rpack
Same as @code{pack}, but pack all mail addressed to @i{nodes} to the
archive for @i{dest-node}.

@item fpack
Similar to @code{rpack}, but the packet is archived for the normal
arcmail packet for each node. This archive is then attached to the FLO
file of @i{dest-node}.

@item dirpack
Archive packets for @i{nodes} in special directory @i{dir}, not the
standard outbound.

@end table

Example:

@example
arc     zip     "/usr/local/bin/zip -gkj %s %s"

rpack   zip     2:242/41 2:242/42 242:2000/* 254:*/*
pack    noarc   2:2452/110.1 242:4900/99 254:2410/6.1
pack    zip     *
@end example



@c ***************************************************************************
@node Areas.bbs, Basic, Packing, Config files

@section @code{areas.bbs} EchoMail Distribution
@cindex EchoMail
@cindex areas.bbs

@noindent
This file contains the EchoMail areas and linked nodes. The file
@code{fareas.bbs} is used for file echos.

The format of this file is as follows, the first line being ignored for
compatibility with the standard DOS AREAS.BBS. Individual fields can be
enclosed in "..." to allow spaces, in particular for the area
description. 

@example
@r{[}#@r{]}@i{directory}  @i{area}  @r{[}@i{options}@r{]}  @i{nodes}
@end example

@table @i

@item @t{#}
Marks area as pass-through, i.e. no packets for the own address (zone
AKA or set by @code{-a}) will be created.

@item directory
The directory where the message base/file base for this area is located.
Currently FIDOGATE uses the directory for file areas only.

@item area
The area name.

@item options
Options for this area:
@table @code
@item -a @i{address}
Set alternate FTN AKA for this area.
@item -z @i{zone}
Set alternate zone AKA for  this area. If not  set, the zone information
is taken from  the first node in the  @i{nodes} list.  @code{ftnaf} will
automatically rewrite @code{areas.bbs}, inserting the @code{-z} option.
@item -l @i{lvl}
Set Areafix/Filefix access level for this area.
@item -k @i{key}
Set Areafix/Filefix access key for this area.
@item -d "@i{description}"
Description for this area. Enclose in @code{"..."} to allow spaces in
description text.
@item -#
Set pass-through flag for this area (same as @i{directory} starting with
@code{#}).
@item -r
Set read-only flag for this area. New downlink will have a read-only
status. NOT YET IMPLEMENTED.
@end table

@item nodes
The list of downlink nodes. This is a sorted short list of nodes as in
FIDO EchoMail SEEN-BYs and PATH. The first node in @i{nodes} stays at
this place, though. Do @i{not} put your own address into the @i{nodes}
list.

@end table




@c ***************************************************************************
@page
@node Basic, Sendmail, Areas.bbs, Top
@chapter Basic Configuration

@cindex Configuration

There seems to be some confusion about how to configure the mail/news
system, the gateway, and the tosser, so I added this chapter. Hopefully
this will help ...

@menu
* Sendmail::	       Sendmail configuration
* Example Point::      Example point configuration
* Example Point 2::    Example configuration with 2 point addresses
* Example Node::       Example leaf node configuration
@end menu



@c ***************************************************************************
@node Sendmail, Example Point, Basic, Basic

@section Sendmail Configuration
@cindex Configuration
@cindex sendmail

@noindent
This section describes the FIDOGATE additions to the sendmail V8 m4
configuration.

FIDOGATE adds two new mailer files, @code{ftn.m4} and @code{ffx.m4}. Use
@code{MAILER(ftn)} and/or @code{Mailer(ffx)} to include these mailer
definitions.

Please note that the new FIDOGATE mailers are based on the SMTP mailer
sender/recipient rewrite rules, so including @code{MAILER(smtp)} is
mandatory!

@noindent
FIDOGATE ftn mailers (using the @code{rfc2ftn} gateway program):

@table @code

@item ftn
Mailer for sending to systems registered in the @code{hosts} config
file. @code{ftn} will bounce mails if the receiving hosts is not
registered or marked as down.

@item ftni
Mailer for sending to a typical p.f.n.z domain,
e.g. @code{.fidonet.org}. @code{ftni} will send the mail to any system,
regardless of the registration in @code{hosts}.

@item ftna
Like @code{ftni}, but the @code{ftna} mailer also sets the address and
uplink of the gateway to the relay host passed to this mailer.

@item ftno
Like @code{ftna}. In addition, this mailer sets the directory for
packets created by @code{rfc2ftn} to SPOOLDIR/out/@i{relayhost}.

@end table

@noindent
FIDOGATE ffx mailer (using the @code{ffxmail} utitility):

@table @code

@item ffx
Mailer for sending via the FIDOGATE ffx sub-system.

@end table



@c ***************************************************************************
@node Example Point, Example Point 2, Sendmail, Basic

@section Example Point Configuration
@cindex Configuration
@cindex Example
@cindex Point

@noindent
@i{Please note that this point configuration uses the FIDOGATE
tosser. Thus, it's different from the point configuration described in
Roland Rosenfeld's Point HOWTO!!!}

Actually, this point configuration is very similar to the node
configuration described in the next section.

Let's assume the following addresses:

Fido point address 2:2499/123.9

Uplink (NetMail and EchoMail) 2:2499/123


@noindent
Address configuration @code{config.gate} (uplink is the same as the
point address!), @code{EchoMail4D} is stricly reqired:

@example
Address 2:2499/123.9
Uplink  2:2499/123.9

EchoMail4D
@end example

@noindent
Address configuration @code{config.main} (no uplink here!):

@example
Address 2:2499/123.9
@end example


@noindent
Routing configuration @code{routing}: mail for the local address on
hold, everything else is send to the boss node.

@example
NetMail
route    hold   2:2499/123.9
route    normal 2:2499/123 1:* 2:* 3:* 4:* 5:* 6:*

EchoMail
sendmove hold   2:2499/123.9
sendmove normal *
@end example


@noindent
Packer configuration @code{packing}: no packing (noarc, this is very
important) for own address, @code{zip} is the default archiver for
everything else.

@example
arc  zip    "/usr/bin/zip -9gkjq %s %s"

pack noarc  2:2499/123.9
pack zip    *
@end example

@noindent
Next, the EchoMail areas must be listed in the @code{areas.bbs} file. Do
@i{not} put your point address into @code{areas.bbs}! Example with two
areas (the directory @code{X} is not used for EchoMail areas), which
must be non-passthrough:

@example
Your system name!sysop name
X LINUX.GER 2:2499/123
X UNIX.GER  2:2499/123
@end example

In the gateway configuration, these areas must be listed in the
@code{areas} config file:

@example
LINUX.GER fido.ger.linux
UNIX.GER  fido.ger.unix
@end example

Now the gateway is able to process EchoMail. The program @code{ftnin}
should be run to gate any (unpacked) FTN outbound mail packet for
2:2499/123.9. The script @code{scripts/run/runpoll} runs everything
needed for a point polling its mail at the boss node.



@c ***************************************************************************
@node Example Point 2, Example Node, Example Point, Basic

@section Example Configuration with 2 Point Addresses
@cindex Configuration
@cindex Example
@cindex Point

@noindent
This section describes a point setup with 2 different point addresses
and 2 different boss nodes (uplinks). Thanks to Stephan Zellerhoff
<stephan@@poi.westfalen.de> for contributing some stuff.

Let's assume the following addresses:

Primary point address 2:2499/123.10, boss node 2:2499/123

Secondary point address 2:2498/120.2, boss node 2:2498/120

@noindent
Setup with FIDOGATE:

@table @b

@item Addresses
Put the following address statements in @code{config.gate}
@example
Address 2:2499/123.10
Address 2:2498/120.2
Uplink  2:2499/123.10
Uplink  2:2498/120.2
@end example
and @code{config.main}
@example
Address 2:2499/123.10
Address 2:2498/120.2
@end example
Please note that the primary point address must be the @i{first} entry!

@item Sendmail
Use the sendmail @code{mailertable} feature and create the following
entries for routing Fidonet mail:
@example
# Mail to 2:2498/*, secondary address
.n2498.z2.fidonet.org    ftna:p2.f120.n2498.z2.fidonet.org
# Everything else 2:*/*, primary address
.z2.fidonet.org          ftna:p10.f123.n2499.z2.fidonet.org
@end example
Please note that in this setup, the relay host specified with the
@code{ftna} mailer is your @i{own} address, not your boss node!!!

@item Areas
Areas send to the primary boss don't require anything special in the
@code{areas} config file, areas send to the secondary boss must have the
@code{-a 2:2498/120.2} option, e.g.
@example
LINUX.GER    fido.ger.linux    -a 2:2498/120.2
@end example

@item Areas.BBS
Likewise, areas send to the secondary boss must have the @code{-a
2:2498/120.2} option in @code{areas.bbs} and the secondary boss as the
uplink, e.g.
@example
X LINUX.GER    -a 2:2498/120.2    2:2498/120
@end example

@item Routing
The netmail routing must be adapted to send mail to the secondary boss,
e.g. everything for net 2498:
@example
route    normal   2:2498/120 2:2498/*.*
route    normal   2:2499/123 2:*
@end example

@item Packing
Packer configuration @code{packing}: no packing (noarc, this is very
important) for all of our own addressess, @code{zip} is the default
archiver for everything else.

@example
arc  zip    "/usr/bin/zip -9gkjq %s %s"

pack noarc  2:2499/123.10 120.2
pack zip    *
@end example


@item Miscellaneous
@itemize @bullet
@item
@i{Disable} @code{CheckPath} in @code{config.main}.
@item
@i{Enable} @code{EchoMail4D} in @code{config.gate}.
@end itemize

@end table



@c ***************************************************************************
@node Example Node, Usage, Example Point 2, Basic

@section Example Leaf Node configuration
@cindex Configuration
@cindex Example
@cindex Node


@noindent
Let's assume the following addresses:

Fido main address 2:2499/123

Uplink (NetMail and EchoMail) 2:2499/100

Local gateway address 2:2499/123.1

Two points, Max Mueller @@ 2:2499/123.10, Sabine Meier @@ 2:2499/123.11


@noindent
Address configuration @code{config.gate} (uplink is node address!):

@example
Address 2:2499/123.1
Uplink  2:2499/123
@end example

@noindent
Address configuration @code{config.main} (no uplink here!):

@example
Address 2:2499/123
@end example


@noindent
Routing configuration @code{routing}: NetMail for the two points will be
remapped to their point addresses, everything else to the gateway (where
you will be reading your mail). NetMail for all points is @code{send}
onto hold, everything else @code{route}d to your uplink. EchoMail is
alway put onto hold.

@example
remap 2:2499/123.0 2:2499/123.10 "Max Mueller"
remap 2:2499/123.0 2:2499/123.11 "Sabine Meier"
remap 2:2499/123.0 2:2499/123.1  "*"

NetMail
send  hold   2:2499/123 2:2499/123.*
route normal 2:2499/100 1:* 2:* 3:* 4:* 5:* 6:*

EchoMail
sendmove hold   2:2499/123.*
sendmove normal *
@end example


@noindent
Packer configuration @code{packing}: no packing for the gateway address,
@code{zip} is the default archiver for everything else.

@example
arc zip "/usr/bin/zip -9gkjq %s %s"

pack noarc  2:2499/123.1
pack zip    *
@end example

@noindent
Next, the EchoMail areas must be listed in the @code{areas.bbs} file. Do
@i{not} put your node address into @code{areas.bbs}! Example with two
areas, both subscribed by the gateway and your points (the directory
@code{X} is not used for EchoMail areas):

@example
Your system name!sysop name
#X LINUX.GER 2:2499/100 123.1 .10 .11
#X UNIX.GER  2:2499/100 123.1 .11
@end example

@code{#} denotes a @i{passthrough} area, i.e. no packets for the own
address (2:2499/123) are created. All EchoMail will be send to the
gateway (.1).

In the gateway configuration, these areas must be listed in the
@code{areas} config file:

@example
LINUX.GER fido.ger.linux
UNIX.GER  fido.ger.unix
@end example

Now the gateway is able to process EchoMail. The program @code{ftnin}
should be run to gate any (unpacked) FTN outbound mail packet for
2:2499/123.1. The scripts @code{runin} and @code{runout} run the tosser
for processing the inbound and the gateway output, respectively.

To use the @code{ftnaf} areafix, the gateway and the mail system must be
working. You can then install suitable aliases in @code{/etc/aliases}:

@example
# Areafix/Filefix - FIDOGATE ftnaf
areafix: "|/usr/local/lib/fidogate/ftnafmail"
areamgr: areafix
filefix: "|/usr/local/lib/fidogate/ftnafmail -F"
filemgr: filefix
@end example

That's it. I hope that this short chapter on basic configuration clarifies
some of the darker point of the FIDOGATE configuration. Anyway, please
help to improve the FIDOGATE documentation.




@c ***************************************************************************
@page
@node Usage, RFC Headers, Example Node, Top
@chapter FIDOGATE Usage

@cindex Usage

@menu
* RFC Headers:: RFC Headers in FTN Messages
* X Headers::   X Headers in RFC Messages
@end menu


@c ***************************************************************************
@page
@node RFC Headers, X Headers, Usage, Usage
@section RFC Headers in FTN Messages

@cindex RFC header
@cindex Header

@noindent
FIDOGATE's @code{ftn2rfc} supports the following RFC headers at the
start of an FTN message. RFC headers must be the first text lines,
max. 3 empty lines before the RFC headers are allowed. Only one header
line of each type is allowed.

@table @code

@item From: @i{address}
Sets From header line. If set and the @code{areas} flag @code{-g} is on,
messages will not be gated, because they are considered comming from
another FTN-RFC gateway.

@item Reply-To: @i{address}
Sets Reply-To header line.

@item To: @i{address}
Sets To header line.

@item Cc: @i{address}
Sets Cc header line.

@item Bcc: @i{address}
Sets Bcc header line.

@item Newsgroups: @i{groups}
Sets Newsgroups header line. NOT YET IMPLEMENTED.

@item Sender: @i{address}
Sets Sender header line. NOT YET IMPLEMENTED.

@item Content-Transfer-Encoding: 7bit @r{|} 8bit @r{|} quoted-printable
Sets content encoding type, overriding the default configured in
@code{config.gate} (@code{NetMail8bit}, @code{NetMailQuotedPrintable})
or @code{areas} (@code{-8}, @code{-Q}).

@end table

@code{ftn2rfc} sends mail to all addresses listed in To, Cc, and Bcc. It
support the RFC1036 standard address formats:

@example
user@@do.main
user@@do.main (Real Name)
Real Name <user@@do.main>
@end example

Multiple addresses can be separated by a @code{,}.



@c ***************************************************************************
@page
@node X Headers, Index, RFC Headers, Usage
@section X Headers in RFC Messages

@cindex X header
@cindex Header

@noindent
FIDOGATE's @code{rfc2ftn} supports the following X headers in RFC
messages:

@table @code

@item X-Comment-To: @i{name}
Use for the recipient's name in news articles.

@item X-Flags: @i{flags}
@table @code
@item c
Message is crash.
@item p
Message is private (default for mail).
@item h
Message is hold.
@item f
Subject contains file attachment name.
@item r
Sets return receipt request.
@item m
Generates a FTN style @code{^MSGID}, i.e. @code{^AMSGID: }@i{Z:N/F.P
1234abcd}. In addition, no @code{^AREPLY} kludge is generated. THIS FLAG
IS NOT RECOMMENDED FOR NORMAL OPERATION!!!
@item n
Do not generate a From line, and the @code{^AREPLYADDR}, @code{REPLYTO}
kludges.
@end table

@end table



@c ***************************************************************************
@page
@node Index, , X Headers, Top
@unnumbered Index

@printindex cp


@c @summarycontents
@contents

@bye
