FIDOGATE - Compiling and installing FIDOGATE

Go to the first, previous, next, last section, table of contents.

# Compiling and installing FIDOGATE

- Point: Installing a FIDOGATE point system
- config.h: The `config.h` header file
- config.make: The `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

This chapter describes the FIDOGATE configuration and installation. You must also edit the config files to be installed in the LIBDIR directory. Create `config.common`, `config.gate`, `config.main`, `config.ffx`, `areas`, `hosts`, `passwd`, `routing`, `packing`, `aliases` according to your setup (examples in the examples 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, you may choose whatever you want.
- Put the `NoFromLine` keyword into `config`!!!
- 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 its address with `Gateway` in `config.gate`. FIDOGATE can then be used as your default mailer, delivering all non-Fido mail to this gateway.

See also `doc/Fido-Point-HOWTO` (German) and `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.

## The `config.h` Header File

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

Common configuration:

`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.
`MAXMSGSIZE`
  Maximum size of FIDO messages generated by `rfc2ftn`, larger messages will be split. Alas, less than 16K seems to be the only safe setting. This is the default value.
`FTN_INVALID_DOMAIN`
  Domain address to be used for invalid FTN addresses.

`ftn2rfc` configuration:

`ALIASES_ARE_LOCAL`
  Addresses found in the `aliases` config file are rewritten so that the sender's address is the gateway.
`CHARSET_DEFAULT_IBMPC`
  Make IBMPC the default char set (no `^ACHRS` kludge).

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

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:

`DO_HAVE_FCNTL_LOCK`
  Define, if the system support fcntl() file locking.
`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_SYSEXITS_H`
  Define, if the system support the `sysexits.h` header file.
`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_HAVE_STRCASECMP`
  Define, if the system has the `strcasecmp()` and `strncasecmp()` functions.
`DO_HAVE_STRICMP`
  Define, if the system has the `stricmp()` and `strnicmp()` functions.
`DO_HAVE_STERROR`
  Define, if the system has the `strerror()` function.
`DO_BINARY`
  Define, if files must be opened in binary mode.
`DO_DOSIFY`
  Define, if filenames must be converted to DOS, OS2-style `\`.

Define only one of `DO_HAVE_TM_ZONE`, `DO_HAVE_STRFTIME`, `DO_HAVE_TZNAME`, and also only one of `DO_HAVE_STRCASECMP`, `DO_HAVE_STRICMP`.

THE FOLLOWING DEFINES SHOULD NORMALLY LEFT AS IS!!!

Message ID configuration:

`FIDODOMAIN`
  Default Internet domain for standard FIDO addresses (zone 1--6). Used for Message-IDs only, so DO NOT CHANGE.
`MSGID_ORIGID`
  Generate Gatebau '93 `^AORIGID`, `^AORIGREF` kludges.

Files and directories used by FIDOGATE:

`CONFIG_GATE`
`CONFIG_MAIN`
`CONFIG_FFX`
  Names of FIDOGATE config files.
`DEF_ALIASES`
  Default user aliases config file.
`DEF_AREAS`
  Default FTN area / newsgroup conversion config file.
`DEF_HOSTS`
  Default FTN addresses / host names registration config file.
`DEF_PASSWD`
  Default password config file.
`DEF_PACKING`
  Default packing config file.
`DEF_ROUTING`
  Default routing config file.
`DEF_HISTORY`
  Default database of `^AMSGID`s for dupe checking.
`HOSTS`
`ALIASES`
`AREAS`
`PASSWD`
`PACKING`
`ROUTING`
  Definitions from config file.
`LOG`
  Default 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_SPLIT`
  Sequencer file used by `rfc2ftn` for split messages number.
`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_PACK`
  Sequencer file used by `ftnpack` for packet names in arcmail archives.
`SEQ_MQ`
  Sequencer file used by `queuemail`. NOT YET IMPLEMENTED.
`SEQ_TICK`
  Sequencer file used by `ftnhatch` and `ftntick`.
`LOCK_HISTORY`
  Name of lock file for history access.
`INDIR`
  Input directory for `ftn2rfc`, relative to `SPOOLDIR`.
`INSECUREDIR`
  Insecure input directory for `ftn2rfc`, relative to `SPOOLDIR`.
`INDIR_MAIL`
  Directory where `ftn2rfc` creates converted mail messages, relative to `SPOOLDIR/INDIR`.
`INDIR_NEWS`
  Directory where `ftn2rfc` creates converted news messages, relative to `SPOOLDIR/INDIR`.
`OUTDIR`
  Directory where `rfc2ftn` creates output packets, relative to `SPOOLDIR`.
`SEQ`
  Directory where FIDOGATE creates its sequencer files, relative to `SPOOLDIR`.
