3. Compiling & Installing ifmail

First, you'll want to unpack your ifmail archive. I unpacked mine in the 
/etc directory. You can place it in any directory you wish. Just remember 
to change all references in your config files to reflect that directory. 

Second, you'll want to edit the global compiler-configuration-file 
/etc/ifmail/CONFIG. I've ommitted their explanations for breifity. 

3.1 ifmail CONFIG

VERSION         = "2.14-tx8.8"
BINDIR          = $(DESTDIR)"/usr/lib/ifmail"
CONFIGFILE	= $(DESTDIR)"/etc/ifmail/config"
MAPTABDIR       = $(DESTDIR)"/etc/ifmail/misc/maptabs"
DEBUGFILE	= $(DESTDIR)"/var/log/ifmail/ifdebug"
LOGFILE		= $(DESTDIR)"/var/log/ifmail/iflog"
MAILLOG		= LOG_LOCAL0
NEWSLOG		= LOG_LOCAL0
CICOLOG		= LOG_LOCAL0
LOCKDIR		= $(DESTDIR)"/var/lock"
PUBDIR		= $(DESTDIR)"/var/spool/uucppublic"
NEWSSPOOL	= $(DESTDIR)"/var/spool/news"
FAKEDIR         = $(DESTDIR)"/tmp/ifmail/"

#USE_NLS = no
REFERENCES_MSC96 = yes

OPTS          =	-DTERMAIL_HACK -DTPUT_STATUS_HACK \
                -DDONT_REGATE -DSLAVE_SENDS_NAK_TOO \
                -DPUDDLE_GATE -DPCBOARD_GATE -DRNEWSB \
                -DRESTAMP_OLD_POSTINGS=25 -DBELEIVE_ZFIN=1 \
		-DKEEP_MSGID_ON_SPLIT -DIGNORE_SOFTCR \ 
		-DRELAXED -DFORCEINTL -DHAS_TCP -DAREAS_HACKING \
		-DRESTAMP_FUTURE_POSTINGS -DFSCHTML -DMACHIGAI \
		-DALLOW_RETURNPATH -DGATEBAU_MSGID \
		-DDIRTY_CHRS -DAREAS_NUMERAL_COMMENTS
 		
#		-DAREAS_NUMERAK_COMPATIBILITY -DJE -DFORCE_REPLYTO 
#		-DALLOW_CONTROL	-DPARANOID -DNEED_UUCPFROM
 
# Linux/x86:
# (if you use glibc2 aka libc6.x add -DHAS_BSD_SIGNALS and _DHAS_SIGNUM_H)
# (if you use libc5 remove -DHAS_BSD_SIGNALS and _DHAS_SIGNUM_H)
OPTS        +=	-DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \
		-DDONT_HAVE_TM_GMTOFF -DHAS_TERMIOS_H -DASCII_LOCKFILES \
		-DHAS_FSYNC -DHAS_IOCTL_H -DHAS_REGEX_H \
		-DHAS_SYSLOG -DNEED_BSY -DNEED_TRAP \
		-DNEED_FORK -DINT=long -DINT16=short\

#-DHAS_SINGALS -DHAS_SIGNUM_H

OWNER		= fnet
GROUP		= uucp
MODE		= 0711
SMODE		= 4710
MANDIR		= $(DESTDIR)"/usr/man"
MANOWNER	= man
MANGROUP	= man
MANMODE		= 0644

# These last few directives are the most commenly overlooked ones
# in this CONFIG file.

# Add -lresolv if you use libc6 (aka glibc)
# otherwise remove -lresolv if you use libc5
LIBS = -lgdbm
#-lresolv

# Conditional stuff
ifeq (yes,${USE_NLS})
# Uncomment this line if you use libc5
# Comment out this line if you use libc6 (aka glibc)
#LIBS += -lintl
NLSDIR=/usr/share/locale
NLSPACKAGE=ifmail
OPTS += -DHAVE_LOCALE_H _DNLS_CAT_NAME=\"${NLSPACKAGE}\" \ 
	-DNLS_LOCALE_PATH=\"${NLSDIR}\"
endif
ifeq (yes.${REFERENCES_MSC96})
OPTS += -DREFERENCES_MSC96
endif


NOTE:
   I strongly earge you to invest a little time and carefully read the 
