This is Info file fidogate.info, produced by Makeinfo-1.55 from the
input file fidogate.texi.

   This file documents the usage of FIDOGATE.

   Copyright (C) 1994, 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.


Introduction
************

This manual documents how to install and use FIDOGATE. It is the first
step toward a concise documentation.


* Introduction::Introduction to FIDOGATE
* Installation::Compiling and installing FIDOGATE
* Programs::    FIDOGATE programs and scripts
* Config files::FIDOGATE config files

* Index::       Index

 -- The Detailed Node Listing --

Compiling and installing FIDOGATE

* Point::       Installing a FIDOGATE point system
* config.h::    The C source `config.h' header file
* Makefile::    The C source `Makefile'
* 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::     `ffx' frontend for sending mail
* ffxqt::       Execute `ffx' requests
* ffxrun::      Script for running `ffxqt'
* fidorun::     Mail/news processing script
* ftn2ftn::     FTN-FTN NetMail gateway
* ftn2rfc::     FTN-Internet mail/news gateway
* ftnaf::       Areafix
* ftnbounce::   Bounce mail to unknown FTN address
* ftnbsy::      Create/delete Binkley busy files
* ftnin::       Frontend for `ftn2rfc'
* ftnlock::     Create/delete lock files
* ftnpack::     Pack (ArcMail) FTN mail packets
* ftnroute::    Route FTN mail packets
* ftntoss::     Toss/remap/rewrite FTN mail packets
* out-attach::  Binkley outbound file attach utility
* pktdebug::    FTN mail packet debugger
* rfc2ftn::     Internet-FTN gateway
* runtoss::     Script for running tosser
* sumcrc::      CRC checksum utility
* toaddr::      Get recipient addresses from header

FIDOGATE Config Files

* Config::      `config' main configuration file
* Hosts::       `hosts' FTN address to host name conversion
* Aliases::     `aliases' user aliases
* Areas::       `areas' FTN area to newsgroup conversion
* Maus::        `maus' Internet addresses for MAUS systems
* Bounce::      Bounce messages of `ftn2rfc'
* Passwd::      `passwd' password config file
* Routing::     `routing' file for `ftntoss' and `ftnroute'
* Packing::     `packing' file for `ftnpack'


Introduction to FIDOGATE
************************

   FIDOGATE is a gateway software 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-style messages and vice versa.  It is placed under the GNU
General Public License, see file COPYING for details.

   This version of FIDOGATE also includes an (almost) complete FIDO
tosser and related utilities.

The latest version of FIDOGATE is available at the following sites.

Internet anonymous ftp:
     ftp.dfv.rwth-aachen.de  (137.226.4.111)
     /pub/mail+news/fidogate-x.y.tar.gz

BBS and FIDO frequest:
     2:2452/110 242:1000/1 +49-241-875090  (HST/V.32bis)
     2:2452/111 242:1000/2 +49-241-8790420 (ISDN V.110/X.75)
     File area #51, file name fgatexy.tgz

Requirements for FIDOGATE:

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

   * Installed news system. (CNews or INN)

   * A new reader. (nn, tin, Emacs GNUS)

   * A mail transport agent. (sendmail or smail)

   * A mail user agent. (mail, elm, pine, Emacs)

   There is a mailing list for FIDOGATE discussions and announcements:
     fgate-users@gondor.gun.de

   For subscription send mail to
     fgate-users-request@gondor.gun.de

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

   The original `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:

The parsedate.y date/time parser, from INN 1.4:
     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.
   (Changed slightly and adopted for FIDOGATE)

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


Compiling and installing FIDOGATE
*********************************


* Point::       Installing a FIDOGATE point system
* config.h::    The C source `config.h' header file
* Makefile::    The C source `Makefile'
* Compiling::   Compiling and installing FIDOGATE
* Integration:: Integrating FIDOGATE and the mail/news system
* Testing::     Testing FIDOGATE operation
* Connecting::  Connecting to FIDONET

   You must also edit the config files to be installed in the LIBDIR
directory.  Edit the config files `config', `config.toss', `config.af',
`areas', `hosts', `passwd', `routing', `packing', `aliases', `maus' for
your setup (contained in the lib subdirectory).

   The chapter on config files describes them in detail.


Installing a FIDGATE Point System
=================================

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

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

   * Uncomment `NO_FROM_LINE' in `src/config.h'!!! This is important if
     your host and domain name are not a real Internet address.

   * Comment out `PASSTHRU_NETMAIL' and `PASSTHRU_ECHOMAIL' in
     `src/config.h'. These functions are not necessary for a point
     system and may cause trouble.

   * If you want to send Internet mail via a FIDO-Internet gateway, set
     it's address with `Gateway' in `config'. FIDOGATE can then be used
     as your default mailer, delivering all non-FIDO mail to this
     gateway.

   Sample `lib/config' settings for such a point:

     hostname  mordor
     domain    .middle.earth
     address   2:2499/666.42
     uplink    2:2499/666
     gateway   2:2476/2

   See also `doc/Fido-Point-Howto' for a complete description (German!)
on how to install a point system on LINUX using FIDOGATE, ifcico,
CNews, and smail.

   If you have trouble with `smail' installation (which seems to be
overly complicated for such a simple task), you may try `sendmail'
8.6.9 (there is a simple to install LINUX binary available) and the
config files in the samples/sendmail/8.6.9 directory.


The C Source `src/config.h' Header FIle
=======================================

   Comment/uncomment/change the `#define's to suit your needs.

