IFMAIL-HOWTO Greg Frydenlund, fidonet 1:125/710 Revision: 1.1 Date: 08/05/1997 8:05:19 This document attemps to describe HOWTO configure, install and use ifmail as a fidonet/internet gateway and sendmail as the mail transport agent and INN as the news transport agent under Linux. _Introduction_ ifmail has gained enormous popularity over the past few years as fidonet sysops are switching from the traditional DOS ftn mailers and internet gateway programs to a native UNIX ftn<->rfc mailer implementation. As the increasing number of sysops switch they find themselves in uncharted territory due to the complexity of unix. This HOWTO will help clear up any misunderstanding by illustrating howto successfully administer a unix rfc<->ftn mailer using a combination of ifmail, sendmail and INN. _Feedback_ Any feedback can greatly improve the accuracy of this document. Most of the source in this HOWTO was donated by other people, however the bulk of the examples come from my own system. I am always open to suggestions, weither constructive or not. However, all flames will go to /dev/null, as I am too busy to get into a flame war. If you find this document handy and helpful in explaining the different techniques then please by all means send me a netmail describing your experience using it. _Disclaimer_ As usual any errors that remain are my own. This document is meant as a introduction to ifmail and is in no means intented as a guide to setting up a full flegged internet news server or for that matter, a complete e-mail system. Furthermore, it is not my intention to address all of the sendmail rewite rules, so I strongly recommand that before attempting to install ifmail you first read up on these topics. _Additional Information_ Mail-HOWTO/ for information on configuration your mail services. News-HOWTO/ for information on configuring your news services. For INN the INN-FAQ are indispensable, as it not only answers most questions, but also accompanies the installation like a HOWTO. Serial-HOWTO/ for information on configuration your serial device. NET-2-HOWTO/ for the configuration of the loopback-net Network-Admin-Guide/ for the configuration of network-components, and UUCP. UUCP-HOWTO/ for information on configuring a UUCP host. Managing UUCP and Usenet from O'Reilly & Associates. _Where to get the latest version of this HOWTO_ If you have an extreamly old version of this HOWTO you should request the latest version from Greg Frydenlund (1:125/710 V32B) with the filename ifmail-howto.gz. It is also available from the WWW at http://www.z2.fidonet.org/ifmail-tx/ifmail-howto.html or via FTP at ftp://ftp.z2.fidonet.org/pub/linux/Fido/ifmail-howto.gz _Programs you are going to need_ -ifmail-2.11- ifmail is a rfc<->ftn and ftn<->rfc transport package that works in conjuction with a news transport agent and mail transport agent. It doesn't wait actively, but instead is invoked by a getty. It is very similiar to uucico from UUCP. Version 2.11 is the latest release as of this writing. ifmail is developed by: Eugene G. Crosser (crosser@average.org or 2:5020/230). To obtain the latest version check out : ftp://ftp.average.org/pub/ifmail ftp://tsx-11.mit.edu/pub/linux/sources/usr.bin/ ftp://sunsite.unc.edu/pub/Linux/system/Fido/ or at any sunsite mirror site. -ifmail-2.10-tx8.4- The tx versions have some improvements over the original, like charset support, MIME quoted printable support, better MSGID management, reference handling and some PGP recognition. Also the ability to handle Gatebau-style MSGID<->Message-ID conversion. The tx version is maintained by: Pablo Saratxaga (srtxg@chanae.alphanet.ch or 2:293/2219 or 4:850/1.29) To obtain the lastest version check out : ftp://ftp.z2.fidonet.org/pub/linux/Fido/ and most sunsite mirrors. _Mail-Transport-Agent (MTA)_ Here one has the choice between smail and sendmail V8. Smail is the smaller and simpler package to configure, but it has some small bugs. sendmail V8 is not very easy to configure, but there is a configuration with the macro-processor M4, which simplifies the configuration enormously, so configuring sendmail should be as simple as smail. I myself changed from smail to sendmail. -smail- As the old version 3.1.28.1 of smail had a bug in the uuname-driver (which is only important when using UUCP) I used version 3.1.29.1 from ftp://sunsite.unc.edu/pub/Linux/system/Mail/delivery/ smail-linuxbin-3.1.29.1.tar.gz. Slackware now contains sendmail instead of smail, so it shouldn't be too difficult to get rid of smail. -sendmail V8- The Slackware version of sendmail V8 is 8.8.3, and there shouldn't be any problems with using versions greater than 8.8.3. Version 8.8.3 has a number of security-gaps, but this is only important if the computer is connected to the Internet, in which case I suggest using the lastest release. One can obtain the latest version of sendmail from ftp://ftp.CS.Berkeley.EDU/ucb/src/sendmail/, but as I already mentioned it's also part of the Slackware-Distribution. It's very important to install the complete configuration files, which are hidden in a package with the confusing name smailcfg.tgz. _News-Transport-Agent_ As for News-Transport-Agent one can use cnews as well as INN. To help you choose one of them, here are some of the pros and cons of both programs: cnews consists mostly of shell-scripts, which can't be debugged very easily and run rather slow. Cnews can't use NNTP (online-news-protocol). If you want to use NNTP. (e.g. for various newsreaders, which can only communicate with the news system via NNTP), you need a nntpd. Configuring a nntpd is quite difficult and doesn't always support all the capabilities of NNTP. INN supports NNTP natively. That's why there is always a daemon (innd) running who makes sure that the local news-articles are immediately readable to all users. Using cnews the articles are imported only after a specified time (e.g. every 10 minutes) to the news system. cnews will cause problems, if there is less than 10 MB free space in /var/spool/news. I myself am using INN-1.5.1, because INN is considerably easier to configure than cnews. -cnews- As older Slackware-Distributions came with a cnews that was extremly crippled (e.g. all man-pages were missing), one should use at least the cnews package from Slackware 2.1. As an alternative, one can get a hold of the complete source-distribution and compile it themselfs. I used the performance-release from 93/02/20 from ftp://ftp.uu.net/news/. By now there are newer releases, but I haven't tried them yet. I will refer in this HOWTO to the older version and I don't plan to update this certain part in the future. -INN- (InterNet News server) The latest Slackware-Distribution contains cnews as well as INN, so now everyone has a choice. The current INN should work, but I prefer to compile and configure software myself, so I am using the source from INN-1.5.1, which can be obtained from : ftp://sunsite.unc.edu/pub/Linux/system/News/inn1.5.1-linux-src.tgz. _Serial line monitor_ -mgetty-sendfax- mgetty-sendfax is a collection of programs designed to monitor, send and receive calls and faxs on a UNIX system. Unlike a getty or uugetty which puts the modem into "answer-mode", mgetty does not. When an incoming call occurs, mgetty sees the "RING"s and tells the modem to answer. When the modem answers it tells mgetty what kind of connection happens. mgetty-sendfax documentation and FAQ can be found at http://www.leo.org/~doering/mgetty/index.html. The source can be obtained from most sunsite mirrors in /system/Serial/mgetty+sendfax-0.98.tar.gz. -getty_ps- uugetty manages the first step of the login process on a UNIX system. When used with a modem it watches for incoming calls and (ordinarily) prints the "login:" prompt and (reads the username and passes it off to "/bin/login"). The source for getty_ps can be obtained from most sunsite mirrors in /system/Serial/getty_ps-2.0.7i.tar.gz. _Newsreader_ One can use any newsreader, e.g. tin, nn, trn, xvnews, xrn, slrn, knews,.. If one uses cnews, it should have a UUCP-mode, i.e. not only NNTP, otherwise one has to install the nntpd, which is quite difficult without any documentation. I suggest using tin-1.3BETA.950824-color, because tin is easy to use and requires minimal work to configure. I've included some tips on using tin later in the document. _Mailreader_ Here again you can use what you wish: elm, pine, mail, xmail, xmailtool, xfmail,...Pine seems to be the reader of choice, but you may perfer another. _Packers_ Some packers come with the distributions. If special packers are missing one can always obtain them from various servers like ftp://sunsite.unc.edu/pub/Linux/utils/compress/ which have a packer-directory: -ZIP- unzip51 can unpack the new ZIP-format, too. There is now a zip, which can pack the new format. -ARJ- unarj241 unpacks ARJ-archives, but there's no packer for Linux. -LZH- lha exist as a Linux-port, too. -ARC- Old, but very important packer, as nodelists are packed with arc. There is at least one Linux-port. -RAR- unrar101 unpacks RAR-archives, I haven't found a RAR-packer, yet. One can obtain the sources to unrar at: ftp://ftp.kiae.su/.2/unix/arcers/unrar101.tgz _TIC-processor_ There are some small TIC-processors, which was written in PERL. Especially tic010b.tgz (also known as lt010b.tgz) by Cees de Groot (cg@bofh.lake.de, 241:10000/1512) can be mentioned. This program is part of the ifmail-package since version 2.8a and can be found in the directory ifmail/misc/contrib/tic. There's another TIC-processor that's at ftp://ddt.demos.su/pub/u-tic/utic. UTIC Stands for Unix-TIC processor and is written by Yar Tikhiy (yar@comp.chem.msu.su) _Permissions_ The permissions for the files are a little tricky, especially with the implementation of INN and sendmail. For security reasons INN's binaries are sticklers when it comes to file permissions, so you should never execute them unless your the user news. For this reason, you should now look, and make sure the users news and uucp exist in your users file. Here is what my /etc/passwd file says: news:*:9:13::/usr/lib/news:/bin/bash uucp:*:10:14::/var/spool/uucppublic:/bin/bash Furthermore, the groups uucp and news must exist. It is very important that you insert the users news, mail, root and fnet into the group uucp, so sendmail can SUID to execute ifmail for netmail routing and processing. It seems equally important to add the user uucp to the group news. Here is what my /etc/group file says: news::13:news,uucp uucp::14:uucp,news,mail,root,fnet Also, all spool-files should be group writeable. We will discuss this later, but for now you just need to be aware of it. _Example configurations_ As for examples, most of the one's I am using come from my own system, they are all based on recent releases, I am running Linux kernel 2.0.30, ifmail-2.10-tx8.3, INN-1.5.1 and sendmail-8.8.5. My Fidonet address is 1:125/710 and my hubs are 1:125/33 and 1:125/5109. You will need to substitute yours for mine wherever you see them. I use two crontabs, one for user fnet and the other for user news. I accept calls 24/7 and I poll my uplink on a nightly basis. At present, I have no UUCP feed...:( Please note that since everyones setup is likely to be a bit different, as each linux distribution can vary from system to system because distributers sometimes make minor inhancesments to implement the software for a paticular system, I have tried to include the obvious, but you should refer to your own systems references if the examples do not work as shown. If you don't have an Internet gate yet, you should search for one, because ifmail supports this execellently and assumes that you have an UUCP uplink or at least a connection to a gate. Please note: Do not use my addresses when testing your configuration. Use your own, otherwise I will get the answers to your questions. _Compiling & Installing ifmail_ First, you'll want to unpack your ifmail archive. I have 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 the correct directory. Second, you'll want to edit the global compiler-configuration-file /etc/ifmail/CONFIG. I've ommitted their explanations for breifity. _ifmail CONFIG_ CONFIGFILE = "/etc/ifmail/config" DEBUGFILE = "/var/log/ifmail/ifdebug" LOGFILE = "/var/log/ifmail/iflog" MAILLOG = LOG_LOCAL0 NEWSLOG = LOG_LOCAL0 CICOLOG = LOG_LOCAL0 LOCKDIR = "/var/spool/uucp" PUBDIR = "/var/spool/uucppublic" NEWSSPOOL = "/var/spool/news" GEN_OPTS = -DDONT_REGATE -DSLAVE_SENDS_NAK_TOO \ -DRNEWSB -DRESTAMP_OLD_POSTINGS=25 -DBELEIVE_ZFIN=1 \ -DKEEP_MSGID_ON_SPLIT -DIGNORE_SOFTCR -DREFERENCES_MSC96 \ -DRELAXED -DFORCEINTL -DHAS_TCP -DAREAS_HACKING \ -DRESTAMP_FUTURE_POSTINGS -DFSCHTML -DMACHIGAI \ -DALLOW_RETURNPATH -DKEEP_TEARLINES_CLEAN # -DFORCE_REPLYTO -DTERMAIL_HACK # -DGATEBAU_MSGID -DPUDDLE_GATE -DPCBOARD_GATE -DJE # -DALLOW_CONTROL -DIRTY_CHRS -DPARANOID -DNEED_UUCPFROM # Linux: 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 \ -DREGEX_NEED_CARET -DNEED_FORK -DNEED_TRAP \ ${GEN_OPTS} BINDIR = /usr/lib/ifmail OWNER = fnet GROUP = uucp MODE = 0711 SMODE = 4710 Maybe you'll want to change the paths to reflect your own system. By doing this you can place the debug-file into /tmp directory and have the logfile placed in /var/log/ifmail, which ever you choose, it doesn't really matter, because ever since ifmail 2.3 the logfile is 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/spool/uucppublic 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. _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") 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. # 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 US-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 -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 _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 said 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 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 _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 /outbound/ 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. _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. As a matter of fact ifindex is not very quick, so if you what to shorten the nodelist to what you need (your zone for example) before the compilation. 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. 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 _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. _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 started without any parameters and then automatically calls my hub, or you can start it with the node you want to call (in pfnz -format, e.g. ifpoll f26.n9996.z96). It will first pack up any netmail/echomail before calling a node. After a successful connection it will try to unpack any newly arrived arcmail packets. If there was a problem with the connection the user fnet will be sent the last 20 lines of the /var/log/syslog file, so you can make a determination as to what may of caused the problem (e.g. BUSY signal, call timed out, etc.) Of course one has to adjust this script to suit their 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 _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 _Configuration of sendmail V8_ If you have installed sendmail, you should install the whole set of configuration files which in the Slackware distribution is hidden in the package smailcnf.tgz. You'll find them in your directory-tree in /usr/src/sendmail/cf. In this directory there should be a approx. 50KB big README which describes the new configuration-method. Though sendmail is controlled via an almost 20KB big configuration file (/etc/sendmail.cf) you don't have to write it on your own (which most of the people think, who are scared of sendmail). You only need the macro processor M4, and a little configuration file (mc-File) in /usr/src/sendmail/cf/cf. M4 will create your /etc/sendmail.cf from this file and a lot of other config files, which you do not need to change. Here is an explanation of what "F=8mDMFhuSC, S=52/31, R=21" means in your sendmail.cf's fidonet delivery agent definition: The F section contains the flags which describe a delivery agent's behavior. Here is a breakdown of what your flags mean: 8 = use 8 bit m = allow delivery to multiple recipients D = force inclusion of date information in mail header M = force inclusion of message identification information in mail header F = force inclusion of sender (From) information in mail header h = preserve case in hostname u = preserve case for username The C flag causes sendmail to append a domain to recipients without one (the domain of the sender. Useful when sending to someone on your own BBS); and the S flag causes sendmail to invoke the delivery agent (in this case ifmail) with the user and group id specified by the U= equate. If the U= equate is missing or 0 sendmail runs the delivery agent as root (note: in sendmail versions prior to v8.7, there was no U= equate, so the S flag causes sendmail to always run the delivery agent as root). I don't have a U= equate, so ifmail runs as root which seems to be fine for me. The S section specifies the Sender rewriting rule set, with rule 51 being used for the envelope and rule 31 used for the header. Finally the R section specifies the Recipient rewriting rule set. In this case rule set 21 is used for rewriting both headers and the envelope. Look around in your sendmail.cf file to find these rules and see what they do. By the way, this information comes from the book "sendmail, 2nd edition" by Bryan Costales and Eric Allman (who is the author of sendmail) published by O'Reilly & Associates (ISBN 1-56592-222-0). I strongly recommend it to anyone who is working with sendmail. It is very thourough and well written, with many examples. Next IFMAIL has to be made known. Therefore you need to create the file /usr/src/sendmail/cf/mailer/ftn.m4 with the following content: # /usr/src/sendmail/cf/mailer/ftn.m4 # # IFMAIL FTN mailer for sendmail V8 # # MAILER(smtp) and MAILER(uucp) must be included! # PUSHDIVERT(-1) ifdef(`FTN_MAILER_PATH',, `define(`FTN_MAILER_PATH', /usr/lib/ifmail/ifmail)') ifdef(`FTN_MAILER_USER',, `define(`FTN_MAILER_USER', `fnet:uucp')') ifdef(`FTN_MAILER_ARGS',, `define(`FTN_MAILER_ARGS', `ifmail -r $h $u')') ifdef(`FTN_MAILER_FLAGS',, `define(`FTN_MAILER_FLAGS', `8mDFMuSC')') ifdef(`FTN_MAX_SIZE',, `define(`FTN_MAX_SIZE', 100000)') POPDIVERT ##################################### ### FTN Mailer specification ### ##################################### VERSIONID(`ftn.m4 V1.5') ifdef(`_MAILER_smtp_', '# ifmail mailer Mftn, P=FTN_MAILER_PATH, F=FTN_MAILER_FLAGS, S=11, R=21, _OPTIONS(`UUCP_MAILER_CHARSET',`C=', `, ')U=FTN_MAILER_USER, ifdef(`_FTN_MAILER_MAX', `M=FTN_MAILER_MAX, ')A=FTN_MAILER_ARGS') As one can see the configuration for using ifmail isn't that complex, and we don't have to care about what is exactly happening, we simply use the defined mailer "ftn" like the predefined mailers "smtp", "uucp" etc. Now let's go on with the configuration of the mc-file. I called it /mymachine.mc, but the name isn't that relevant, it is only necessary that it resides in /usr/src/sendmail/cf/cf. mymachine.mc looks like this: # /usr/src/sendmail/cf/cf/mymachine.mc # # sendmail V8 configuration for mymachine.mc # using UUCP and IFMAIL # include(`../m4/cf.m4') VERSIONID(`mymachine.mc V1.15') OSTYPE(linux)dnl define(`confUSE_ERRORS_TO', `True')dnl define(`confCOPY_ERRORS_TO', `postmaster')dnl define(`confMIME_FORMAT_ERRORS', `False')dnl FEATURE(notsticky)dnl FEATURE(mailertable,hash -o /etc/sendmail/mailertable)dnl FEATURE(always_add_domain)dnl FEATURE(nodns)dnl FEATURE(nocanonify)dnl MAILER(local)dnl MAILER(ftn)dnl MAILER(smtp)dnl MAILER(uucp)dnl #Cwsome-uucp-host-name Cwf4.n211.z21.prognet Cwf64.n9996.z69.surfnet Cwf710.n125.z1.fidonet.org # define(`SMART_HOST', uucp-dom:some-uucp-host-name) define(`SMART_HOST', ftn:f710.n125.z1.fidonet.org) LOCAL_RULE_3 # Route fidonet.org, prognet and surfnet via FTN! R$* < $* z1.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z2.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z3.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z4.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z5.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z6.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* prognet > $* $1 < $2 f1.n211.z21.prognet > $3 R$* < $* surfnet > $* $1 < $2 f60.n9991.z96.surfnet > $3 At the beginning the operating system (linux) is defined, then we define that all MAILERDAEMON-mails are also sent to postmaster, thus one can find errors faster and fix them. Then some options for my configuration are given, but you can overtake them for your needs. Furthermore the mailers "local" (for mail to user of the same computer, which are delivered by deliver, mail.local or procmail), "ftn" (Fido-compatible nets via ifmail), "smtp" (transport via the online-mail-protocol SMTP) and "uucp" (transport via UUCP) are defined. The latter two ones aren't necessary for a system that is only connected with ifmail to the Internet, but the mailer "ftn" is based on them (that's why ftn.m4 is so short). In the lines beginning with Cw various names of my computer are defined by: define(`SMART_HOST', ftn:f33.n125.z1.fidonet.org) all mail that wasn't transported otherwise will be send via ifmail to my fido-uplink. If you have an UUCP-uplink you can replace these lines with define(`SMART_HOST', uucp-dom:some-uucp-host-name) which sends all other mails to my UUCP-uplink some-uucp-host-name. At the end of mymachine.mc I've built in a special gimmick: LOCAL_RULE_3 # Route fidonet.org and prognet via FTN! R$* < $* z1.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z2.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z3.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z4.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z5.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* z6.fidonet.org > $* $1 < $2 f33.n125.z1.fidonet.org > $3 R$* < $* prognet > $* $1 < $2 f1.n211.z21.prognet > $3 R$* < $* surfnet > $* $1 < $2 f60.n9991.z96.surfnet > $3 Here z1.fidonet.org thru z6.fidonet.org is mapped into f33.n125.z1.fidonet.org and all *.prognet into f1.n221.z21.prognet, thus all Fido-mails addressd to the various Fidonet zones will be send to my uplinks, which is then send via FTP (instead of UUCP). Please note: There should be at least one TAB between $* and $1 (not just blanks). Therefore we need the above defined file /etc/sendmail/mailertable. In this file "exceptions" of the default routing are defined, e.g. the routing via Fido. .prognet ftn:f1.n211.z21.prognet .surfnet ftn:f60.n9991.z96.surfnet As one can see all Fido-mails are transported via ftn. This mailertable has to be compiled to a database after any change. Use the following command in the directory /etc/sendmail: makemap hash mailertable.db < mailertable If you get the error "makemap: Type hash not supported in this version", you seem to have installed Slackware 3.0, which doesn't support the hash-type (don't ask me why). Then you should use the alternative command: makemap dbm mailertable < mailertable in the same directory. But now you have to change the mailertable line in mymachine.mc from hash to dbm. Change this line to: FEATURE(mailertable,dbm -o /etc/sendmail/mailertable)dnl So your problems should go away. After mymachine.mc has been edited, we can create sendmail.cf from it. Go to the directory /usr/src/sendmail/cf/cf and execute pmake mymachine.cf there. By this /usr/src/sendmail/cf/cf/obj/mymachine.cf is created. Move this file to /etc/sendmail.cf and the configuration is ready. In the case pmake isn't installed run this instead: m4 mymachine.mc > obj/mymachine.cf There are a few other things you'll need to manually edit in the sendmail.cf file. First thing is to look for the O MatchGECOS option and uncomment it if it isn't already. This allows for use of full names like Greg Frydenlund instead of your login name like gfryde01. Next look for the trusted users section and add "Tfnet uucp". This will allow sendmail to SUID to fnet.uucp when executing ifmail. After doing all that your ready to create your mail alias-file. Mine looks something like this. Mail aliasing is just one of sendmails powerful features which allows forwarding of mail to other sites and users. Its not hard to adminaster. The mail sent to the person on the left is forwarded to the person on the right. Here's what my alias file looks like. # # /etc/aliases # # compile this file by issueing the command: newaliases # nobody: /dev/null root: gfryde01 support: gfryde01 admin: gfryde01 operator: gfryde01 postmaster: gfryde01 faxadmin: gfryde01 usenet: gfryde01 sysop: gfryde01 uucp: gfryde01 news: gfryde01 mail: gfryde01 fnet: gfryde01 fido: gfryde01 greg_frydenlund: gfryde01 greg.frydenlund: gfryde01 gregfrydenlund: gfryde01 This file has to be compiled with the command newaliases to a database after any changes. Now to start sendmail as a daemon by entering: /usr/sbin/sendmail -bd -q 15m Add the above line to /etc/rc.d/rc.local. On many systems it is already defined in /etc/rc.d/rc.M which is possible, too. Alternatively one can start sendmail by cron, and let inetd listen to the port. For this enter the following in the crontab of the user root: */20 * * * * /usr/sbin/sendmail -q and insert the following into your /etc/inetd.conf: smtp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/sendmail -bs Don't forget to kill -HUP inetd after changing inetd.conf, to inform inetd about your changes. sendmail will write its log messages via syslogd. I recommend to enter the following entry in /etc/syslog.conf: mail.* /var/log/mail Do not forget to restart syslogd after this change with a killall -1 as already described in Configuration of ifcico. To test sendmails rewrite rules for fidonet addresses, start sendmail with the following command. sendmail -bt Issue this command at the prompt and you should see something like this. > 3,0 me@f10.n125.z1.fidonet.org The last line in the list below is the one were interested in. rewrite: ruleset 3 input: me @ f10 . n125 . z1 . fidonet . org rewrite: ruleset 96 input: < me @ f10 . n125 . z1 . fidonet . org . > rewrite: ruleset 96 returns: < me @ f10 . n125 . z1 . fidonet . org . > rewrite: ruleset 3 returns: < me @ f10 . n125 . z1 . fidonet . org . > rewrite: ruleset 0 input: < me @ f10 . n125 . z1 . fidonet . org . > rewrite: ruleset 98 input: < me @ f10 . n125 . z1 . fidonet . org . > rewrite: ruleset 98 returns: < me @ f10 . n125 . z1 . fidonet . org . > rewrite: ruleset 0 returns: $# ftn $@ f33 . n125 . z1 $: me < @ f33 . n125 . z1 . fidonet . org > You can see at the bottom of this list that the mailer ftn is called which is exactly what we want. I suggest you try various address (me@localhost) to be sure that sendmail handles all the rewrite rules appropreiatly for your own system. _INN-Configuration_ First one has to install INN of course. Slackware comes with INN and installs it into /usr/lib/news.In addition, I suggest you look in the (Slackware only) /usr/lib/news/tools.linux directory for installation tips, scripts and faq. You may use either a preconfigured binary or a self-compiled one. I prefer to compiled my own and found an example-config.data for linux in the source. I had to reedit it bit so all the directory references match my Slackware locations (default was /use/local/...ick). So I suggest you consult your systems setup for the location of INN, otherwise you can do like I did and install it in the /usr/lib/news directory. INN runs as a daemon, so you don't need the nntp service defined in inetd.conf file. Comment out the line and don't forget to restart inetd with a kill -HUP inetd-PID after you make the changes. If your installing INN for the first time or from the source like I did then you will have to make some changes in /usr/lib/news and its subdirectories. I'll discuss the files to be configured one after another: First some smaller files: /usr/lib/news/passwd.nntp and /usr/lib/news/nntpsend.ctl should only contain comments and nothing else. You will also need to create the history files by executing the script /usr/lib/news/bin/makehistory as user news. /usr/lib/news/hosts.nntp contains only the following lines: ## hosts.nntp - names and addresses that feed us news ## Format ## : ## : ## can be a name or IP address; no wildcards. Any hosts not ## listed here are handed off to nnrpd. localhost: f710.n125.z1.fidonet.org: So only my own computer is allowed to access my NNTP-server. /usr/lib/news/nnrp.access should look like this: ## nnrp.access - access file for on-campus NNTP sites ## Format: ## :::: ## Connecting host must be found in this file; the last match found is ## used, so put defaults first. ## Wildcard name or IP address ## R to read; P to post ## Username for authentication before posting ## Password, for same reason ## Newsgroup patterns that can be read or not read ## To disable posting put a space in the and fields, since ## there is no way for client to enter one. ## ## Default is no access, no way to authentication, and no groups. *:: -no- : -no- :!* ## Foo, Incorporated, hosts have no password, can read anything. *:Read Post:::local.* localhost:Read Post:::* f710.n125.z1.fidonet.org:Read Post:::* So everybody has read and write access via NNRP (that's the protocol from which newsreader's communicate with the newsserver) to the newsgroups, whose name begins with local.*. They are not allowed to read any other newsgroups. On my own computer everybody has permission to read and write in every newsgroup. Next you have to configure /usr/lib/news/inn.conf like this: ## inn.conf -- inn configuration data ## Format: ## : ## Used by various programs and libinn. The following parameters are defined: ## domain Local domain, without leading period. ## fromhost What to put in the From line; default is FQDN ## of the local host. ## moderatormailer Where to mail moderated postings, if not found ## in the moderators file; see moderators(5). ## pathhost What to put in the Path and Xref headers; default ## is FQDN of the local host. ## organization If $ORGANIZATION doesn't exist. What to put in ## the Organization header if blank. ## server If $NNTPSERVER doesn't exist. Local NNTP server ## host to connect to. ## ## orginization line will be substituted for your origin line in echomail organization:-={OCEAN BEACH BBS....San Francisco, CA}=- server:localhost fromhost:f710.n125.z1.fidonet.org The most important file of the INN-configuration is /usr/lib/news/newsfeeds which defines, which newsgroups are exported to whom. ## newsfeeds - determine where Usenet articles get sent ## Format: ## site[/exclude,exclude...]\ ## :pattern,pattern...[/distrib,distrib...]\ ## :flag,flag...\ ## :param ## Summary of flags: ## .*\ :: overview\ :*:Tc.WO:/usr/lib/news/bin/overchan # # My Fido feed # f33.n125.z1.fidonet.org/f33.n125\ :fido.*,!fido.NET_125,!control*,!junk*,!local*\ :Tf,Wfb,B16384/1024: # # My nets admin hub # f5109.n125.z1.fidonet.org/f5109.n125\ :fido.NET_125,!fido.*,!local*,!junk*,!control\ :Tf,Wfb,B16384/1024: # # My othernets feeds # f1.n211.z21.prognet.ftn/f1.n211\ :prog.*,!fido.*,!local*,!junk*,!control\ :Tf,Wfb,B16384/1024: f60.n9991.z96.surfnet.ftn/f60.n9991\ :surfnet.*,!prog.*,!fido.*,!local*,!junk*,!control\ :Tf,Wfb,B16384/1024: Then you have to configure /usr/lib/news/expire.ctl, which defines when which newsgroups expire. ## expire.ctl - expire control file ## Format: ## /remember/: ## :::: ## First line gives history retention; other lines specify expiration ## for newsgroups. Must have a "*:A:..." line which is the default. ## wildmat-style patterns for the newsgroups ## Pick one of M U A -- modifies pattern to be only ## moderated, unmoderated, or all groups ## Mininum number of days to keep article ## Default number of days to keep the article ## Flush article after this many days ## , , and can be floating-point numbers or the ## word "never." Times are based on when received unless -p is used; ## see expire.8 ## If article expires before 14 days, we still remember it for 14 days in ## case we get offered it again. Depending on what you use for the innd ## -c flag and how paranoid you are about old news, you might want to ## make this 28, 30, etc. /remember/:30 # Keep all newsgroups minimal 3, maximal 90 and normaly 5 days (from arrival) *:A:3:5:90 *:U:3:5:90 # Keep moderated newsgroups a bit longer *:M:5:9:90 # Keep the moderated c.o.l.* 1 month. comp.os.linux.*:M:5:30:30 # Keep fido some longer as default. fido*:A:3:9:90 # Remove the junk very quick. fido.junk:A:3:4:90 Of course you may define this on your own needs. But you shouldn't decrease the default-times (especially for Fido) too much, as the messages take a long time to your system and so might expire immeadiately. Now you need to add some Fido echomail areas to your news active file. You can do this two ways, first by running the script /usr/lib/news/bin/newgroup or second by manually editing the /usr/lib/news/active file. I prefer the later. The format of a new newsgroups record in the active file is : <10 0's> <9 0's & 1> fido.LINUX 0000000000 0000000001 y fido.PASCAL 0000000000 0000000001 y Now copy the file etc/ifmail/misc/inn/send-ifmail to /usr/lib/news and change the owner to news.news. send-ifmail is called periodically from a crontab as user news to place the spooled articles in /var/spool/news/out.going into /var/spool/ifmail/outb for ifcico to deliver. To get the news exported, there must be a batch-directory for them, which is called /var/spool/news/out.going, with owner news.news and permission 775. In contrast to cnews there mustn't be any subdirectories in this directory for the newsfeeds, as INN uses only one file per feed which it creates itself. If you "upgrade" from cnews to INN, you should delete the existing directories. As INN works with a daemon, which always runs, it must be started in the boot-process. Add the following at the end of /etc/rc.d/rc.M before the call of rc.local: /usr/lib/news/etc/rc.news & For the first test of INN this script can be started manually (as user news). But be careful, that only one innd is running at the same time. Remember do not run any other program of INN's unless you su to user news. In some distributions another NNTP-daemon (nntpd) is defined for cnews in /etc/inetd.conf. Then innd can't be started, as the TCP-port is already busy. That's why you have to comment out this line and restart inetd with a kill -HUP inetd.PID. To make INN work properly you have to add the following to the crontab of the user news: SHELL=/bin/sh MAILTO=news #========================================================================= # INN crontab: #========================================================================= # # Offer spooled news batches to ifnews of outgoing echomail # 30 */3 * * * /usr/lib/news/send-ifmail f33.n125.z1.fidonet.org # Send spooled news to uucp uplink # #35 */3 * * * /usr/lib/news/send-uucp "uucp-feed-name" # Run news.daily every morning at 6am # 0 6 * * * /usr/lib/news/bin/news.daily < dev/null # offer spooled news (that was spooled into /news/in.coming directory when the # innd server wasn't available) again to the innd server. # 13,33,53 * * * * /usr/lib/news/rnews -U Every third hour at half past the hour, the batches for all Fido-systems and the UUCP-system are packed (without a UUCP-connection you can skip the last part of course). Furthermore there's a daily clean-up, which is reported via mail. Then all accidentally not-delivered articles will be processed. The next thing we've got to do is creating the newsgroups. Therefore and for almost all other changes in the news system only the command ctlinnd is used. It should be called only by the user news and you can find it in the directory /usr/lib/news/bin. New newsgroups are created with ctlinnd newgroup fido.LINUX (where fido.LINUX is only an example). You can use various options, which are explained in the manpage of ctlinnd(8). You should create the newsgroups control, junk and fido.junk, which contain the control-messages (e.g. cancel), articles for unknown newsgroups and articles for not in /etc/ifmail/areas defined areas. To find the descriptions of the newsgroups in the newsreader, you may want to create the file /usr/lib/news/newsgroups, which contains the name of a newsgroup and its description (seperated by a TAB) in every line. The order of the groups is irrelevant, from a duplicate line only the first one is shown. As INN reports his log-messages via syslog, one should make these changes in /etc/syslog.conf: news.crit /var/log/news/news.crit news.err /var/log/news/news.err news.notice /var/log/news/news.notice Furthermore create the directory /var/log/news, and restart your syslogd. For further information on INN, an upgrade from a cnews-system to INN, problems etc. please read the very informative INN-FAQ and the manpages. _gettys & inittab_ A getty is used to monitor the serial line and when a incomming call is detected it passes the caller on to the appropriate program. There are two getty's that work well with ifmail, getty_ps and mgetty+sendfax-0.98. I use mgetty+sendfax because it handles both uucp and fido callers besides the usual human caller. To use mgetty you will need to edit several of its config files, but the one that is most important is login-config.dist file. Here is what my /etc/mgetty-0.98/login-config.dist says: # login.config # # This is a sample "login dispatcher" configuration file for mgetty # # Format: # username userid utmp_entry login_program [arguments] # # Meaning: # for a "username" entered at mgettys login: prompt, call # "login_program" with [arguments], with the uid set to "userid", # and a USER_PROCESS utmp entry with ut_user = "utmp_entry" # # username may be prefixed / suffixed by "*" (wildcard) # # userid is a valid user name from /etc/passwd, or "-" to not set # a login user id and keep the uid/euid root (needed for /bin/login) # # utmp_entry is what will appear in the "who" listing. Use "-" to not # set an utmp entry (a must for /bin/login), use "@" to set it to the # username entered. Maximum length is 8 characters. # # login_program is the program that will be exec()ed, with the arguments # passed in [arguments]. A "@" in the arguments will be replaced with the # username entered. Warning: if no "@" is given, the login_program has # no way to know what user name the user entered. # # # SAMPLES: # Use this one with my Taylor-UUCP patch (taylor104.p1) and Taylor-UUCP # passwd files. (Big advantage: tuucp can use the same passwd file for # serial dial-in and tcp dial-in [uucico running as in.uucpd]). # #U* uucp @ /usr/lib/uucp/uucico -L @ # # If you use Taylor UUCP 1.05, use that: # U* uucp @ /usr/lib/uucp/uucico -l -u @ # # Use this one for fido calls (login name /FIDO/ is handled specially) # # You need Eugene Crosser's "ifmail" package for this to work. # mgetty has to be compiled with "-DFIDO" in the options list, otherwise a # fido call won't be detected. # /FIDO/ fnet uucp /usr/lib/ifmail/ifcico @ # # # An example where no login name in the argument list is desired: # automatically telnetting to machine "smarty" for a given login name # #telnet-smarty gast telnet /usr/bin/telnet -8 smarty # # This is the "standard" behaviour - *dont* set a userid or utmp # entry here, otherwise /bin/login will fail! # This entry isn't really necessary: if it's missing, the built-in # default will do exactly this. # * - - /bin/login @ If your using getty_ps don't forget to add #define FIDO in tune.h. You will also need to define a config file for the ttyS device your using. There are plenty of examples in /etc/default for uugetty and included in the archive. Here is what my /etc/default/uugetty.ttyS1 says: ALTLOCK=cua1 ALTLINE=cua1 INITLINE=cua1 TIMEOUT=60 DEBUG=110 INIT="" ATZS0=1\r OK # Its very important to include these two lines. Otherwise fido callers # will go undetected. Also some older versions of uugetty are case sensitive # so watch for this in the example configs that accompanied your archive. FIDO=/usr/lib/ifmail/ifcico EMSI=yes WAITFOR=RING CONNECT="" ATA\r CONNECT DELAY=1 HANGUP=yes Next you will need to add a line in your /etc/inittab file for your getty. Here is what my /etc/inittab file: # Serial lines # This is my mgetty line for com port 2 . s1:35:respawn:/usr/sbin/mgetty -D -s 38400 ttyS1 # # You can add this line instead to your inittab if your using uugetty #s1:35:respawn:/sbin/uugetty -d /etc/default/uugetty.ttyS1 -t 180 ttyS1 38400 The first string is a label for the device. The second is the runlevel at which the program will take action. The third 'respawn:' causes the program to be restart after it has terminated. The fourth is the path and name of the program to be executed and the rest of the line is the parameters needed to run the getty. For additional information try 'man inittab'. _News/Echomail reading and writing_ I myself prefer tin as my newsreader. I'm using tin-1.3BETA.950824-color. As tin, like all other newsreaders was not constructed for Fido, there for it doesn't address replys in echomail to someone personlly because most articles written in usenet are address to all, but ifmail can address reply articles to someone personal by way of an additional headerline X-Comment-To: in the news articles. In your file ~/.tin/attributes add the follow lines. scope=fido.* x_comment_to=ON _Mail/Netmail reading and writing_ I prefer Pine for doing this. You don't have to do something special, you only have to use the pfnz-notation for addressing. So Greg Frydenlund 1:125/720 becomes Greg.Frydenlund@.f710.n125.z1.fidonet.org or Greg.Frydenlund@f710.n125.z1.fidonet.org (Greg Frydenlund) And Greg Frydenlund 21:100/64. becomes Greg.Frydenlund@f64.n100.z21.prognet Another important point is sending mails to other mailers (Areafix, FileMgr). These often have problems with mails created by ifmail. As the mails often have a "* To: address" first line, which some of the mailers interpret as a command to order all Areas ("*"). If you don't want such a line, you can enter in the Setup menu under User-Defined-Header (before sending the message) an additional header-line: X-Flags: N Another problem is that FileScan and some other mailers have a bad habbit to take the address not from the header, but from the message-ID. But this doesn't contain the FTN-address (Z:N/F.P), but the Internet-address. You can fix this with: X-Flags: M by this the usual Fido-message-ID is generated (for different nets with the appropraite address). Of course you can combine the X-flags. I use for instance for all messages to robots: X-Flags: MN If you want to send crashmails, you have to add an additional "/X-Flags: C". If you address to a point, the mail is crashed to his boss. FileAttaches are possible, too. Add a "X-Flags: F" and a filename (with path!) as subject. If you want to set flags for all mails, you have to create a file like ~/.elm/elmheaders, which only contains the headerline, e.g. X-Flags: MN This line will be added to all messages. If the X-Flags show no effect, have a look into the ifmail logfile, as ifmail will probably remark about it. But this is a must for the acceptance of the X-Flags, else everybody could create crashmails and filerequests and send them from your site. _Requesting files_ For filerequests one can use the perl-script ifreq which is located in etc/ifmail/misc/contrib. Some DOS-request-processors have a problem with a missing linefeed at the line's end. This patch should fix this: --- ifreq~ Sat Aug 6 14:41:28 1994 +++ ifreq Sat Oct 8 12:05:09 1994 @@ -73,7 +73,7 @@ # open the flofile for appending open(FLOFILE, ">>" . $reqfile) || die "can't open $reqfile"; while (@files) { - print (FLOFILE shift(@files), "\n"); + print (FLOFILE shift(@files), "\r\n"); } close(FLOFILE); Troubleshooting If this all doesn't work right (despite my explanations), you have different possibilities to find the mistakes and fix them. An important tool for doing this is ifstat, which reports which packets are on hold for which addresses. Don't get confused, if these packets shrink after starting ifpoll, because this packs the mails into ZIP Files. Another good place to look is in your /var/log/syslog file or /var/log/messages file. Mail is not processed It would be a good idea to raise the debug-level of ifmail in /etc/sendmail.cf. To do this just add the parameter -4 in ifmail (you can get more info by raise the debug-level, e.g. I use something like -8). To really get ahold of the debug-messages, I send a copy of a mail to a non-existent address so that I get a returned message with all the debug output in /var/spool/mqueue. If such a returned message doesn't arrive it's quite possible that some of the permissions aren't correct which causes the system to wait (the still running processes sendmail and ifmail indicate this). Using sendmail the log-messages are written via syslog into the syslog file and the "stranded" messages lie in /var/spool/mqueue. Echomail are not being processed INN should take the article immediately into the newssystem thus they should appear in the file /var/spool/news/out.going/*. After running send-ifmail they should disappear from there and you should find them in /var/spool/ifmail/outbound. Also check the permissions of your directories and make sure ifnews has read/write access to them (/tmp, /var/spool/ifmail/fidonet and /var/spool/news/out-going/*). Furthermore one should have a look at all the log files: sendmail /var/log/mail INN /usr/local/lib/news/log /usr/local/lib/news/errlog /var/log/inn/* ifmail /var/log/ifmail/iflog /var/log/ifmail/ifdebug To verify the created packets or fix problems in already existing packets you should get hold of the DOS-program called Inspect which runs perfectly in the DOSemu. When you allow dosemu to access the appropraite directories and start DOSEmu as user fnet or news, then you can even change the .pkt files and archives. Credits The following people helped with their comments and improvements to write this HOWTO: roland@spinnsker.rhein.be (Roland Rosenfeld) 2:2450/111.13 Armageddon@icemans.ndh.com (Oliver Much) 2:2453/690.12 andij@andi.tricbbs.fn.sub.org/ (Andreas Jellinghaus) uli@corno.cologne.de/ (Ulrich Villers) 2:2450/115.3 martin@erde.GUN.de/ (Martin Seine) 2:2448/413.100 piet@smallchange.rhein.de/ (Peter Theisohn) 2:2450/30 mg@genyosha.in-chemnitz.de/ (Mike Gaertner) 2:249/5060.17 srtxg@chanae.alphanet.ch (Pablo Saratxaga) 2:293/2219 Todd Burroughs 1:259/604 If you have any additions or error-reports then send them to me immediately!