definitions for each of the ifmail configuration options. Without
an indepth understanding of their characteristics you could possiably
be ommiting or including features that could either enhance or degrade 
the overall performance of ifmail. Therefore, plenty of concideration 
and thorough planning should go into choosing the proper configuration 
options because each one can have a significant influence on the 
behaviour of your system. Also, remember to check all directory paths 
and make sure they are correctly defined. 

By the way since ifmail-2.3 the logfiles are also handled by syslogd,
(we'll come back to this later). Slackware 3.1 continues to create its 
lockfile in /var/spool/uucp, which may cause problems with a already 
running getty on this port. You may have to change /LOCKDIR/ to 
/var/lock in this case.

Now your ready to compile the ifmail source. 
type: 
make all
and if there were no errors then 
make install

Possible problems when compiling ifmail. Some Slackware distributions may 
have a bumb ndbm.h file which may cause multiple inclusion. To solve this 
edit the /usr/include/ndbm.h file. At the top of the file before any other
lines add these two lines.

#ifndef _NDBM_H_
#define _NDBM_H_  1

Then at the very last line in the file add this.
#endif  /* _NDBM_H_ */

Some linux distributions may have excluded the ndbm.h file altogether. You 
can always get it by adding the source from db-devel-1.85-10.ELF.tar.gz

Another problem can occur with the trap.c source and pre 2.1 linux kernels. 
There are two things you can do to fix this. First, remove the -DNEED_TRAP 
(this is not advised) or second, add -DPRE_21_LINUX to the complier options 
list.

There is also a FAQ in /etc/ifmail/misc that you can refer to in case
some other problem occurs. 

Now you have to install ifcico's config file. You will find an example in 
/etc/ifmail/misc/config. Copy it to /etc/ifmail or to where ever you said 
in /etc/ifmail/CONFIG and adjust it to your systems-configuration.


3.2 ifmail confg

# Configuration file for ifmail (ifgate+ifcico) package by Eugene Crosser
# Compile-time default name of this file may be overridden by -I key.
# Lines with the first nonblank character '#' are comments.

# Log file name. Overrides compile-time default.
logfile		/var/log/ifmail/iflog

# Debug file name. Overrides compile-time default.
debugfile	/var/log/ifmail/ifdebug

# Debugging verbosity (is overidden by -x key). Default is 0.
# There is a explaination of these codes in /etc/ifmail/misc/DEBUG
# I recommend you to use these at first to assist you with debugging
# then once you're satisfied with your setup switch it to verbose 0.
verbose		bcdefghijklmnopqrstu
#verbose	0

# Main address:
address	1:125/710@fidonet

# AKAs:
address        96:9991/64@surfnet
address        21:211/4@prognet

# Passwords: Either you can write the passwords directly in this file or you
# can put them in an external file, which belongs to the user fnet and has 
# the permissions 600, thus nobody can read them. I prefer to do this so 
# ifcico doesn't complain everytime I added a new users & password. The 
# format of the file follows the same format as below.

include         /etc/ifmail/passwds
#password       1:125/11	SECRET
#password       21:211/1	SECRET
#password       96/9991/4	SECRET

# Passwords for packets.
# iftoss will tell you if the password of the packet doesn't match. (and it
# won't be tossed if -DPARANOID specified at compile-time)
# Inserted into outgoing mail packets.
# If for a given node no packetpasswd is specified, password will be used.
#packetpasswd	1:125/11	SECRET

# System alias file - try to fetch ftn-style aliases from there. If "from" 
# address of a message from FidoNet matches _right_ side of some entry in 
# sysalias file, then the Reply-To: header is created in the RFC message 
# with the name part taken from the left side of the sysalis entry and 
# domain part taken from myfqdn (below). E.g., if a fidonet message comes 
# from "John Smith" of 1:234/567.89@fidonet and there is an entry in the
# sysalias file:
# "jsmith:	John.Smith@p89.f567.n234.z1.fidonet.org"
# and fqdn value is "pccross.msk.su", then the resulting message will
# contain a line: "Reply-To: jsmith@pccross.msk.su".
#sysalias	/usr/lib/smail/aliases

# This host fully qualified domain name to add to the alias above
#myfqdn		pccross.msk.su

# If this is specified, beginning of the fidonet message will be scaned for 
# RFC looking headers _only_ if the message is addresses to the name 
# specified. If not specified, beginning of all message is scaned. I do not 
# recommend specifying magicname unless you know that parsing headers will 
# really break things.
#magicname	UUCP

# Directory for incoming packets/files:
inbound		/var/spool/ifmail/inb

# Directories for "listed" and "protected" sessions
listinbound	/var/spool/ifmail/inb
protinbound	/var/spool/ifmail/inb

# Directory for outgoing packets (default domain and zone): 
# other zones will be like "/usr/spool/ifmail/outb.003", 
# other domains will be like "/usr/spool/ifmail/."
outbound	/var/spool/ifmail/outb

# If you specify this, outgoing arcmail files will go to `outbound', but be 
# reffered as being in `dosoutbound' in the .flo files
#dosoutbound    h:\spool\ifmail\outb

# Directory from which the file requests are satisfied
public		/var/spool/uucppublic

# Mapping file which maps shortnames of files to fullnames with path.  
# Every line should include the shortname, some whitespaces and/or tabs
# and then the fullname.  If the fullname does not begin with '/' 
# the publicdir will be prepended to it.  One fullname can be mapped
# to many shortnames without problems.  If one shortname points to many
# fullnames, all matches are sent. The files are sent under their 
# shortnames.
reqmap		/usr/lib/ifmail/reqmap

# Directory with executables to satisfy "magic" file requests if requested a 
# file present in this directory, it will be executed and stdout sent to the 
# remote system.  If the file is not executable, it is read line by line and
# the lines are processed as if they were received file requests (recusively).
# Execution of commands may compromize security!  You are warned.
magic		/usr/lib/ifmail/magic

# Primary nodelist (serves "outbound" directory and domain from the first 
# "address" statement). Name expanded with ".NNN" if neccessary. Remember
# that the case of the nodelist name is as equally important here. Mine
# is in upper case. Also, I've included a script that you can apply that
# will shorten the size of your nodelist. 
#
# nodelist     /var/spool/ifmail/nodelist/nl_short
nodelist       /var/spool/ifmail/nodelist/NODELIST

# Secondary nodelists and nodelists for other domains. Use directory name 
# from the first "nodelist" statement.
#		filename	originating address
nodelist	prognet		21:2221/0@prognet
nodelist	beachnet	96:9990/0@beachnet

# domain translations, just context substitution.  Leading dot recommended.
# May contain '@'-sign too.  First matching used.
# NOTE: If you specify at least one domtrans line, there will be _NO_
# default for fidonet <--> fidonet.org.  Don't forget to specify it
# explicitly as a last line.
#		FTN side		Internet side
# fidonet (zones 1 -> 6 )
#domtrans	.n5020.z2.fidonet	.fido.pccross.msk.su
#domtrans	.n5030.z2.fidonet	.fido.tctube.spb.su
#domtrans        .z1.fidonet             .z1.fidonet.org
#domtrans        .z2.fidonet             .z2.fidonet.org
#domtrans        .z3.fidonet             .z3.fidonet.org
#domtrans        .z4.fidonet             .z4.fidonet.org
#domtrans        .z5.fidonet             .z5.fidonet.org
#domtrans        .z6.fidonet             .z6.fidonet.org
# domain names
#domtrans        .beginnet               .beginnet.ftn
#domtrans        .n320.z101.francom      .belgique.fm.alphanet.ch
#domtrans        .n352.z101.francom      .luxembourg.fm.alphanet.ch
# zone numbers (fidonet is added by default)
#domtrans        .n320.z101.fidonet      .belgique.fm.alphanet.ch
#domtrans        .n352.z101.fidonet      .luxembourg.fm.alphanet.ch
#domtrans	.z140.fidonet		.z140.beginnet.ftn
# default (You have to have at lease one) 

# I prefer to use fidonet.org as my default and all my sendmail routes use it
# but others prefer ftn, if you use ftn then you'll need to change all
# the sendmail routes in my examples over to ftn. 
domtrans	.fidonet		.fidonet.org
#domtrans	.fidonet		.ftn 

# Automatically updated alias database.  If omitted or inaccessible,
# ^aREPLYADDR and ^aREPLYTO kludges are generated in fido messages.
database	/var/spool/ifmail/ifdbm

# Sequencer file (used to generate unique IDs)
sequencer	/var/spool/ifmail/seq

# Areas file (format: "AREA newsgroup distribution") Later on you'll
# see a brief example of what this file looks like.
areas		/etc/ifmail/areas

# Bad groups prefixes - do not pass to fido if appear in Newsgroups header
# This is NOT the same as "!news.group" in the cnews "sys" file.
#badgroup	relcom.ads.
#badgroup	relcom.commerce.

# Groups for which the Gatebau-stlye of MSGID<->Message-ID conversion
# must be dome. Same syntax as badgroups line. ** USE WITH CARE **
#gatebuegroup fido.ger.
#gatebuegroup de.

# Maximum allowed number of groups in the Newsgroups header, article will
# not be gated if exeeds.  If zero or omitted - no limit.
maxgroups	5

# Character translation tables.  The format of the files is as follows:
#
#   
#
# (one character in a line).   and  can be specified
# in one of four notation styles:
# - character itself in single quotes (e.g. 'a')
# - decimal number (e.g. 123)
# - octal number (e.g. 0123)
# - hexadecimal number (e.g. 0x7f)
#
# Crosshatch ('#') denotes start of comment; space, tab and crosshatch
# characters cannot be specified using the first (character) notation.
#
maptabdir	/etc/ifmail/misc/maptabs

defaultftnchar	ASCII
defaultrfcchar	ASCII

# The "defaultftnchar" keyword defines the default charset for incoming
# FTN messages. "toftnchar" is to force translation of _outgoing_  FTN
# messages. By default ifmail doesn't translate when doing rfc->FTN
# gating due to complext nature to find the right charset and the fact
# that in most FTN networks the charset used in rfc is also valid.
# If your FTN network required a given charset defined it here.

#toftnchar	cp437
toftnchar	ASCII

# Transport programs for mail and news, used by iftoss for sendmail, $F expands
# to "from" address, $T - to "to" address.
sendmail	/usr/lib/sendmail -oi -f $F $T
rnews		/usr/lib/news/rnews

# Toss program, used by ifunpack
iftoss		/usr/lib/ifmail/iftoss

# Unpackers, used by ifunpack. 
# $F expands to archive file name
unzip		/usr/bin/unzip -Lojq $F
unarj		/usr/bin/unarj e $F
unlzh		/usr/bin/lha xiq $F
unarc		/usr/bin/unpack $F
unzoo		/usr/bin/zoo -extract $F
unrar		/usr/bin/unrar e $F

# Packer program, used by ifpack
# $F expands to archieve file name, $P - to list of packet names
packer		/usr/bin/zip -q9 $F $P

# Maximum arcmail file size, ifpack will start new arcmail file if exceeds
maxfsize	500000

# Maximum packet size, ifmail/ifnews will start new packet if exeeds.
# *.?ut files are NOT created if nonzero specified, you must run ifpack
# to make packets go out.
maxpsize	30000

# Maximum message size when splitting big messages of usenet origin
# default is 12300 bytes
maxmsize	12300

# Flavors that should not be subject to packet size limiting.  These flavors 
# will be put into `ready to send' packets and not packed by ifpack. Special 
# flavor 'm' means "all netmail" and flavor 'c' means crash mail. If you want
# your netmail packed then exclude the 'm' from the option.
# nonpacked	m
# nonpacked	cm
nonpacked	c

# cnews log file and (temporary) database for seen-bys
newslog		/usr/lib/news/log
msgidbm		/var/spool/ifmail/ifmsgids

# MSGID <-> Message-ID database, for creating correct References when gating
# if commented out this feature isn't activated
refdbm		/var/spool/ifmail/ref_db

# At this point you find in the example-config-file (ifmail/misc/config)
# various explanations and options, which I mostly do not use and so won't 
# explain here. But you should have a look at them.

# The modem is at /dev/ttyS1, the FIFO is locked at 38400 (without FIFO one 
# should lock it a 19200). I use ttyS1 and not cua1, because I use mgetty. 
# Why I'm doing this is explained in the docs to mgetty+sendfax by Gert 
# Doering.
#ModemPort	(time Any0000-0900,Sat,Sun) ttyS1
# Use this option for uugetty
#modemPort	cua1:38400
# Use this option for mgetty
ModemPort	ttyS1

# PhoneTrans lines provide rules to change phone prefixes to make local
# or long-distance calls.  In the example below, my country code is 7,
# and local dialing area is 095.  From the numbers starting with "7-095-"
# the prefix is stripped and the 7-digit remainder is dialed.  For
# the numbers starting with "7-" but not with "7-095-", the country prefix
# "7-" is stripped and the long-distance dialing prefix "8W" substituted. 
# For the numbers not matching any of the above, international
# call is performed: international dialing prefix "8W10" is prepended
# to the unmodified 11-digit number.  Generally, the syntax is:
# "PhoneTrans  / "
PhoneTrans	1-415-	/
ModemReset	ATZ\r
ModemDial	ATDT\T\r
ModemHangup	ATZ\r
ModemOK		OK
# Instead of a simple "CONNECT" I take many Connect-strings, thus there is
# the correct speed of the connect in the logfile. 
ModemConnect    CONNECT\s76800\r
ModemConnect    CONNECT\s57600\r
ModemConnect    CONNECT\s38400\r
ModemConnect    CONNECT\s19200\r
ModemConnect    CONNECT\s16800\r
ModemConnect    CONNECT\s14400\r
ModemConnect    CONNECT\s12000\r
ModemConnect    CONNECT\s1200\r
ModemConnect    CONNECT\s9600\r
ModemConnect    CONNECT\s7200\r
ModemConnect    CONNECT\s4800\r
ModemConnect    CONNECT\s2400\r
ModemConnect    CONNECT\r
ModemError	BUSY
ModemError	NO\sCARRIER
ModemError	NO\sDIAL
ModemError	RING\r
ModemError	ERROR

# Timeouts to wait for "OK" and "CONNECT", cannot be prefixed by logical
# expression.
TimeoutReset	3
TimeoutConnect	30

# Delay in seconds before every call in "automatic" mode.  Ignored
# if explicit list of addresses specified in the command string.
DialDelay       0

# Call options (time, address and nodelist flag dependant) All matching are 
# applied in the order they are specified. Possible options are "[No]Call", 
# "[No]Hold", "[No]PUA", "[No]EMSI", "[No]WaZOO", "[No]Freqs", "[No]Zmodem",
# "[No]ZedZap", "[No]Janus", "[No]Hydra". Here, WaZOO stands for YooHoo/2U2 
# handshake, not for the transfer scheme. FTS-0001 handshake and DietIFNA 
# scheme cannot be disallowed (because they are mandatory by standart). "Hold"
# means really hold "hold" type packets and files: do not send them if our 
# system initiated the session, "NoHold" means  send "hold" packets when our 
# system initiated the session. "NoPUA" stands for "No PickUp All", i.e. PUP
# ("Pick Up Primary").  NoCall means do not perform outbound call.  This flag 
# has no effect on the nodes explicitly specified in the command line.
# Default options are "everything allowed".
#options	((!CM) & time Any0700-0200) Nocall
#options	(time Any0900-2100 & ! address 2:5020/*) Nocall
options	(time Any0001-2359) Call NoHold PUA EMSI WaZOO Zmodem ZedZap TCP   

# EMSI data for this node. From this line on values CANNOT be prefixed with 
# logical expression. For now, escaping of '}' and ']' unimplemented, try to 
# avoid these characters please!. 
Name		OB Surf Net at Ocean Beach BBS		
Location	Surfing on a huge wave
SysOp		Greg Frydenlund
Phone		415-681-8178
Speed		28800
Flags		XA,V32B,V42B


3.3 ifmail Areas

Now you need to define your fido echomail areas. You will find an example 
in /etc/ifmail/misc/areas. Copy it to /etc/ifmail or where ever you defined 
in /etc/ifmail/CONFIG and adjust it to your systems echomail feed.

# Conversion of areatags to newsgroups (with distribution) and back.
# All the Area tags most be in upper case (no exceptions).
#
# Area tags		Newsgroup		Distribution

C_ECHO			fido.C_ECHO		fido
C_PLUSPLUS		fido.C_PLUSPLUS		fido
NET_DEV			fido.FIDONET_DEV	fido
FTP_FIDO		fido.FTP_FIDO		fido
FTSC_PUBLIC		fido.FTSC_PUBLIC	fido
LINUX			fido.LINUX		fido
NET_125			fido.NET_125		fido
OFFLINE			fido.OFFLINE		fido
PASCAL			fido.PASCAL		fido
PERL			fido.PERL		fido
UFGATE			fido.UFGATE		fido
UNIX			fido.UNIX		fido
HAWAII			surf.HAWAII		surf
SO.CALIF		surf.SO.CALIF		surf
C_PROG			prog.C_PROG		prog
CPLUSPLUS		prog.CPLUSPLUS		prog
PASCALPROG		prog.PASCALPROG		prog
DELPHI			prog.DELPHI		prog


# Line with a single '*' in the "AREA" field defines default newsgroup
# and distribution.  '*' in the "newsgroup" field, if present, is expanded
# to the original areatag (converted to lowcase).

*			junk.*			local

# Line with a single '*' in the "newsgroup" field defines default areatag.
# '*' in the "AREA" field, if present, is expanded to the original
# newsgroup (converted to uppercase).  (Distribution is insignificant).

BAD.*			*

# You can specify a line with a single asterisk in the "AREA" field and
# a single asterisk in the "newsgroup" field.  It will cause a reversible
# conversion - areatag will be an uppercased newsgroup, and a newsgroup 
# will be a lowercased areatag.  This is not recommended.

# *			*			world


3.4 ifmail logging

To get the log-messages of ifcico you should configure syslogd correctly.  
Therefore you have to edit /etc/syslog.config. The messages of ifcico will 
appear as local0.*. For this, I added in the following line:

local0.*        /var/log/ifmail

(Attention: Use NO spaces,  only TABS between strings) 

By doing this all log-messages from ifcico go to /var/log/ifmail. If using an 
contemporary version of syslogd you would type :

killall -1 syslogd

That should inform the daemon that there is a new config file, with older 
syslogds you may need to completely restarted it.

Now we have to create the ifmail subdirectories in /var/spool/ifmail. Besides 
the standard /outd/ for Fido you will have to create directorys for any 
other nets. The owner of these directories should be fnet.uucp and should have
the permissions 775. ifcico can create directories for missing nets too, but 
you will have to adjust the permissions yourself.

You'll also need to add the user fnet to your /etc/passwd file. The user fnet 
is used as the owner of all the ifmail executables. You'll see later that this
will come in handy when setting up a crontab for polling uplinks or scheduled 
nodelist maintance and unpacking incoming arcmail pkts.  
Here is what my /etc/passwd file says:

fnet:*:15:14::/etc/ifmail:/bin/bash
or
fnet:*:15:14::/etc/ifmail:

There is much debate as to why you would not need a shell. For security 
reasons of course, you would not want a user arbitrary gaining access to 
the accout and using ifpoll to call another node in a zone outside your own.
 
However, if you don't have users or your user's can be trusted than there
nothing wrong with having a shell. You may want to su to fnet occasionally
and run ifpoll manually. I think one needs to choose what's best for his own 
system. 


3.5 Nodelist-Compiler

All nodelists in the config-file should be in the directory 
/var/spool/ifmail/nodelist. Then one calls ifindex, which then creates 
index.dir and index.pag, which contain the compiled nodelist.

ifindex is extreamly slow by nature. One of the ways to speed up the process 
is to shorten the nodelist down to what you need (your zone for example) 
before running ifindex.
 
You can use the following script, but you'll probably want to modify the 
script to suit your systems needs before using it. 

#!/bin/sh
#
# /var/spool/ifmail/nodelist/strip.nodelist 
#
if [ ! $1 ]
then
    echo Syntax Error!
    echo Start with $0 xxx, whereas xxx is the number of the latest
    echo nodelist.
    exit
fi

NODELIST=NODELIST.$1

if [ ! -s $NODELIST ]
then
    echo $NODELIST is not a correct nodelist
    exit
fi

NLSHORT=nl_short.$1

if [ -s $NLSHORT ]
then
    echo $NLSHORT already exists, moving to $NLSHORT.bak 
    mv -f $NLSHORT $NLSHORT.bak
fi

head -n 2 $NODELIST >> $NLSHORT
grep ',1-[0-9][0-9][0-9]-\|^Zone,1' $NODELIST >> $NLSHORT

echo Done.

You have to start this script with strip.nodelist xxx, where xxx stands for 
the number of the latest nodelist. The script generates nl_short.xxx from 
nodelist.xxx. Don't forget to substitute this nodelist name for the other
in your ifmail config file.

And what about the diffs? Since ifmail-2.6 there is a the program nlpatch
included with the package, which you call with the old nodelist and apply 
the latest diff, e.g.:

        nlpatch NODELIST.123 NODEDIFF.130

By doing this the nodelist of day 130 is created.

For appling the weekly nodediffs I use the script 
/etc/ifmail/misc/getnodelist. I copied it into my /usr/lib/ifmail as 
owner fnet.uucp with file permission 764. I call it once a week from my 
crontab as user fnet. You may need to modify the script to suit your systems
needs. 

#!/bin/sh
# Check and see if we got a fresh nodediff, unpack and apply it and rebuild 
# the index.

INB=/var/spool/ifmail/inbound
NLDIR=/var/spool/ifmail/nodelist
UNPACKER="/usr/bin/unzip -o"
PATCHER=/usr/lib/ifmail/nlpatch
INDEXER=/usr/lib/ifmail/ifindex
NDMASK='nodediff*'
NLMASK='NODELIST*'

if cd ${INB} ; then
	DIFF=`ls ${NDMASK}`
	if [ ! -f ${NDMASK} ] ; then
		echo No diff file
		exit 0
	fi
else
	echo Cannot chdir to ${INB}
	exit 1
fi

echo Processing ${DIFF}

if cd ${NLDIR} ; then
	if cp ${INB}/${DIFF} . ; then
		rm -f ${INB}/${DIFF}
	else
		echo Cannot copy ${INB}/${DIFF} to ${NLDIR}
		exit 1
	fi
else
	echo Cannot chdir to ${NLDIR}
	exit 1
fi

if ${UNPACKER} ${DIFF} ; then
	rm -f ${DIFF}
	DIFF=`ls ${NDMASK}`
else
	echo Could not unpack ${DIFF}
	exit 1
fi

if [ ! -f ${DIFF} ] ; then
	echo Nodediff was unpacked to unknown name
	exit 1
fi

NLIST=`ls ${NLMASK}`


if [ ! -f ${NLIST} ] ; then
	echo Nodediff was unpacked to unknown name
	exit 1
fi

echo applying ${DIFF} to ${NLIST}

if ${PATCHER} ${NLIST} ${DIFF} ; then
	rm -f ${NLIST} ${DIFF}
	exec ${INDEXER}
else
	echo Error compiling new nodelist
	exit 1
fi


3.6 ifmail Packets

ifmail creates packets similiar to Binkly, that is it uses the same
naming convention as Binkly. For example, here are the three pkts 
extentions used by ifmail and Binkly.

..hlo         =   pkt is on hold
..flo         =   pkt is ready for delivery
..clo         =   pkt is crash 
 
ifmail will store these pkts in subdirectories it creates using a
combinaton of your net/node and the pkts destiation net/node. 


3.7 Polling and Unpacking

For polling I use the script /etc/ifmail/misc/contrib/ifpoll with a 
few small changes, I call the script from a crontab owned by user fnet 
every night to poll my fidonet hub.   

#!/bin/sh
# ver 0.7
# ifpoll, poll my boss node or the node given as argument 1
#
# i start this shell script every day by crond, but you can
# start it also by hand :) start it as the owner of ifcico.
# rasca, berlin 1993 (Rasca Gmelch, 2:2410/305.4)
#

# where "ifcico" and "ifpack" reside
FIDOPATH=/usr/lib/ifmail

# logfile of ifcico
IFLOG=/var/log/messages

# owner of "ifcico"
IFCICO_OWNER=fnet

# sysop of fido stuff
IFCICO_SYSOP=postmaster

# my boss node (default address to poll)
NODE="f33.n125.z1.fidonet.org"

# how often should i try to call NODE?
MaxTry=2

# delay between outgoing calls in seconds
DELAY=10

# where to log processing - file or tty/console
INFO_TTY=/dev/tty1


echo "`date \"+%b %d %T\"` ifpoll[$$]: starting"  

# remember me, not to run as root..
#
if [ `whoami` != "$IFCICO_OWNER" ]; then
	echo "*** run $0 as the owner of ifcico ***"
	echo "`date \"+%b %d %T\"` ifpoll[$$]: wrong uid (rc 2)"
	exit 2
fi

# argv[1] is the optional node to call
#
if [ "$1" != "" ]; then
	if [ "$1" = "-?" ] || [ "$1" = "-h" ]; then
		echo "usage: ifpoll []"
		exit 3
	else
		NODE=$1
	fi
fi

# let's pack the fido stuff..
#
$FIDOPATH/ifpack -f

# loop until ifcico could connect the node or MaxTry is encountered
#
i=1; errlv=1
while let 'i <= MaxTry' && let 'errlv != 0'
do
	echo -n "`date \"+%b %d %T\"` ifpoll[$$]: $i. try ($NODE) " 
	#
	# start ifcico in master mode ..
	#
	chmod 664 /dev/ttyS1
        $FIDOPATH/ifcico -r1 $NODE
	errlv=$?
	if [ $errlv != "0" ]; then
		echo "failed :( "
		if [ $i != $MaxTry ]; then
			sleep $DELAY
		fi
		let i=i+1
	else
		echo "ok :)" 
	fi
done

# if the poll was fine, unpacking..
#
if [ $errlv = "0" ]; then
	echo "`date \"+%b %d %T\"` ifpoll[$$]: unpacking.. "
	$FIDOPATH/ifunpack
	# add here some additional lines for processing tic files or
	# incoming file-lists or simular..
else
        # write me a mail about the failed poll
        echo "`date \"+%b %d %T\"` ifpoll[$$]: Failed :(" 
        echo "`date \"+%b %d %T\"` ifpoll[$$]: Sending message :(" 
	# I changed this because mailx is defacto for most unix systems 
	tail --lines=20 $IFLOG | mailx -s "ifpoll: failed" $IFCICO_SYSOP > /dev/null
fi

echo "`date \"+%b %d %T\"` ifpoll[$$]: finished (rc $errlv)"

# return the errorlevel of ifcico
exit $errlv

This script can be used with a node number on the command line or not.
Whenever passing a node on the command line follow this format 
(ifpoll pfnz, e.g. ifpoll f710.n125.z1). If the node number is omitted 
then it will automatically call the node hard coded in the script. But 
before calling any node the script first packs up any netmail/echomail 
waiting for delivery. Upon a successful connection ifcico will receive/send 
any pkts destine to/from that node. Any newly arrived arcmail pkts will 
be unpack. Just by chance there was a problem during a connection. The 
last 20 lines from the /var/log/syslog file will be mailed to the owner. 
Reveiwing the log after an error occured might help to determine what may 
of caused the problem in the first place. (e.g. BUSY signal, call timed out,
etc.) Of course you may want to adjust this script to suit your own systems
needs (it may not be suitiable for everybody, etc.)

For unpacking incoming mail I run this script called ifmailcheck in a crontab 
as user fnet. It looks in /var/spool/ifmail/inb for ftn arcmail packets and 
calls ifunpack if any pkts exsist.

#!/bin/sh
# ifmailcheck, I call this script every hour
#
if (test -r /var/spool/ifmail/inbound/*.pkt)
   then 
   /usr/lib/ifmail/ifunpack
fi


3.8 ifmail crontab

Here is the crontab I use as user fnet. You can modify it to suit your systems
needs. If your unfamiliar with crontabs syntax or how to edit one try 
'man crontab' for additonal explaination on how to use, create and edit a 
crontab. 

SHELL=/bin/sh
MAILTO=fnet
#=========================================================================
# ifmail crontab:
#=========================================================================
#
# Call my hub at 4:30 am for daily fido exchange
#
30 4 * * *		/usr/lib/ifmail/ifpoll
#
# Check every hour for incoming pkts
#
59 * * * *		/usr/lib/ifmail/ifmailcheck
#
# Check monday morning for new nodediff and apply it to the nodelist 
#
30 2 * * mon 		/usr/lib/ifmail/getnodelist


For additional information on ifmail look at /etc/ifmail/ifcico/README,
for that matter you should read the man pages for ifmail as well.
man ifmail
man iftoss