Common configuration:

`FIDODOMAIN'
     Default Internet domain for standard FIDO addresses. Used for
     Message-IDs, so DO NOT CHANGE.

`POSTMASTER'
     The local user getting a Cc of error messages.

`MAUS_DE'
     Enables special handling of adresses for the German MAUSNET. This
     feature requires the `maus' config file!

    `MAUS_DE_FROM'
          `ftn2rfc': convert addresses from MAUS-FIDO gateway to
          Internet addresses using the `maus' domain list.

    `MAUS_DE_TO'
          `rfc2ftn': convert MAUS Internet addresses (currently only
          supports the `default' domain specified in `maus') to
          addresses for the FIDO-MAUS gateway (FTN address specified in
          `default' entry in `maus' config file).

    `MAUS_DE_STRING'
          String for MAUS addressing used by MAUS-FIDO gateway.

`HOSTS_RESTRICTED'
     Restrict the usage of the gateway to nodes registered in the
     `hosts' config file, e.g. only these node may send/receive mail
     to/from the Internet.

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

`DO_BSY_FILES'
     Create Binkley-style busy files while accessing the Binkley
     outbound.

`SECURE'
     Enable secure permissions for packet and data files.

`ftn2rfc' configuration:

`X_FTN'
     Write the extra `X-FTN-Xxxx' headers to the RFC message.

`X_FTN_FROMTO'
     Write the extra `X-FTN-From', `X-FTN-To' headers to the RFC
     message (for NetMail).

`FTN_JUNK'
     Specifies a default newsgroup for unknown (i.e. no entry in
     `areas') FTN areas.

`ERRORS_TO'
     Write `Errors-To' header to RFC message, causing error messages
     sent to the specified address, if the MTA supports this (`sendmail'
     does).

`ADD_DOMAIN'
     Add hostname.domain to local addresses, e.g. `To: mj' will be
     converted to `To: mj@sungate.fido.de'.

`NO_BRAIN_DEAD_GATEWAYS'
     Kill messages from certain gateway software that doesn't pass
     Message-IDs properly.

`ALIASES_ARE_LOCAL'
     Addresses found in the `aliases' config file are rewritten so that
     the sender's address is the gateway.

`rfc2ftn' configuration:

`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.

`PASSTHRU_ECHOMAIL'
     Passthru operation for EchoMail: if the sender of the message is
     an FTN address, this address will be put into the origin line of
     the resulting FTN message. If the RFC message contains an
     `X-FTN-Origin' header, this one will be used for the origin line.
     NOT YET IMPLEMENTED.

`FTN_4D_ECHOMAIL_WITH_POINTS'
     Generate EchoMail control lines with point addresses, e.g.
          SEEN-BY: 2452/110.1
          ^APATH: 2452/110.1
     If commented, the point address is left out. This only applies to a
     point setup with 4D EchoMail.

`PACKET_PASSWD'
     Password to be put into FTN packets generated by `rfc2ftn'. Use
     `""' for no password. FIXME: should be defined in a config file.

`NO_FROM_LINE'
     Do not generate `From' line at the beginning of an FTN message.

`FSC_0035'
     Generate `^AREPLYADDR', `^AREPLYTO' kludges according to FSC-0035
     (automatically disabled by `NO_FROM_LINE').

`FSC_0047'
     Generate `^ASPLIT' kludge according to FSC-0047 for split messages.

`DO_ORIGID'
     Generate Gatebau '93 `^AORIGID', `^AORIGREF' kludges. NO FUNCTION
     YET.

`DO_NEW_MSGID'
     Generate RFC Message-IDs and FTN MSGIDs according to FIDO Gatebau
     '94 proposal (see `doc/msgid.doc'). NOT YET IMPLEMENTED.

`FTN_FORCE_INTL'
     Always generate a `^AINTL' kludge, even if sender and receiver are
     in the same default zone (first `Address' in `config').

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

System dependent configuration:

`DO_HAVE_GETTIMEOFDAY'
     Define, if the system has the gettimeofday() function.

`DO_HAVE_TM_GMTOFF'
     Define, if the system has a tm_gmtoff field in struct tm.

`DO_HAVE_TM_ZONE'
     Define, if the system has a tm_zone field in struct tm.

`DO_HAVE_STRFTIME'
     Define, if the system has the Standard-C strftime() function.

`DO_HAVE_TZNAME'
     Define, if the system has `extern char *tzname[2]'.

`DO_BINARY'
     Define, if files must be opened in binary mode.

Define only one of `DO_HAVE_TM_ZONE', `DO_HAVE_STRFTIME',
`DO_HAVE_TZNAME'.

   The following defines should normally left as is!!!

Files and directories used by FIDOGATE:

`CONFIG'
     Name of main config file.

`HOSTS'
     FTN addresses / host names config file.

`ALIASES'
     User aliases config file.

`AREAS'
     FTN area / newsgroup config file.

`MAUS'
     MAUS domain list config file.

`PASSWD'
     Password file (`ffx', `ftnaf').

`LOG'
     FIDOGATE log file.

`SEQ_MAIL'
     Sequencer file used by `ftn2rfc' for mail messages.

`SEQ_NEWS'
     Sequencer file used by `ftn2rfc' for news messages.

`SEQ_MSGID'
     Sequencer file used by `rfc2ftn' for `^AMSGID's.

`SEQ_PKT'
     Sequencer file used by `rfc2ftn' for outbound packet names.

`SEQ_FF'
     Sequencer file used by `ffx' for control and data files.

`SEQ_TOSS'
     Sequencer file used by `ftntoss', `ftnroute' for output packet
     files.

`SEQ_MQ'
     Sequencer file used by `queuemail'. NOT YET IMPLEMENTED.

`INBOUND'
     Input directory for `ftn2rfc'. Relative to `SPOOLDIR'.

`INBOUND_MAIL'
     Directory where `ftn2rfc' creates converted mail messages.
     Relative to `SPOOLDIR/INBOUND'.

`INBOUND_NEWS'
     Directory where `ftn2rfc' creates converted news messages.
     Relative to `SPOOLDIR/INBOUND'.

`INSECURE'
     Insecure input directory for `ftn2rfc'.

`OUTBOUND'
     Directory where `rfc2ftn' creates output packets.

`LOCKS'
     Directory where lock files are created.

`TOSS'
     Tosser top directory.

`TOSS_IN'
`TOSS_TMP'
`TOSS_OUT'
     Tosser input, temporary, and output directory. Used by `ftntoss',
     `ftnroute', `ftnpack'.

`SECURE'
     Enables secure permissions for the files created by FIDOGATE. See
     `#define's dependent on `#ifdef SECURE'.

`FTN_RFC_HEADERS'
     RFC headers recognized at the beginning of an FTN messages. Used by
     function msg_body_parse(), currently NOT by `ftn2rfc'.

Program constants, should not be changed.

`xx_MODE'
     Modes (`fopen') for opening files.

`DATE_DEFAULT'
     Default date format string.

`DATE_NEWS'
     Date format string for news articles (no time zone comment).

`DATE_MAIL'
     Date format string for mail.

`PRODUCT_CODE'
     FIDO product code used by `rfc2ftn'. Should be left as is (`0xfe').

`MAX_LINELEN'
     Maximum line length for formatting FIDO messages.

`MAXADDRESS'
     Maximum number of `Address' statements in `config' file.

`MAXDOSDRIVE'
     Maximum number of `DosDrive' statements in `config' file.

`MAXPATH'
     Maximum length of a pathname in FIDOGATE.

`MAXINETADDR'
     Maximum length of the address part of an Internet address in
     FIDOGATE.

`MAXUSERNAME'
     Maximum length of the user name part of an Internet address in
     FIDOGATE.

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


The C Source `Makefile'
=======================

   Most of these definitions apply for both `src/Makefile' and
`lib/Makefile'.

`BINDIR'
     The directory for user programs.

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

`SPOOLDIR'
     FIDOGATE's spool directory.

`OWNER'
     Owner of FIDOGATE files.

`GROUP'
     Group of FIDOGATE files.

`PERM_PROG'
     Permissions for installing programs.

`PERM_DATA'
     Permissions for installing data files.

`PERM_SETUID'
     Permissions for installing setuid `OWNER' programs.

`PERM_DIR'
     Permissions for installing directories.

`CC'
     C compiler.

`YACC'
     `yacc' or a clone like `bison -y'.

`AR'
     `ar' librarian.

`RANLIB'
     Library utitility, if needed.

`CFLAGS'
     Flags for compiling FIDOGATE.

`LFLAGS'
     Flags for linking FIDOGATE.

`LIBS'
     Libraries for linking FIDOGATE, including the FIDOGATE library
     `libfidogate.a' itself.

`INSTALL_PROG'
     Install utility for installing programs.

`INSTALL_DATA'
     Install utility for installing data files.

`INSTALL_SETUID'
     Install utility for installing setuid programs.

`INSTALL_DIR'
     Install utility for installing directories.

`LIB'
     Name of the FIDOGATE library.

   If the directories in `SPOOLDIR' are different from the default ones
in `src/config.h', the commands for the `install-dirs' target must be
changed accordingly.


Compiling and Installing FIDOGATE
=================================

   After editing `config.h' and `Makefile' in the src directory,
compile the beast by entering:
     make

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

   Next change to the lib directory. Compile some of the scripts and
config files:
     make

   After editing the various config files, install them:
     make install


Integrating FIDOGATE and the Mail/News System
=============================================

   See the samples directory for some CNews and sendmail config files.
More documentation is included in the doc directory, especially the
`FIDOGATE-Point-HOWTO'. Most of it is written in German, though.

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


Testing FIDOGATE Operation
==========================

`ftn2rfc'
---------

   To verify proper operation of FIDOGATE copy a FIDO mail packet to the
directory SPOOLDIR/in, then execute LIBDIR/ftn2rfc as user `OWNER'. Add
some `-v' options for verbose debug messages:
     LIBDIR/ftn2rfc -vvvvv

   This should result in one or more files named `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
     LIBDIR/fidorun
   this will feed those files to `rnews' and `rmail'. After some
processing you should find the messages in your mail folder and/or
newsgroups.

`rfc2ftn'
---------

   Grab a single news posting in a FIDO linked newsgroup and feed it to
`rfc2ftn':
     LIBDIR/rfc2ftn -vvvvv -n <ARTICLE
   This should result in a FIDO mail packet `nnnnnnnn.pkt' in the
directory SPOOLDIR/out.

   Do the same with a mail message addressed to a FIDO recipient:
     LIBDIR/rfc2ftn -vvvvv USER_NAME@FIDO.ADRESS <MESSAGE
   Again you should get a packet `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.


Connecting to FIDONET
=====================

   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 for
UNIX:
   * BinkleyTerm 3.02pl10

   * ifcico 2.x from Eugene Crosser's ifmail package

   The solution I'm using is a separate PC running DOS and BinkleyTerm
as a mailer. My system currently comprises a SUN 3/60 as the
server/gateway and 3 PCs running DOS. 2 of them are running BinkleyTerm
for the phone and ISDN lines. The BinkleyTerm outbound is kept on the
UNIX server, so all PCs and the gateway have access to it.


FIDOGATE Programs
*****************

   The current FIDOGATE distribution includes the following programs and
scripts:


* ffx::         Remote execution via FIDO mailer
* ffxbatch::    Remove execution via FIDO mailer - batched
* ffxmail::     `ffx' frontend for sending mail
* ffxqt::       Execute `ffx' requests
* ffxrun::      Script for running `ffxqt'
* fidorun::     Mail/news processing script
* ftn2ftn::     FTN-FTN NetMail gateway
* ftn2rfc::     FTN-Internet mail/news gateway
* ftnaf::       Areafix
* ftnbounce::   Bounce mail to unknown FTN address
* ftnbsy::      Create/delete Binkley busy files
* ftnin::       Frontend for `ftn2rfc'
* ftnlock::     Create/delete lock files
* ftnpack::     Pack (ArcMail) FTN mail packets
* ftnroute::    Route FTN mail packets
* ftntoss::     Toss/remap/rewrite FTN mail packets
* out-attach::  Binkley outbound file attach utility
* pktdebug::    FTN mail packet debugger
* rfc2ftn::     Internet-FTN gateway
* runtoss::     Script for running tosser
* sumcrc::      CRC checksum utility
* toaddr::      Get recipient addresses from header

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

`-v --verbose'
     Increase the verbosity/debug level.

`-h --help'
     Help on usage and options.

`-c --config name'
     Read an alternate config file. `""' means none. name may start
     with `%L/', indicating a file relativ to LIBDIR.

`-L --lib-dir name'
     Set the FIDOGATE library directory (LIBDIR).

`-S --spool-dir name'
     Set the FIDOGATE spool directory (SPOOLDIR).

`-a --addr Z:N/F.P'
     Set the main address of this system.

`-f --fake-addr Z:N/F.P'
     Set the fakenet address of this system (only necessary for
     old-style 3D points).

`-u --uplink-addr Z:N/F.P'
     Set the uplink address (boss node) of this system.

`-z --zone Z'
     Set the zone AKA for zone Z

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


ffx -- Remote Execution via FIDO Mailer
=======================================

Usage:

     ffx  [-options]  Z:N/F.P  command

Options:

`-b --batch-dir dir'
     Operate in batch mode, using 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/dir. Implies `-n'.

`-B --binkley name'
     Set Binkley outbound directory.

`-F --flavor flavor'
     Set flavor of outbound FLO file: `Hold', `Normal', `Direct', or
     `Crash'.

`-g --grade grade'
     Set grade of control and data files to grade (single letter
     [a-z0-9]).

`-n --nocompression'
     Don't compress data files.

   The compression program (`gzip') and other are hardcoded in the
`ffx.c' source code.


ffxbatch -- Batches Remote Executon via FIDO Mailer
===================================================

Usage:

     ffxbatch  [-options]  Z:N/F.P  command

Options:

`-b --batch-dir dir'
     Set batch directory as used by `ffx -b'dir. The file in this
     directory will be archived and transfered as a single `ffx'
     command.

`-B --binkley name'
     Set Binkley outbound directory.

`-F --flavor flavor'
     Set flavor of outbound FLO file: `Hold', `Normal', `Direct', or
     `Crash'.

`-g --grade grade'
     Set grade of control and data files to grade (single letter
     [a-z0-9]).

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


ffxmail -- ffx Frontend for Sending Mail
========================================

Usage:

     ffxmail  Z:N/F.P  address ...

No options.

   `ffxmail' calls `ffx' in batch mode (`-b'), selecting the batch
directory from the node address. Modify the script for other
addresses/batch directories.


ffxqt -- Execute ffx Requests
=============================

Usage:

     ffxqt  [-options]

Options:

`-I --inbound name'
     Select input directory where `f???????.ffx' files are read from.
     Default: INBOUND

`-t --insecure'
     Process ffx files without password. Default: ffx file must contain
     a password.

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


ffxrun -- Script for Running ffxqt
==================================

Usage:

     ffxrun  [ffxqt options]

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


fidorun -- Mail/News Processing Script
======================================

Usage:

     fidorun

No options.

   This script is run by `ftn2rfc' or `ftnin', feeding the output in
SPOOLDIR/in/mail and SPOOLDIR/in/news to `rmail' and `rnews',
respectively.


ftn2ftn -- FTN-FTN NetMail Gateway
==================================

Usage:

     ftn2ftn  [-options]  [packet ... ]

Options:

`-A --address-a Z:N/F.P'
     Set FTN address in network A.

`-B --address-b Z:N/F.P'
     Set FTN address in network B.

`-o --out-packet-file NAME'
     Set output packet file name.

`-O --out-packet-dir NAME'
     Set output packet directory.

   This 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 packet is given on the command line, `ftn2ftn' looks for
packets addressed to the gateway addresses (A and B) in the Binkley
outbound. Both gateway addresses must be specified with the `-A' and
`-B' options.

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


ftn2rfc -- FTN-Internet Gateway
===============================

Usage:

     ftn2rfc  [-options]  [packet ... ]

Options:

`-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.

`-I --inbound-dir NAME'
     Set the input directory for FTN packets.

`-l --lock-file'
     Create lock file while processing.

`-x --exec-program NAME'
     Run script/program NAME after processing all FTN packets. Typically
     this is `fidorun'.

   `ftn2rfc' read packet files from the input directory or the command
line and converts the FTN mails to Internet RFC mail and news, written
as mail files and news batches to the directories SPOOLDIR/in/mail and
SPOOLDIR/in/news, respectively.


ftnaf -- Areafix
================

Usage:

     ftnaf  [-options]  [Z:N/F.P  command ]

Options:

`-m --mail'
     Process Areafix mail message (RFC) on stdin.

`-r --no-reply'
     Don't send reply via, write to stdout.

`-n --no-rewrite'
     Don't rewrite AREAS.BBS.

`-b --areas-bbs NAME'
     Use alternate AREAS.BBS.

Commands:

`listall'
     List all areas.

`list'
     List areas available to node.

`query'
     List subscribed areas.

`unlinked'
     List unsubscribed areas.

`passwd Z:N/F.P PASSWORD'
`password Z:N/F.P PASSWORD'
`pass Z:N/F.P PASSWORD'
     Set address and password.

`add AREA'
`+AREA'
`AREA'
     Subscribe to AREA.

`remove AREA'
`delete AREA'
`del AREA'
`-AREA'
     Unsubscribe from AREA.

`help'
     Help on Areafix commands.

   All command keywords may be prefixed by `%'.

   For proper operation `ftnaf' requires the `X-FTN-From' header
generated by `ftn2rfc' (see `config.h' configuration).


ftnbounce -- Bounce Mail to Unknown Addresses
=============================================

Usage:

     ftnbounce  [-options]  [packet ... ]

Options:

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


ftnbsy -- Create/delete Binkley Busy Filess
===========================================

Usage:

     ftnbsy  [-options]  Z:N/F.P ...

Options:

`-t --test'
     Test for existing busy file.

`-l --lock'
     Create busy file, fail if it already exists.

`-u --unlock'
     Remove busy file.

`-w --wait'
     Wait for busy file to be released (when `-l' option is given).

   NOT YET IMPLEMENTED.


ftnin -- Frontend for `ftn2rfc'
===============================

Usage:

     ftnin  [-options]

Options:

`-n --no-toss'
     Don't call `ftn2rfc' for processing.

`-x --exec-program SCRIPT'
     Execute SCRIPT after `ftn2rfc' processing.

   All standard options are passed to the called `ftn2rfc'.

   `ftnin' looks for mail packets addressed to the gateway addresses
(all `Address' statement in `config') and calls `ftn2rfc' for each
packet.


ftnlock -- Create/Remove Lock Files
===================================

Usage:

       [-options]  [NAME ... ]

Options:

`-l --lock'
     Create lock file NAME, fails if it already exists.

`-u --unlock'
     Remove lock file NAME.

   Lock files are created in SPOOLDIR/locks/NAME.


ftnpack -- Pack ArcMail FTN Mail Packets
========================================

Usage:

     ftnpack  [-options]  [packet ... ]

Options:

`-B --binkley name'
     Set Binkley outbound directory.

`-g --grade grade'
     Only process packets with grade (single letter).

`-I --in-dir name'
     Set input directory. Default: SPOOLDIR/out

`-l --lock-file'
     Create lock file while processing.

`-p --packing-file name'
     Read alternate `packing' config file. Default: LIBDIR/packing

`-m --maxarc size'
     Set maximum size of an archive to size KByte. If an existing
     ArcMail archive exceeds this size, `ftnpack' creates a new one.

`-P --pkt'
     Process *.pkt files in the input directory. Default: output files
     of `ftnroute'.


ftnroute -- Route FTN Mail Packets
==================================

Usage:

     ftnroute  [-options]  [packet ... ]

Options:

`-g --grade grade'
     Only process packets with grade (single letter).

`-I --in-dir name'
     Set input directory. Default: SPOOLDIR/tmp

`-O --out-dir name'
     Set output directory. Default: SPOOLDIR/out

`-l --lock-file'
     Create lock file while processing.

`-r --routing-file name'
     Read alternate `routing' config file. Default: LIBDIR/routing

`-M --maxopen n'
     Set maximum number of concurrently open packet filess to n.
     Default: 10 (`MAXOPENFILES' from `config.h')


ftntoss -- Toss FTN Mail Packets
================================

Usage:

     ftntoss  [-options]  [packet ... ]

Options:

`-g --grade grade'
     Only process packets with grade (single letter).

`-I --in-dir name'
     Set input directory. Default: SPOOLDIR/tmp

`-O --out-dir name'
     Set output directory. Default: SPOOLDIR/out

`-l --lock-file'
     Create lock file while processing.

`-r --routing-file name'
     Read alternate `routing' config file. Default: LIBDIR/routing

`-m --maxmsg n'
     Flush/close all output packet files after reading n messages.

`-x --maxmsg-exit n'
     Flush/close all output packet files after reading n messages and
     processing the current input packet, then exit.

`-M --maxopen n'
     Set maximum number of concurrently open packet filess to n.
     Default: 10 (`MAXOPENFILES' from `config.h')


out-attach -- Outbound file attaches
====================================

Usage:

     out-attach  [-options]  Z:N/F.P  file ...

Options:

`-B --binkley name'
     Set Binkley outbound directory.

`-F --flavor name'
     Set flavor of outbound FLO file to name: `Hold', `Normal',
     `Direct', or `Crash'.

   The file name may start with `^' or `#', indicating that the file
should be deleted or truncated, respectively, after sending.


pktdebug -- FTN mail packet debugger
====================================

Usage:

     pktdebug  [-options]  file ...

Options (standard options not supported):

`-m --msg-header'
     Print message header.

`-t --msg-text'
     Print message text

`-v --verbose'
     Increase verbose/debug level.

`-h --help'
     Help on `pktdebug' usage.

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


rfc2ftn -- Internet-FTN Gateway
===============================

Usage:

     rfc2ftn  [-options]  [address ...]

Options:

`-b --news-batch'
     Process news batch (implies `-n').

`-B --binkley name'
     Set Binkley outbound directory.

`-i --ignore-registration'
     Do not bounce mail to FTN nodes not registered in HOSTS (if
     `HOSTS_RESTRICTED' in `config.h' is enabled).

`-n --news-mode'
     Process news message in stdin. Default: mail

`-o --out-packet-file  name'
     Write output to FTN packet file name.

`-O --out-packet-dir  name'
     Set output directory for FTN packets. Default: SPOOLDIR/out

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

`-w --write-outbound  flav'
     Write output directly to Binkley .?UT packets in outbound.

`-W --write-crash'
     Write only crash mail directly to Binkley .CUT file.


runtoss -- Script for Running Tosser
====================================

Usage:

     runtoss  type

No options.

Types:

`normal'
     Default processing (input taken from SPOOLDIR/toss/in).

`out'
     Process output of `rfc2ftn' (input taken from SPOOLDIR/out).

   See the script itself for some configuration options (maximum number
of messages, maximum archive size, maximum number of concurrently open
files).


sumcrc -- CRC Checksum Utility
==============================

Usage:

     sumcrc  [-options]  file ...

Options (standard options not supported):

`-1 --skip-first-line'
     Skip first line in file. Useful for computing nodelist CRC.

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

`-6 --crc16'
     Use alternate 16 bit CRC16 polynomial.

`-x --hex'
     Output CRC value in hex. Default: decimal

`-z --eof-at-ctrl-z'
     The Ctrl-Z character (`^Z') indicates end-of-file (MSDOS kludge).

`-v --verbose'
     Increase verbose/debug level.

`-h --help'
     Help on `sumcrc' usage.

   Use `sumcrc -1z' to compute the checksum for a standard FIDO
nodelist.


toaddr -- Get Recipient Addresses
=================================

Usage:

     toaddr  file ...

No options.

   This utility reads the RFC header of file and outputs (to stdout) all
recipient addresses. Used internally by the script `fidorun'.


FIDOGATE Config Files
*********************

   FIDOGATE uses the following config files:


* Config::      `config' main configuration file
* Hosts::       `hosts' FTN address to host name conversion
* Aliases::     `aliases' user aliases
* Areas::       `areas' FTN area to newsgroup conversion
* Maus::        `maus' Internet addresses for MAUS systems
* Bounce::      Bounce messages of `ftn2rfc'
* Passwd::      `passwd' password config file
* Routing::     `routing' file for `ftntoss' and `ftnroute'
* Packing::     `packing' file for `ftnpack'

   All config files use the `#' character for introducing a comment and
ignore empty lines. Keywords and commands are not casesensitive.


`config' main configuration file
================================

   FIDOGATE uses several `config' files:

`config'
     The config file for the gateway.

`config.af'
     The config file for the `ftnaf' program.

`config.toss'
     The config file for the tosser related programs `ftntoss',
     `ftnroute', `ftnpack', and `ftnlock'.

The format of this file is

     keyword [ arg ... ]

Keywords and arguments may be quoted in `""', keywords are not
case-sensitive.

`Libdir directory'
     The FIDOGATE lib directory (default specified in `src/Makefile').

`Spooldir directory'
     The FIDOGATE spool directory (default specified in `src/Makefile').

`Outbound directory'
     The BinkleyTerm-style outbound base directory, without the
     `out.'nnn zone directory.

`Inbound directory'
     The BinkleyTerm-style inbound directory.

`Hostname name'
     The host name part of your Internet address.

`Domain name'
     The domain part of your Internet address, use ".uucp" if you don't
     have an Internet domain address.

`HostsDomain name'
     The domain added to entries in the `hosts' config file. Default is
     the same as `Domain'.

`Origin text'
     FTN default EchoMail origin line, the text used for the origin line
     generated by `rfc2ftn'. Quote text in `""' if it contains spaces.

`Organization text'
     Organization header for mail and news generated by `ftn2rfc'.
     Quote text in `""' if it contains spaces.

`Address node [fakenode]'
     Your FTN address (Z:N/F.P) and optional fakenet address. The
     fakenet address is used for points and 3D EchoMail. There may be
     up to 32 `Address' statements.

`Uplink node'
     The FTN address of your uplink, must be in the same order as the
     corresponding `Address' statements. There may be up to 32 `Uplink'
     statements.

`Gateway node'
     Specifies an FTN-Internet gateway for routing Internet mail. This
     address is used, if the `ROUTE_VIA_FTN_GATEWAY' compile option is
     set.

`Zone zone domain ftndomain out'
     Specifies Internet domain domain, FTN domain ftndomain, and
     outbound directory out (relative to `Outbound') for the FTN zone
     zone. zone may be `default', then this is the default entry for
     not explicitely specified zones.

`DosDrive drive directory'
     OPTIONAL: specify translation of a DOS drive (e.g. `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
     `DosDrive' statements are specified, FIDOGATE will automatically
     translate file attaches to and from.

`AreasBBS name'
     OPTIONAL: specify the `areas.bbs' EchoMail distribution file used
     by `ftnaf' and `ftntoss'.


`hosts' FTN address to host name conversion
===========================================

   This file contains the FTN addresses and host names for registered
FTN nodes. If `HOSTS_RESTRICTED' is defined in `config.h', this file
controls the access to the gateway.

The format of this file is

     node  hostname  [ options ]

Fields:

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

hostname
     Host name, one of

    local host name
          A name without a trailing `.' is a hostname in the local
          domain (specified by `HostsDomain' or default `Domain' in
          `config').

    fully qualified domain name
          A name with a trailing `.' is a fully qualified domain name
          for this node.

    `-'
          A `-' specifies a listed node, but without a host name
          translation, using the standard p.f.n.z address.

options
    `-p'
          Generate addresses with point, e.g. `p99.hippo.fido.de'.
          Default is omitting the point.

    `-d'
          Mark the node as down, mail to this address will be bounced
          with an appropiate error message.

   The `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 before the boss node, if there are entries for both.

   Example:

`config':

     HostsDomain   .Fido.DE

`hosts':

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

Resulting data base read into memory:

     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:

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

     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


`aliases' user aliases
======================

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

The format of this file is

     alias  node  "full name"

Fields:

alias
     Alias for the user.

node
     FTN address of the user.

full name
     Full name of the user.

   The FTN address 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:

`aliases':

     mvr         2:2452/110.6    "Marc van.Rey"

   Using the definitions from the section on `hosts', this results in
the following address conversion:

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


`areas' FTN area to newsgroup conversion
========================================

   This file contains FTN areas with corresponding newsgroups and
options.

The format of this file is

     area  newsgroup  [ options ]

Fields:

area
     FTN area.

newsgroup
     Usenet newsgroup.

options
    `-z zone'
          Select zone AKA zone for this area/newsgroup.

    `-d distribution'
          Use Usenet `distribution' for this newsgroup when gating from
          FTN to Internet.

    `-o "origin"'
          Use an alternate origin line for this area when gating from
          Internet to FTN.  (Default specified in `config'.)

    `-l'
          Only local crosspostings are allowed in this newsgroup/area.

    `-x'
          No crosspostings are allowed in this newsgroup/area.

    `-m'
          Don't gate messages coming from MAUSNET to this newsgroup.
          NOT YET IMPLEMENTED.

    `-g'
          Don't gate messages coming from another FTN gateway to this
          newsgroup.

    `-8'
          Use the ISO-8859-1 charset when gating to this newsgroup. NOT
          YET IMPLEMENTED.

   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 `FTN_JUNK'
newsgroup specified in `config.h'.


`maus' Internet addresses for MAUS systems
==========================================

   This file contains MAUS system names and corresponding Internet
addresses.

The format of this file is

     maus  address  [ gateway ]

Fields:

maus
     MAUS system name or `default' for the default entry.

address
     Internet address of the MAUS system or `-' for no Internet
     address. Either complete FQDN or just the domain (leading dot
     `.'). If only the domain is specified, the address is the
     concatenation of maus and domain.

gateway
     Optional specification of an FTN-MAUS gateway for this system.

   The `default' entry specifies the default domain for all MAUS system
not explicitely given an alternate address in this config file.
Therefore you should only specify a domain part only.

   The `default' entry must contain a gateway field, if `rfc2ftn' shall
convert Internet MAUS to FTN MAUS addresses.  `rfc2ftn' currently only
recognizes the default MAUS domain.

   The list of MAUS systems and corresponding Internet addresses is
posted regularly to the newsgroup `de.comm.gateways'.

   Example:

     default    .maus.de    2:2452/101.6
     
     A-L        a-l.maus.sub.org
     A-W        a-w.maus.sub.org


Bounce messages of `ftn2rfc'
============================

   `ftn2rfc' uses the following files for messages sent to the FTN user
when bouncing mail for some reason:

`bounce.noto'
     Message addressed to user `UUCP' or `GATEWAY' without a `To' line
     at the very beginning of the message.

`bounce.restricted'
     Message from node not listed in `hosts' and gateway running in
     restricted mode.

`bounce.insecure'
     Message came via an insecure (i.e. not password protected) link and
     contains a `To' line. This requires the `-t' option to `ftn2rfc'.

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

`%F'
     FTN address of message sender.

`%T'
     FTN address of message recipient (the gateway, that is).

`%O'
     FTN address of message origin.

`%d'
     Date/time of message.

`%t'
     Name of message recipient.

`%f'
     Name of message sender.

`%s'
     Message subject.

`%R'
     `To' line, Internet address.

`%M'
     The entire message body.


`passwd' Password Config File
=============================

   This file contains passwords used by `ftnaf', `ffx', and the tosser
programs.

The format of this file is:

     context  node  password  options

Contexts:

`packet'
     FTN packet passwords, checked by `ftntoss', inserted by `ftnpack'.
     NOT YET IMPLEMENTED.

`af'
     Areafix passwords for requests to `ftnaf'.

`ffx'
     `ffx' command passwords, checked by `ffxqt', inserted by `ffx'
     into the `.ffx' command files.

   Example:

     packet      2:1234/5678     WUERG
     af          2:1234/5678     WUSEL       F
     af          242:1234/5678   WUSEL       U
     ffx         242:1111/99     BLAHBLUB


`routing' file
==============

   This file contains the routing commands performed by `ftntoss'
(commands `remap' and `rewrite') and `ftnroute' (everything else).

   The syntax of the `routing' commands is very similar to the routing
file used by the well-known FIDO tossers QMail and SQUISH.

The format of this file is:

     remap      src-node  dest-node  name
     rewrite    src-node  dest-node
     
     echomail
     netmail
     
     send       flavor    nodes
     route      flavor    dest-node nodes
     hostroute  flavor    nodes
     hubroute   flavor    nodes
     
     change     old-flavor  new-flavor  nodes
     
     sendmove   flavor    nodes

Commands:

`remap'
     Remaps NetMail addressed to name at src-node to the new address
     dest-node. Most usefull for remapping to points based on their
     name.  name supports shell-style wildcard patterns.

`rewrite'
     Rewrites NetMail from and to addresses. A node address matching
     src-node will be changed to dest-node.

`echomail'
     Starts routing commands for EchoMail.

`netmail'
     Starts routing commands for NetMail.

`send'
     Send normal mail addressed to nodes with flavor.

`route'
     Route normal mail addressed to nodes via dest-node, using flavor.

`hostroute'
     Route normal mail addressed to nodes via their host (i.e. Z:N/0),
     using flavor.

`hubroute'
     Route normal mail addressed to nodes via their hub, using flavor.
     NOT YET IMPLEMENTED.

`change'
     Change flavor of mail packet from old-flavor to new-flavor.

`sendmove'
     Like `send', but `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. NOT YET
     IMPLEMENTED.

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

The outbound flavor string flavor can be any of `normal', `hold',
`crash', `direct', `out', `hut', `cut', `dut'.

   Example:

     Remap     2:2452/110.0 2:2452/110.7  "Martin Koser"
     Rewrite   242:241/*    2:241/*
     
     NetMail
     send      hold         242:1000/3 6 7
     route     hold         242:1000/50 51 52 53 54 55 56 57 58 59
     change    crash  hold  242:1000/1.all 2.all


`packing' file
==============

   This file contains the packer (archiver) definitions and packing
commands for `ftnpack'.

The format of this file is:

     arc        name  `"'archiver`"'
     prog       name  `"'program`"'
     
     pack       name  nodes
     rpack      name  dest-node  nodes

Packer/program definitions:

`arc'
     Defines the archiver name as program archiver. The archiver string
     must contain two `%s', the first one is replaced with the archive
     name, the second one with the packet name.

`prog'
     Defines the program name as program. The program string must
     contain a `%s', which is replaced with the name of the packet to be
     processed.

Packing definitions:

`pack'
     Pack all mail addressed to nodes using the archiver defined as
     name. The archiver name `noarc' indicates that the mail packet
     should not be packed, but copied to the OUT file of the node.

`rpack'
     Same as `pack', but pack all mail addressed to nodes to the
     archive for dest-node.

   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     *


Index
*****


* Aliases:                              Aliases.
* ArcMail:                              ftnpack.
* Areafix:                              ftnaf.
* Areas:                                Areas.
* Bounce:                               ftnbounce.
* Bounce messages:                      Bounce.
* Busy files:                           ftnbsy.
* Checksum:                             sumcrc.
* Compiling:                            Compiling.
* Config:                               Config.
* Config files:                         Config files.
* Connecting:                           Connecting.
* CRC:                                  sumcrc.
* ffx:                                  ffx.
* ffxbatch:                             ffxbatch.
* ffxmail:                              ffxmail.
* ffxqt:                                ffxqt.
* ffxqt:                                ffxrun.
* ffxrun:                               ffxrun.
* FIDONET:                              Connecting.
* fidorun:                              fidorun.
* File attach:                          out-attach.
* ftn2ftn:                              ftn2ftn.
* ftn2rfc:                              ftn2rfc.
* ftn2rfc:                              ftnin.
* ftnaf:                                ftnaf.
* ftnbounce:                            ftnbounce.
* ftnbsy:                               ftnbsy.
* ftnin:                                ftnin.
* ftnlock:                              ftnlock.
* ftnpack:                              ftnpack.
* ftnroute:                             ftnroute.
* ftntoss:                              ftntoss.
* Gateway:                              rfc2ftn.
* Gateway:                              ftn2rfc.
* Gateway:                              ftn2ftn.
* Hosts:                                Hosts.
* Installation:                         Installation.
* Installation:                         Compiling.
* Integration:                          Integration.
* Introduction:                         Top.
* Introduction:                         Introduction.
* Lock files:                           ftnlock.
* Mail:                                 ffxmail.
* Maus:                                 Maus.
* out-attach:                           out-attach.
* Packing:                              Packing.
* pktdebug:                             pktdebug.
* Point:                                Point.
* Programs:                             Programs.
* Remote execution:                     ffx.
* Remote execution:                     ffxbatch.
* Remote Execution:                     ffxqt.
* rfc2ftn:                              rfc2ftn.
* Routing:                              ftnroute.
* Routing:                              Passwd.
* Routing:                              Routing.
* runtoss:                              runtoss.
* sumcrc:                               sumcrc.
* Testing:                              Testing.
* toaddr:                               toaddr.
* Tossing:                              ftntoss.
* Tossing:                              runtoss.