`LOCKS`
  Directory where lock files are created, relativ to `SPOOLDIR`.
`TOSS_IN`
`TOSS_TMP`
`TOSS_OUT`
`TOSS_PACK`
  Tosser input, temporary, output, and arcmail packet directory, relative to `SPOOLDIR`. Used by `ftntoss`, `ftnroute`, `ftnpack`.
`TOSS_BAD`
  Directory where tosser puts packets with bad messages, e.g. insecure, dupes, etc.
`QUEUE`
  Directory for queueing. NOT YET IMPLEMENTED.
`TICK_HOLD`
  Hold directory for TIC files, relative to OUTBOUND. Used by `ftnhatch` and `ftntick`.
`xxxx_MODE`
  Permissions for files processed by FIDOGATE.
`FTN_RFC_HEADERS`
  RFC headers recognized at the beginning of FTN messages.
`RFC_LVL_1_HEADERS`
  RFC headers put into FTN messages for RFC level 1.

Program constants, increase the MAX values if needed.

`xx_MODE`
  Modes (`fopen`) for opening files.
`DATE_DEFAULT`
  Default date format string.
`DATE_NEWS`
  Date format string for news articles.
`DATE_MAIL`
  Date format string for mail.
`DATE_FIDO`
  Date format string for FTN messages.
`PRODUCT_CODE`
  FIDO product code used by `rfc2ftn`. Should be left as is (`0xfe`).
`MAX_LINELEN`
  Maximum line length for formatting (line break) FIDO messages.
`MAXADDRESS`
  Maximum number of `Address` and `Zone` 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 possible value is operating system and configuration dependent, see UNIX ulimits.

## The `config.make` Makefile Configuration

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 `subst.pl` to replace <something> in the various shell and perl scripts. Be careful and keep the formatting when editing this file.

The following definitions must start in the first column.

`BINDIR`
  The directory for user programs.
`LIBDIR`
  The directory for FIDOGATE's programs and config files.
`SPOOLDIR`
  FIDOGATE's spool directory.
`LOGDIR`
  Directory for FIDOGATE log files.
`INFODIR`
  Directory for installing info documentation files.
`HTMLDIR`
  Directory for installing HTML documentation files.
`OUTBOUND`
  Default BinkleyTerm-style outbound base directory. This is the base directory, not the actual zone outbound directory.
`INBOUND`
  Default BinkleyTerm-style inbound directory.
`PINBOUND`
  Default BinkleyTerm-style protected inbound directory.
`UUINBOUND`
  Default BinkleyTerm-style inbound directory for the `recvuu` script.
`NEWSETCDIR`
  INN directory: config files
`NEWSVARDIR`
  INN directory: active, history files.
`NEWSLIBDIR`
  INN directory: scripts.
`NEWSSPOOLDIR`
  INN news spool.
`PERL`
  Full path name of perl executable.

The following definitions should have leading white space.

`SHELL`
  The shell for executing commands.
`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` monkey ... (@!#$%&... ouch!) ... librarian.
`RANLIB`
  Library utitility, if needed.
`DEBUG`
  Optimize or debugging flags for compiling.
`CFLAGS`
  Flags for compiling FIDOGATE.
`LFLAGS`
  Flags for linking FIDOGATE.
`LIBS`
  Libraries for linking FIDOGATE, including the FIDOGATE library `libfidogate.a`.
`INSTALL_PROG`
  Install command for installing programs.
`INSTALL_DATA`
  Install command for installing data files.
`INSTALL_SETUID`
  Install command for installing setuid programs.
`INSTALL_DIR`
  Install command for installing directories.
`LIB`
  Name of the FIDOGATE library.

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

## Compiling and Installing FIDOGATE

Compile the beast by entering

    make depend
    make

Alternatively an optimized version can be compiled with

    make DEBUG=-O2

If everything works, you must create the necessary directories:

    make install-dirs

Then install all FIDOGATE programs:

    make install

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

## Integrating FIDOGATE and the Mail/News System

More documentation is included in the `doc` directory, especially the `FIDOGATE-Point-HOWTO`. Most of it is written in German, though.

`scripts/inn`
  Scripts for INN.
`scripts/cnews`
  Scripts for CNews.
`sendmail/cf`
  Sendmail V8 configuration files (m4) and example .mc files for FIDOGATE: Fido.DE domain gateway morannon, orodruin, point setup.

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/ftninpost

this will feed those files to `rnews` and `sendmail`. 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.ADDRESS <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:

- BinkleyTerm 3.02pl10a
- ifcico 2.x from Eugene Crosser's ifmail package

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.

Go to the first, previous, next, last section, table of contents.