\input texinfo   @c -*-texinfo-*-

@c %**start of header
@setfilename msged.info
@settitle MsgEd TE 6.3 - A Public Domain Fidonet Message Editor
@setchapternewpage odd
@set MSGED MsgEd TE
@set VERSION 6.3
@set EDITION 1
@defindex kr
@defindex ke
@c %**end of header

@iftex
@parindent=0pt
@end iftex
@iftex
@afourpaper
@end iftex


@titlepage
@title @value{MSGED} @value{VERSION} Manual
@subtitle A Public Domain Fidonet Message Reader/Editor
@author Tobias Ernst @@ 2:2476/418.0
@page
@c{empty page to get the page numbering right}
@end titlepage

@ifinfo

@dircategory Fidonet Software
@direntry
* Msged: (msged).               Msged is the message reader and editor.
@end direntry

@node Top, Overview, (dir), (dir)
@top @value{MSGED}
This document describes @value{MSGED} @value{VERSION}, a Public Domain
Fidonet Message Reader and Editor Software for OS/2, Windows, DOS and Unix.

@menu
* Overview::                    What is @value{MSGED}?
* Installation::                Installation and Release Notes. @emph{Read this!}
* Introduction::                Using @value{MSGED}. A guide for beginners.
* Advanced Concepts::           Advanced features and concepts.
* Keyboard Reference::          How to use and change the key combinations.
* Configuration Reference::     Explanation of the configuration file.
* Compiling::                   Appendix: How to compile the source code.
* Concept Index::               General Index
* Keyword Index::               Configuration File Keywords Index
@end menu
@end ifinfo

@node Overview, Installation, Top, Top
@chapter An Overview on @value{MSGED} @value{VERSION}.

@value{MSGED} is a message reader and editor software for Fidonet (and
compatible) network(s), supporting Squish, Hudson, Jam and Fido *.MSG message
bases. This program is released to the public domain.  There are absolutely
no usage or distribution restrictions. This is truely free software.

@value{MSGED} emerged from MsgEd, a public domain fidonet message reader
initially written by Jim Nutt and thereafter maintained by numerous people
(among them Paul Edwards, Andrew Clarke, and Kim Lykkegaard). @value{MSGED}
is being developed by Tobias Ernst. You can reach me at 2:2476/418 or via
e-mail at tobi@@bland.fido.de.

@value{MSGED} tries to support a vast number ooperating system platforms by
employing portable software design techniques. It is my policy to release
executables and source code at the same time for all supported platforms,
among them OS/2, Unix (Linux and FreeBSD as well as commercial Unix systems),
Windows NT, 16- and 32-bit DOS.

@value{MSGED} is developed with the GNU C compiler and GNU boundary checking,
which assures high program stability.

@value{MSGED} formerly was an alternative branch to the main Msged
development line, which was evolving into a slightly different direction, but
as that main development line seems to have ceased, you can now consider
@value{MSGED} to be the most recent version of Msged. Since then, most of the
features of the last incarnation of the main Msged development line, Msged
4.30, have been incorporated into @value{MSGED}.

If you like @value{MSGED} and start to use it as your everyday Fidonet
editor, please drop me a note saying that you do so at @samp{Tobias Ernst @
2:2476/418} or at @samp{tobi@@bland.fido.de}. I originally started to work on
@value{MSGED} to create a Fidonet editor that fulfilled some special personal
needs of mine. Since then, things evolved and I saw myself doing a lot of
work that I would not have done just for my own needs. Writing this
documentation is one such example, porting to Windows NT another. If I
continue to do this work in the future and add new features to @value{MSGED}
will strongly depend on how much feedback I receive from users that like and
use @value{MSGED}. Therefore: Don't be shy - drop me a mail. :-)

At this place, I also would like to express my thankfulness to all people
that helped making @value{MSGED} what it is now, that being all the
developers that haved worked on the Msged sources in the past, the Husky
developers, and all the beta testers that used the Pre-Release of
@value{MSGED} @value{VERSION}.

@node Installation, Introduction, Overview, Top
@chapter Installation Procedures and Release Notes
This chapter provides you with information that is necessary to successfully
install and use @value{MSGED}. Part of this chapter applies to all versions
of @value{MSGED}, while some sections only apply to a particular operating
system. If this is the case, the particular operating system is mentioned in
the section title.

You should carefully read this chapter because it might save you from a lot
of pain, especially (but not only) when using @value{MSGED} in networked or
UNIX environments.

@menu
* Distribution Archives::       Which archives do I need?
* Non-Unix Installation::       Installing @value{MSGED} on OS/2, DOS, Windows
* UNIX installation::           Installing @value{MSGED} on Linux or Unix
* Network Notes::               Using Fido software in a network environment.
* Known Bugs::                  Known bugs and shortcomings of @value{MSGED}
* Contact::                     Contacting the author, support, bug reports.
@end menu

@node Distribution Archives, Non-Unix Installation, Installation, Installation
@section Which Distribution Archives do I need?
@value{MSGED} @value{VERSION} is shipped in various distribution
archives. This section describes the contents of each. You normally do only
need one of these files containing the executable and documentation for your
platform, and maybe the file that contains the printable version of the
documentation. In the following files, ??? must be replaced by the version
number, e.g. @file{600} for version @samp{6.0.0}.

@table @file
@item MSGE???O.ZIP
This archive contains an OS/2 executable, sample configuration files and a
manual in OS/2 INF format.

@item MSGE???D.ZIP
This archive contains a 16-Bit DOS executable, sample configuration files and
a manual in plain text format.

@item MSGE???3.ZIP
This archive contains a 32-Bit DPMI DOS executable, sample configuration
files and a manual in plain text format.

@item MSGE???W.ZIP
This archive contains a Windows 32 bit console executable that should be your
primary choice when running Windows NT or 2000, sample configuration files
and a manual in HTML format.

@item MSGE???L.ZIP
This archive contains a statically linked, pre-compiled Linux executable,
sample configuration files and a manual in GNU info format.

@item MSGE???M.ZIP
This archive contains the manual for @value{MSGED} in Postscript and in HTML
format. If you intend to print the documentation of @value{MSGED}, then you
should get this file and use the Postscript version, because printing the
Postscript version of the manual (by copying it to the printer port of a
postscript capable printer, or by using Ghostscript) will result in the best
possible output that looks much nicer than if you would print the HTML or
plain text documentations.

@item MSGE???S.ZIP
This archive contains the complete C source code for @value{MSGED},
out-of-the-box makefiles for building @value{MSGED} on DOS, OS/2, Windows,
and almost every imaginable Unix-like system (tested systems include Linux,
FreeBSD and Tru64 Unix), sample configuration files, and the texinfo source
code for the manual that can be used to build the manual in OS/2 INF, HTML,
GNU info or DVI format.
@end table

For compiling @value{MSGED}, you also need the @samp{smapi} library. The
@samp{fidoconfig} library is not needed, @value{MSGED} can now parse
Fidoconfig without need for this library. The versions of @samp{smapi}
libary that can be used to build @value{MSGED} @value{VERSION} are:

@table @file
@item smapi-stable-2.5-src.tar.gz
or any other version from this stable branch
@end table

@emph{Attention:} Most of these ZIP-files contain subdirectories, so you
should use the @samp{-d} option when unzipping them with @file{pkunzip}.!

@node Non-Unix Installation, UNIX installation, Distribution Archives, Installation
@section Installation on OS/2, DOS or Windows

This section provides guidelines and additional notes for installing
@value{MSGED} on OS/2, DOS or Windows.

@menu
* Non-Unix Installation Guide::
* 16-Bit DOS Release Notes::
* 32 Bit DOS Release Notes::
* OS/2 Release Notes::
* Windows Release Notes::
@end menu

@node Non-Unix Installation Guide, 16-Bit DOS Release Notes, Non-Unix Installation, Non-Unix Installation
@subsection Installation Procedure
@enumerate
@item
Obtain the distribution archive that contains the executable for your
platform. (You might already have done this).

@item
Create a subdirectory like for example @file{C:\MSGED}, change into this
subdiretory, and unzip the distribution archive. Be sure to use the @samp{-d}
option when unzipping the archive, because some archives contain
subdirectories. (You might already have done this).

@item
Find out which codepage you are using by issueing the @code{CHCP} command. It
is probably 437, 850 or 866. Then, select the corressponding read map and
write map files that are shipped with @value{MSGED} (the have names of the
form @file{READMAPS.codepagenumber} and copy them over to @file{READMAPS.DAT}
and @file{WRITMAPS.DAT}. For example, this could look like this:

@example
R:\MSGED> CHCP
Active Codepage:   850
Prepared System Codepages:   850;  437

R:\MSGED> COPY READMAPS.850 READMAPS.DAT
R:\MSGED> COPY WRITMAPS.850 WRITMAPS.DAT
@end example

Please note that the filenames for the Ukrainian codepage 1125 differ from
this naming scheme, they are called @file{READMAPS.UKR} and
@file{WRITMAPS.UKR}.

If there is no @file{READMAPS.XXX} file corresponding to the @samp{Active
Codepage} returned by the @code{CHCP} command, see if there is a
@file{READMAPS.XXX} file for one of the prepared codepages. If there is, use
that one, and use the @code{CHCP} command to change to this code page each
time before starting @value{MSGED}. In the example above, this command would
be @code{CHCP 437}. You probably would want to place this command in a batch
file, together with the invoation of @value{MSGED}.

If @value{MSGED} does not support the codepage that you want to use, please
contact the author and ask him to add support for that particular codepage.

@xref{Special Characters,,Using Special Characters like Umlauts or
Cyrillics - The Charset Kludge}, for more information on read and write map
files, charset kludge lines, codepages, and character set recoding.

@item
Rename the file @file{sample.cfg} to @file{msged.cfg} and modify it according
to your needs with your favourite text editor.
@xref{Configuration Reference,,Configuration Reference},
for detailed descriptions of each keyword that can be used in this file.

@item
You should now refer to the platform specific release notes found below before trying to start @value{MSGED}. They can save you from a lot
of headaches ;-).
@c FIXME add xrefs

@item
Optionally create an icon on your desktop or a batch file that starts the
proper executable (@file{MSGEDP.EXE} for OS/2, @file{MSGEDNT.EXE} for Windows
95/98/NT, @file{MSGED.EXE} for DOS, or @file{MSGED32.EXE} for 32-Bit DOS with
DOS extender) with the directory you created (@file{C:\MSGED} in the example
above) as working directory).

@item
Start @value{MSGED}.
@end enumerate

@node 16-Bit DOS Release Notes, 32 Bit DOS Release Notes, Non-Unix Installation Guide, Non-Unix Installation
@subsection Release Notes for the 16-Bit DOS version (@file{MSGED.EXE})
@itemize @bullet
@item
The 16 bit DOS version cannot handle squish message areas where the
@file{.SQI} file is larger than 64k. This limits the size of a message area
to about 5000 messages. If this is a problem to you, you should use the 32
bit DOS DPMI version instead.

@item
The 16 bit DOS version has been compiled with Borland C 3.1.

@end itemize

@node 32 Bit DOS Release Notes, OS/2 Release Notes, 16-Bit DOS Release Notes, Non-Unix Installation
@subsection Release Notes for the 32 Bit DOS version (@file{MSGED32.EXE})
@itemize @bullet
@item
The 32 bit DOS version should be used when the 16 bit DOS version runs out of
conventional memory (which is very unlikely to happen) or if you want to use
message areas with more than 5000 messages in them. In all other cases, the
16 bit version is the better choice because it uses less memory

@item
If you have Windows NT, you should use the Windows NT executable rather than
the 32 Bit DOS executable. On Windows NT, the native Windows 32 Bit version
is much faster than the DOS version. - The 32 Bit DOS Version is primarily
targeted on environments like DESQview, plain DOS or Windows 3.1.

@item
The 32 bit DOS version requries a functional DPMI server to run. Valid DPMI
servers include the Windows and OS/2 DOS box, Quarterdeck QDPMI, and others.

@item
In case you are running plain DOS without any DPMI server, @file{CWSDPMI.EXE}
is shipped in the distribution archive. Simply put it into the same path where
you put @file{MSGED32.EXE}, and it will act as an DPMI server as long as no
other one is installed already. Please note that CWSDPMI is not a public
domain program. It is licensed under the GNU Public License instead. You can
obtain the full source code for CWSDPMI and a copy of the GNU license from
@url{ftp.simtel.net/pub/simtelnet/djgpp/v2misc}.

@item
The 32 bit DOS version has been compiled using the DJGPP GNU compiler.

@end itemize

@node OS/2 Release Notes, Windows Release Notes, 32 Bit DOS Release Notes, Non-Unix Installation
@subsection Release Notes for the 32 Bit OS/2 version (@file{MSGEDP.EXE})
@itemize @bullet
@item
The OS/2 version has been compiled with the EMX GNU compiler, but does no
longer require the EMX runtime. It is a standalone OS/2 executable.

@end itemize

@node Windows Release Notes,  , OS/2 Release Notes, Non-Unix Installation
@subsection Release Notes for the 32 Bit Windows version (@file{MSGEDNT.EXE})
@itemize @bullet
@item
The Windows version is a 32 bit executable designed for Windows NT. Although
it has only been tested on Windows NT, it should also work on Windows 95 and
Windows 98. There have been reports that screen redrawing is very slow on
Windows 9x, so you might have to use the 32 bit DOS executable there.

@item
The Windows version presently does not support mouse control (even though the
mouse cursor is visible).

@item
The Windows version has been compiled with the Borland C++ 4.0 compiler.

@end itemize


@node UNIX installation, Network Notes, Non-Unix Installation, Installation
@section Installation on Linux, FreeBSD, or other Unixes
This section provides information on installing @value{MSGED} on Linux,
FreeBSD or any other Unix-like system.

@menu
* UNIX Installation Procedure::   How to install @value{MSGED}.
* Husky Installation Procedure::  Installing @value{MSGED} as part of Husky.
* Notes on UNIX terminal I/O::    How @value{MSGED} handles the terminal.
* Notes on UNIX keyboard input::  Escape Meta Alt Control Shift ;-)
* Notes on Big Endian Hardware::  Running @value{MSGED} on RISC processors.
* Colors in the Unix version::  How to enable colors.
* Case Sensitivity::            About case sensitivity problems.
@end menu

@node UNIX Installation Procedure, Husky Installation Procedure, UNIX installation, UNIX installation
@subsection Installation Procedure
@xref{Husky Installation Procedure,,Installing @value{MSGED} as part of the
Husky Project Tools}, if you want to use @value{MSGED} in conjunction with
the hpt Tosser and other Husky Project tools.

The rest of this subsection only covers manual installation of @value{MSGED}
as a standalone message reader, and may be skipped if you are using
@value{MSGED} in a Husky environemnt.

If you are using Linux you can get the Linux distribution archive which
contains a pre-compiled binary. If you are running any other Unix (including
FreeBSD, which due to a strange problem in the termios code won't run the
Linux binaries properly) you have to compile the source code on your own
(which usually is not much of a problem).
@xref{Compiling,, Compiling the Soruce Code}, for more information on this.

Please note that this manual does not necessarily cover installation of the
RPM archives of Msged created by other persons. Some tips of the following
sections also apply when you install the RPM files, but others don't Please
refer to the documentation of those RPM archives for more information.

The following describes the installation of the files from the Linux
distribution archive. If you have compiled @value{MSGED} yourself, you will
find the files that are mentioned below in slightly different locations (much
in the doc/ subdirectory), but they are all present somewhere in the source
code archive as well, after you have done all build actions as described in
the appendix.

@enumerate
@item
Create a temporary working directory and change into it:

@example
~ $ mkdir ~/msged-work
~ $ cd ~/msged-work
@end example

@item
Unzip the Linux distribution archive:

@example
~/msged-work $ unzip ~/msgte63l.zip
@end example

@item
Fix the file permissions of the executable file:

@example
~/msged-work $ chmod guo+x msged
@end example

@item
The executable can be either installed system-globally in
@file{/usr/local/bin} or some other location, or locally in the @file{~/bin}
subdirectory of your home directory:

@example
~/msged-work $ su root
Password:
/home/someone/msged-work # cp msged /usr/local/bin
/home/someone/msged-work # exit
@end example

@item
@value{MSGED} by default searches it's configuration file in the current
user's home directory, i.E. you need to copy the file @file{sample.cfg} to
@file{~/.msged}:

@example
~/msged-work $ cp sample.cfg ~/.msged
@end example

If you are an administrator and want to install @value{MSGED} system-globally,
you can make @value{MSGED} read a different configuration file either by
re-compiling @value{MSGED} and define the @code{MSGEDCFG} macro (this is also
done automatically when you compile @value{MSGED} with @file{huskymak.cfg} -
in this case the default location is @file{msged.cfg} in the @file{etc}
subdirectory that you defined in @file{huskymak.cfg}). Or you can simply
create a script that calls the @value{MSGED} binary with the @code{-c}
command line option. Specify the desired file name directly behind the
@code{-c}.

If you do this, you should, in the global configuration file, use a statement
like @code{include ~/.msged}, so that each user can indivudally configure his
own user name and other user specific settings.

@item
You have to copy some other files as well:

@example
~/msged-work $ cp msghelp.dat ~/.msged.hlp
~/msged-work $ cp sample.tpl ~/.msged.tpl
~/msged-work $ cp scheme.004 ~/.msged.colors
~/msged-work $ cp readmaps.is1 ~/.msged.readmaps
~/msged-work $ cp writmaps.is1 ~/.msged.writmaps
@end example

Note that this assumes that you are using ISO 8859-1 font encoding, as is
usally the case on Western Unix systems. If you use ISO 8859-5 (Russian Unix
vendor fonts), use @file{readmaps.is5} and @file{writmaps.is5} instead, and
if you use KOI8-R (Russian Linux and FreeBSD with e.g. cronyx fonts), use
@file{readmaps.koi} and @file{writmaps.koi} instead. @xref{Special
Characters,,Using Special Characters like Umlauts or Cyrillics - The Charset
Kludge}, for more information on read and write map files, charset kludge
lines, and character set recoding.

@item
Modify the configuration file @file{~/.msged} with your favourite text editor
according to your needs.
@xref{Configuration Reference,,Configuration Reference}, for detailed
descriptions of each keyword that can be used in this file.

@item
You should now refer to the Unix specific release notes found below
before trying to start @value{MSGED}. They can save you from a lot
of headaches ;-).

@item
Also, if you plan to share a message base between Non-Unix and Unix systems,
you absolutely must read the chapter devoted to problems with shared message
bases in heterogenous networks (@pxref{Network Notes,,Using Fidonet software
in network environments}).
@end enumerate

@node Husky Installation Procedure, Notes on UNIX terminal I/O, UNIX Installation Procedure, UNIX installation
@subsection Installiong @value{MSGED} as part of the Husky software
@cindex Husky
If you are using Husky sofware, e.g. the hpt tosser, you can also install
@value{MSGED} as part of the Husky software. In this case, you should first
follow the generic Husky installation instruction as found in the file
@file{INSTALL} found in the @file{huskybse} package.

These instructions essentially boil down to getting the source code packages
of Huskybse, Smapi, Fidoconf and Msged (in this case, use the Husky Msged
distribution, @file{msged-VERSION-src.tar.gz}), untar each file, create a
@file{huskymak.cfg} based on the template found in the @file{huskybse}
package, and then entering each of the subdirectories and typing @code{make;
make install}. But be sure to read the file in detail.

After you have done so, you already have a working installation of
@value{MSGED}. The command @code{make install} entered in the @value{MSGED}
subdirectory will already have taken care of installing a workable default
configuration file @file{msged.cfg} into your Husky @file{etc}
subdirectory. This file is set up to read most of the necessary settings for
@value{MSGED} from your @file{fidoconfig} (the basic Husky configuration
file), so that once you have configured @file{fidoconfig}, you can directly
start using @value{MSGED}.

The only thing that you need to adjust is the codepage setting. @value{MSGED}
is designed to do codepage translation, so that if your computer uses a
different characters set compared to what is commonly encountered in fidonet
echos, @value{MSGED} will handle the job of translating those messages to a
character set your local terminal can handle, and likewise translate text you
type back so that it is stored in a way other users can read it. This is
important for most non-English languages (like German, French, Russian
etc.). If you use this feature of @value{MSGED}, you don't need to abuse your
tosser to do codepage translation any more.

In order to select the proper codepage for your terminal, simply load the
@value{MSGED} configuration file @file{msged.cfg} into your favourite editor
and uncomment the line that is correct for your location. The file is
commented, and further instructions can be found there.
@xref{Special Characters,,Using Special Characters like Umlauts or Cyrillics - The Charset Kludge},
for further information.

@node Notes on UNIX terminal I/O, Notes on UNIX keyboard input, Husky Installation Procedure, UNIX installation
@subsection How Terminal I/O is handled on Unix
@cindex TERM variable
@cindex repainting the screen (UNIX only)
@value{MSGED} does neither use the curses library for most of its tasks, nor
does it make use of termcap or terminfo data bases. The way that
@value{MSGED} uses to create its full screen interface is to emit ANSI x3.64
character control sequences. This is a common subset of control sequences
that is recognised, among others, by VT52, VT100, VT200 and higher VTxxx
terminals, by xterm, by the FreeBSD and the Linux console, by the OS/2 telnet
program, and others.  In order to enable special features like color support
based on the @code{TERM} variable, you can use @code{IF} constructs in the
configuration file, as shown in the sample configuration file.

I have tested this on several Unix boxes and it worked remarkably well. For
optimum results, you should use the @file{scheme.004} color scheme file found
in the @file{doc/} resp. @file{samples/} subdirectory. If you have problems
seeing the cursor in an xterm, you should start the xterm with the option
@samp{-cr white}.

If the display is corruped by system log daemon messages or similar, you can
at any time during program execution press @key{Ctrl}-@key{L} to redraw the
screen.

@node Notes on UNIX keyboard input, Notes on Big Endian Hardware, Notes on UNIX terminal I/O, UNIX installation
@subsection Special Notes on Keyboard Input
Due to the history of @value{MSGED}, it heavily depends on typical PC
keyboard combinations like @key{Alt}-keys, combinations of @key{Ctrl} with
cursor keys, and so on. Not all of them are easy to reflect on a Unix console
or in an xterm.

As for the @key{Alt} keys (@key{Alt}-@key{X} and so on): @value{MSGED} tries
to recognize all sorts of ways in which clients reflect @key{Alt} or
@key{Meta} key combinations. If that still does not work on your console,
besides contacting me so that I can fix it, you can emulate an @key{Alt} key
with the @key{Esc} key: If you press and release the @key{Esc} key and then
press a letter, @value{MSGED} will treat this as if you pressed @key{Alt} and
that letter. However, you have to do this fast, because if no key is pressed
after the @key{Esc} for more than 0.2 seconds, @value{MSGED} will assume that
you really meant to press a single @key{Esc} key, which is also frequently
used in @value{MSGED}.

Some other key combinations, like @key{Ctrl}-@key{Left} and so on, are not
reproducable in an xterm or on a Unix console at all. Therefore, the sample
configuration file @file{sample.cfg} contains a bunch of settings that bind
those functions that are by default bound to key combinations that cannot be
keyed on Unix to other key combinations.

A nasty little problem might occur with the backspace key. If, on your
system, the backspace key deletes the character @emph{under} the cursor
rather than the character on the left hand side of the cursor, you might have
to turn the @code{BS127} switch on by adding @code{Switch BS127 On} to your
configuration file. The sample configuration file already contains correct
settings of the @code{BS127} switch for some widespread Unix consoles.

Also, some xterm variants are really broken. For example, I have seen xterm's
reporting code 127 for both Delete and Backspace, so you will only
be able to have either Backspace or Delete working. Also, some xterms
doe not report codes for @key{Home} and @key{End} at all. If you have such
an xterm, a tip would be to install rxvt and use msged in an rxvt window
instead of an xterm window.

Entering national special characters like cyrillics, the German a dieresis,
or the french accented characters, is always a problem on Unix. If you want
to do that with @value{MSGED}, refer to the sample configuration file and the
documentation on the @code{EnableSC} keyword (@pxref{EnableSC,,The
@code{EnableSC} keyword}). The most easiest solution is to put the
@code{EnableSC} keyword into the configuration file, but if you do this, you
will loose the @key{Alt} key combination functionality and will have to
emulate all @key{alt} keystorkes using the @key{ESC}-technique explained above.

If all this sounds very clumsy to you, perhaps you might volunteer to create
a more Unix-friendly keyboard layout for @value{MSGED}. @value{MSGED} allows
to freely redefine the keyboard layout. @xref{Redefining the
Keyboard,,Redifining the Keyboard Bindings}, for more information on
this. The first person that provides me with a really Unix-friendly set of
@samp{ReadKey} and @samp{EditKey} configuration statements will receive
special honour in this manual @dots{}

@node Notes on Big Endian Hardware, Colors in the Unix version, Notes on UNIX keyboard input, UNIX installation
@subsection Notes on Big Endian Hardware
A large part of @value{MSGED} and the underlying message API has been made
independent of little/big endian or structure packing issues. This means that
in principle you can compile @value{MSGED} on Alpha, PowerPC, Sparc, or
whatever exotic hardware and it will read and write exactly the same binary
format files like the Intel versions do. You do not even have to specify any
special compile-time switch for compiling on big endian hardware.

However, some things do not yet work on big on non-Intel machines. This
includes:

@itemize @bullet
@item
the QuickBBS / Hudson Message Base routines

@end itemize

This means that you presently must restrict yourself to a Squish message base
and a @file{squish.cfg} configuration file if you want to run @value{MSGED}
on big endian hardware. This will be definietly fixed in a future release.

@node Colors in the Unix version, Case Sensitivity, Notes on Big Endian Hardware, UNIX installation
@subsection Colors in the Unix version

The UNIX verison of @value{MSGED}, by default, presents itself in spartanic
black and white, because this is most compatible with any existing terminal
type. Even if you use the @code{Color} configuration keyword to define custom
colors, @value{MSGED} still will transform all your color definitions into a
black and white equivalent.

If you want to see @value{MSGED} displayed in nice colors, you need to enable
extended ANSI color codes:

@example
Switch Colors On         # enable ANSI color codes
Include ~/.msged.colors  # include the color configuration
@end example

Of course you need a terminal that supports ANSI color codes. Among others,
these are the Linux console (but not the Linux xterm!), the FreeBSD console,
the "color-xterm" or "xterm-color" or "nxterm" terminal emulators, and the
FreeBSD xterm. You can use Conditionals to switch the @code{Colors} switch
either on or off depending on the @code{TERM}
variable. @xref{Conditionals,,Conditional Statements in the Configuration
File}, for more information.

The sample color scheme file @file{color.004}, that you copied to
@file{~/.msged.colors} during the installation process, contains color
settings with sensible values. If, after adding the two lines from the
example above to your configuration file, parts of the screen or message text
are invisible, your terminal probably does not correctly support ANSI color
codes.

@node Case Sensitivity,  , Colors in the Unix version, UNIX installation
@subsection Case Sensitivity Problems
By default, the Unix version of MsgEd TE behaves case-sensitively (like any
program running on a Unix file system), i.E. it uses all filenames that it
reads from configuration file exactly as they are spelled, and all filenames
that it creates (i.E. by appending filename extensions) are created in lower
case.

This may lead to problems if you are sharing a message base between the Unix
versin of MsgEd and DOSish fidonet programs (i.E. fidonet programms running
on DOS, OS/2 or Windows, or simply a Windows or OS/2 fileserver that holds
the message base). Those programs tend to create a real mess of filenames by
mixing both lower-, upper- and mixed-case spelling. If you are running the
Unix version of MsgEd in such an environment, you should add the line

@example
Switch AdaptiveCase On
@end example

as the first line in your configuration file. This
will effectivly make MsgEd behave case-insensitive and should avoid most
problems with case sensitivity (@pxref{List of Switches,,List of available
switches}).

@node Network Notes, Known Bugs, UNIX installation, Installation
@section Using @value{MSGED} and other Fido software in networked environments
@cindex samba
@cindex peer network
@cindex NFS
@cindex lan manager
@cindex access synchronization
@cindex synchronizing message base access
@cindex record locks
@cindex locks, on the message base
@cindex voluntary locks
Sysops that have more than one computer often use network filesystems like
SMB (also known as Lan Manager, OS/2 peer services, the Windows Network, et
cetera), Novell or NFS to share their message base among multiple computers.
Depending on your environment, there are some problems buried into this
approach that might cause hidden data loss and might be unaware to you. These
problems are not specific to @value{MSGED}, but pertain to @emph{any} Fidonet
software that uses the Squish, JAM or Hudson message base format. I feel
enforced to devote a section of this documentation to these problems to save
you from encoutering severe unexpected problems in your installation,
especially as with the addition of Linux or Unix to such a network, the
problems tend to increase dramatically. - Another issue in such networks, case
sensitivity problems, as already been described above (@pxref{Case
Sensitivity,,About Case Sensitivity Problems}).

@menu
* Access Synchronisation::      Description of the general problem.
* Samba::                       Access Sync. with Lan Manager / Samba
* NFS::                         Access Synchronisation with NFS
* Novell::                      Access Synchronisation with Novell
* Network Essence::             Conclusions to draw from this chapter
@end menu

@node Access Synchronisation, Samba, Network Notes, Network Notes
@subsection Description of the Problem: Why we need access synchronisation.
The issue that we are talking about is access synchronisation.  In a
multi-tasking or networked environment, it happens that two or more programs
simultaneously access the message base. Therefore, the Squish Message API
(this is the piece of software that all Fidonet programs internally use to
access the message base files) needs a way to ensure that no other Fidonet
program can gain access to the message base file while itself is doing vital
modifications on it. Otherwise, data could be screwed up or even lost if two
programs would modify the same file simultaneously.

As long as your message base resides on a single computer, you do not have a
big problem with access synchronisation. On OS/2, Windows NT and DOS, access
synchronisation is done via so called @dfn{record locks}, which works
reliably. On Linux and other Unix system, access control is performed using
so called @dfn{voluntary locks} by all programs that use the @file{SMAPI}
edition of the Squish Message API. This is not as safe as the "record locks"
feature. Voluntary locks can only synchronize programs that use them,
i.E. programs that use the @file{SMAPI}, like @value{MSGED} or hpt. If you
wish to use other Fidonet programs on Unix, you should ask the author if he
employs voluntary locks for access synchronisation. If he doesn't, do not use
his software.

Things get more complicated in a networked environment, because there, not
only different applications have to synchronize among themselves, but
different computers also have to be synchronized. Or in other words, the
network file system that you use must correctly propagate record and/or
voluntary locks that have been set on one computer to all other computers.

@node Samba, NFS, Access Synchronisation, Network Notes
@subsection Access synchronisation on a Lan Manager (SMB) network.
The SMB network protocol (also known as Lan Manager protocol, or OS/2 Peer
Network, or Windows network), in principle, has support for propagating
record locks over the net. Tests proved that it works quite well in all
systems except Linux (Unix). This means that as long as your network only has
OS/2, Windows 3.11/95/NT and DOS (with @file{SHARE.EXE} loaded) systems, you
do not have to worry about access synchronization.

If you add a Linux box to a SMB network, things get more complicated. For
adding Linux to a SMB network, the Samba program is used. The Samba server
(as of version 1.9.18.p8, which has been used for all tests described below)
has some support for record locks, but it has restrictions. The Samba server
will not grant a program running on computer A access to a message base file
while a program running on computer B has placed a record lock on this
file. However, it will frankly grant a second program running on computer B
access to this file even while the first program running on computer B still
has a lock on this file. This is a bug in the Samba server. It hope
it will get fixed in further releases. - A further shortcoming of the samba
server is that it does not convert voluntary locks placed on the Unix side
into record locks visible on the OS2/DOS/Windows side. This means that any
OS/2 program, for example, can always access the message base file even if a
Linux program holds a lock on the file.

Also, neither of the available samba clients (smbfs, rumba) have support for
propagating voluntary locks as record locks.

The essence of this is: @emph{You cannot savely share a message base between
Linux/Unix and Non-Unix systems using Samba}. All you can do is place the
message base on a Samba server @emph{if} you assure that no other Linux
program accesses the message base, and that only OS/2, DOS and Windows
clients connect to the Samba server, and further more that on those clients,
only one program at a time tries to access the message base (that is: a
client with a multitasking OS that runs the tosser must not have any editor
installed, and you should never start up two editors simultaneously on any
client).

This is harsh, but true. Write mails to the programmers of Samba
and beg them to fix the problem with multiple programs on one clients, and to
implement the feature to convert voluntary locks on Unix side into record
locks on Non-Unix side. Perhaps the situation will then change in the future.

@node NFS, Novell, Samba, Network Notes
@subsection Access synchronisation on NFS
As for NFS, NFS itself does not support any kind of access synchronization at
all (!). Access synchronization on NFS is performed using an additional daemon
software called @file{rpc.lockd}. So if you have a NFS server that has a
functional @file{rpc.lockd} daemon @emph{and} all NFS clients support the
rpc.lockd protocol, then you can use NFS to share a message base between
multiple computers. The bad news is that I have not seen a working
@file{rpc.lockd} on either FreeBSD or Linux, and at least the NFS client for
OS/2 (as probably all other Non-Unix NFS clients) does not support the
rpc.lockd protocol. If you want rpc.lockd to work, you currently must use AIX
or Digital Unix or maybe also some other commercial Unix. Not an option for the
home user, I fear.

The essence is: @emph{You cannot use NFS to share a message base between
multiple computers}.

@node Novell, Network Essence, NFS, Network Notes
@subsection Access synchronization on Novell networks
Finally for Novell: I do not have any information on Novell networks. I
suppose that they natively do support record locking, but I do not know if or
how the existing Novell clients for Linux/Unix do support it.

@node Network Essence,  , Novell, Network Notes
@subsection The essence of this section about network usage is:
@enumerate
@item
You can savely share a message base among multiple computers in a Lan Manager
(OS/2 Peer, Windows Network, SMB Network, ...) network as long as no Linux
or Unix computer is involved.

@item
You can place the message base on a Linux/Unix fileserver running samba only
as long as no fidonet software is running on the file server, no Linux or
Unix client is involved, and all other clients take care that only one
Fidonet program at a time is being run. (This includes not only the tosser
and maintenance programs, but also the mail editor itself).

@item
There currently is not any way to savely share a Squish, JAM or Hudson
message base between computers if any of the computers is a Linux or Unix
machine. If you want to run Fido on the Linux box, the Linux box has to have
its own messagebase (usually meaning that you must install it as sysop point
or similar).
@end enumerate

If you do not obey to these three rules, you sooner or later will experiences
loss or corruption of mails and mail areas. Sorry to say so.

But what if you absolutely have to share a message base between multiple
Linux/Unix or Linux/Unix and Non-Unix computers? There is only one solution
to this problem: Use a message base format that does not require access
synchronisation. While the Squish, JAM and Hudson message base formats to
require access synchronisation because they store multiple mails in a single
file, the Fido *.MSG (also known as Opus) message base format does not have
this restriction because each mail is stored in a separate file. So Fido
*.MSG presently is the only way to go if you want to share your message base
between Linux/Unix and Non-Unix or other Unix computers.


@node Known Bugs, Contact, Network Notes, Installation
@section Known Bugs and Non-Features
This sections lists some shortcomings of the current release
@value{MSGED} @value{VERSION}. Please do not complain to me about these
problems, I am well aware of the problems and will try to solve them in the
future to the best of my possibility. (If, on the other hand, you want to fix
these problems on your own, go ahead and send me the changes you made. They
will be greatly appreciated.).

@itemize @bullet
@item
The documentation is lacking a chapter that provides the beginner with a
quick overview on how to use @value{MSGED}

@item
Version 7 nodelist lookup is not always working correctly (if two sysops
accidentally have the same name, it simply yields by random the nodenumber of
the one or the other, but does not let you select between the two of them)
and is lacking a lot of features. It is suggested that as long as things are
like that, you instruct your nodelist compiler to generate a
@file{FIDOUSER.LST} listing file. @xref{UserList,,The @code{UserList}
Keyword}, for more information.

@item
The Windows NT version does not allow entry of special characters by ASCII
code using the @key{Alt}-@var{numeric keypad} - Method. Also, under Windows
95, you must use @key{AltGr} to create special characters.
@key{Ctrl}+@key{Alt} will not work.

@item
On non Intel hardware, the routines for Fido and Hudson message bases as well
as the routines for importing @file{fastecho.cfg} will not work properly.

@end itemize

@node Contact,  , Known Bugs, Installation
@section Support, Contacting the Author, Reporting Bugs, Contributing Code
There are numerous reasons why you might wish to establish contact with me,
the author of @value{MSGED}.

@enumerate
@item
You have decided to use @value{MSGED} on a regular basis. In this case,
please do send me an e-mail at the address listed below. How much time I will
spend on developing @value{MSGED} in the future will heavily depend on the
number of mails I receive from users that tell me that they do use
@value{MSGED}.

@item
You have a general questions on how to configure or on how to use a certain
feature of @value{MSGED}. In other words, you need support. In this case,
you'd best post your question to one of the following echos:

@table @code
@item MSGED_ECHO
The international MsgEd conference. English is the preferred language here.
@item OS2BBS.GER
This German echo covers OS/2 Fidonet software. I monitor it regularly.
@item OS2NET.BBS.GER
The equivalent of OS2.BBS.GER in the German OS/2 net. I monitor it regularly.
@end table

If you do not have access to any of these echos, you may of course also
contact me via netmail or e-mail at the addresses listed below.

@item
You want to report a bug. There are two sorts of bugs:

@enumerate a
@item Normal bugs.
You think that a certain function of @value{MSGED} does not work as expected,
e.g. it is producing garbage, or doing strange things, or similar. In this
case, either post to the echos listed above, or contact me via
netmail. Please do supply all information that is necessary to understand
your problem.

@item Fatal bugs.
A fatal bug occurs if @value{MSGED} crashes. Depending on your operating
system, the symptom might be a core dump, or a SYS 3175, or a general
protection fault, or a system lockup, or a spontaneous reboot. I do consider
a crash untolerable. No matter how stupid things you do, you should not be
able to crash @value{MSGED}.

If you are running the precompiled Linux binary, reporting a fatal bug is
exceptionally easy. If you experience a crash, simply send me the @file{core}
file that has been generated. You do not need to try to reproduce it or write
extensive descriptions. Simply send the @file{core} file, and in most
circumstances I will be able to fix the problem.

If you are running any other binary version (like OS/2, DOS, Windows), you
will not get a core file on a crash. (On OS/2, you can write me a mail and
ask me for sending you a debugging executable. This will require the EMX
runtime, but generate @file{core} files just like the Unix version
does. On DOS and windows, you do not have this option). Write down as much
information as you can, try to find a way to reproduce the crash and contact
me at the addresses below.
@end enumerate

@item You want to contribute to @value{MSGED}.
If you are a programmer and have fixed a problem in @value{MSGED} on your
own, please submit your changes to me. The preferred way for doing so is to
send me a difference file in GNU diff format. Your work will be highly
appreceated and honored in an appropriate place. If you want to regularly
work on @value{MSGED}, we also have a CVS server online that you can have
access to if you like.

If you want to write a new feature for @value{MSGED}, please contact me
beforehand to avoid that we do duplicate work. Again, I will appreciate and
honor eny efforts done by you. Please note that for writing a @value{MSGED}
enhancement, you should be familiar with C. Also, @value{MSGED} uses a
special indentaion style throughout the source code, that I would like you to
adhere to.
@end enumerate

So here are my addresses if you want to get in contact with me:

@itemize @bullet
@item Fidonet:
Tobias Ernst @ 2:2476/418

@item e-mail:
tobi@@bland.fido.de

@item Telefax:
+49 711 5000184

@end itemize






@node Introduction, Advanced Concepts, Installation, Top
@chapter A quick tour through @value{MSGED}
This chapter will be supplied in a future revision of this
document. It will provide an introduction for beginners on using
@value{MSGED}.

As long as this chapter is not provided, you must help yourself using the
online help. Nearly everywhere in @value{MSGED}, you can press
@kbd{Alt}-@kbd{H} to get a somewhat context sensitive help screen.

@node Advanced Concepts, Keyboard Reference, Introduction, Top
@chapter Advanced Concepts in @value{MSGED}
After you have managed to perform basic functions with @value{MSGED}, like
reading messages, entering new messages, and replying to messages, this
chapter will introduce you into some advanced concepts in
@value{MSGED} that deserve special attention, like how to use a
Fidonet-Internet gateway, how to use eight bit character sets, and similar.

@menu
* Exporting and Printing::      Exporting mails to text files or printers.
* Grouping::                    Configuring and Using Message Area Groups.
* Special Characters::          Umlauts, Cyrillics and Charset Kludges
* Internet Gateways::           Using @value{MSGED} for e-mail correspondance.
@end menu

@node Exporting and Printing, Grouping, Advanced Concepts, Advanced Concepts
@section Exporting Mails to Text Files or to the Printer

This section tells you how to export mail messages. Exporting in this sense
includes simply saving the message text into a file, but also printing the
message or feeding it into a pipe.

@menu
* Exporting::                   Saving the message into a plain text file.
* Printing::                    Printing the message.
* Piping::                      Running an external command with the message
                                text as standard input.
@end menu

@node Exporting, Printing, Exporting and Printing, Exporting and Printing
@subsection Saving message text into a plain text file
@cindex exporting message text
@cindex text file, exporting to

In order to export the message text into a plain text file, you have to
invoke the @code{export} reader or editor function. If you did not change the
keyboard binding, this is done by pressing @key{Alt}-@key{W}. You will be
shown a menu that looks like this:

@example
+-----------------------------------------+
|  Write to File                          |
|  Print                                  |
|  Pipe into external Program             |
|  Cancel                                 |
+-----------------------------------------+
@end example

Select the first entry, @samp{Write to File}. You then will be shown a dialog
box where you can select a file name. You can use the cursor keys to navigate
through the directory structure and select a file to be overwritten. If you
want to create a new file, press @key{Tab} to get to the @samp{File:} entry
box and enter a new file name.

After that, you will see a menu that asks you how the text should be
exported:

@example
+-----------------------------------------+
|  As Plain Text                          |
|  Binary (for re-importing into Msged)   |
|  Cancel                                 |
+-----------------------------------------+
@end example

Normally you will want to select @samp{As Plain Text}. This produces a nice
message header and nicely wrapped paragraphcs. This format is useful for
reading with normal editors, for printing etc. The @samp{Binary} format
(formerly known as @samp{Msged Format}) will not write any headers, and it
will not break the paragraphs into lines. This format is useful if you intend
to re-import the text into @value{MSGED} or into another application that
works paragraph-oriented rather than line-oriented (like a word processor).

Note that this dialog box will not be shown if you try to export text while
you are @emph{editing} a message; in this case, the plain text mode will
always be used.

When you have made your selection, the file will be written. If you selected
a file that already exists. you will see an additional dialog box that asks
if you want to append to the file, overwrite it, or cancel the operation.

@node Printing, Piping, Exporting, Exporting and Printing
@subsection Printing a message
@cindex Printing

In order to print a message, press @key{Alt}-@key{W}. Select
@samp{Print}. That's all about it, the message will be printed! But how did
@value{MSGED} know how to find your printer? Well, on OS/2, DOS and Windows
it just uses the standard printer, known as @samp{PRN}, which is usually
connected to the first parallel port. On UNIX, it calls the @samp{lpr}
command with no special options, which will lead to the default queue being
used.

If you want to use a different printer for printing mails -- for example, you
might have two printers, one for high quality office correspondance, and one
for quick printouts, and want to use the latter one for printing Fidonet
messages --, you can use the @code{Printer} keyword in the @value{MSGED}
configuration file to select a different printer. @xref{Printer,,The
@code{Printer} Configuration Keyword}, for more information.

@node Piping,  , Printing, Exporting and Printing
@subsection Piping message text into external programs
@cindex Piping

What does @dfn{piping} mean? This feature works as follows: @value{MSGED}
will start an external command or program and feed the mail text into this
command's standard input stream. This feature originally comes from the Unix
world. For example, you could pipe the message text into a Perl or Rexx
script that analyses the text and does something with it (for example, the
script could store the text in a cooking recipe database). The piping feature
does not work in all versions of @value{MSGED}. It only works in the UNIX
version and in those non-UNIX versions that have been compiled with a GNU gcc
compiler.

In order to pipe message text into an external program, type
@key{Alt}-@key{W} and select @samp{Pipe into external program}. You will then
see a dialog box that prompts you for a command to execute. You can enter
any commands or programs in exactly the way as you would enter them at the
shell prompt of your operating system. @value{MSGED} will execute exactly
this command and provide the message contents as standard input to the
command. For example, you could enter

@example
cat - >test.txt
@end example

This of course is a stupid example, because the same result could be achieved
by selecting @samp{Write to File} and specifying @file{text.txt} as file
name, but it shows how the mechanism works.

After that, you will be prompted for the export mode (plain text or
binary). @xref{Exporting,,Saving message text into a plain text file}, for
information on what this means.

@node Grouping, Special Characters, Exporting and Printing, Advanced Concepts
@section Configuring and Using Message Area Groups.
@cindex groups
@cindex area groups
@cindex message area groups

@value{MSGED} @value{VERSION} supports forming message areas into message
area groups. The main appliance of this feature is to ease arealist
navigation - you can have the areas sorted by groups, @value{MSGED} can
display separators between the single groups, or you can make the area list
display only members of a certain group, and switch between the groups using
hotkeys. But you can also use the group feature to select different usernames
or template files based on which area you are writing in.

The following subsections will first tell you how to set up groups and assign
areas to those groups, and will then go on and tell you how you can make use
of groups to ease your life with @value{MSGED}.

@menu
* Group Basics::                How @value{MSGED} identifies a group.
* Tosser Groups::               Reading group information from the areafile.
* Manual Groups::               Manually assigning areas to groups.
* Arealist Group Functions::
* Group Templates::
@end menu

@node Group Basics, Tosser Groups, Grouping, Grouping
@subsection Grouping Basics
In @value{MSGED}, a group is identified by a @emph{group name}. A group name
can be any string and may include spaces etc. The group name is not case
sensitive, however. @value{MSGED} has no fundamental limit on the number of
groups that can be defined.

Each message area can only be member of one group. This means that if you
assign an area twice to different groups, it will only be a member of the
group that it has been last added.

@node Tosser Groups, Manual Groups, Group Basics, Grouping
@subsection Reading Group Definitions from the Tosser Configuration File

Setting up groups is very easy if you read all your area definitions form a
tosser configuration file (@pxref{Areafile Parsing,,Reading a Tosser
Configuration File (Areafile)}). If your tosser stores group information and
@value{MSGED} supports reading it, then @value{MSGED} will automatically take
over the tosser's group definitions. This is currently supported for
@samp{Fidoconfig} and @samp{Fastecho} type areafiles.

For @samp{Fidoconfig}, the names of the @value{MSGED} area groups will be the
same names as the @samp{Fidoconfig} group names. However, be aware that
fidoconfig group names are case sensitive, while @value{MSGED} group names
are not. So, members of two different groups with names that, in the
fidoconfig file, only differ in upper/lower case spelling will be members of
the same group in @value{MSGED}.

For @samp{Fastecho}, the names of the @value{MSGED} area groups will be the
names that you have defined in @file{fesetup} in the @samp{System/Group
names} menu. If you did not set up group names for some or all areas, those
areas will have a name of @samp{Fastecho Group X}, where @samp{X} is the
letter that is used to identify the group in Fastecho.

The easiest way to find out about which group names @value{MSGED} has created
based on the areafile information is to press @key{Ctrl}-@key{G} in the
message area list. This will show a menu of all groups.

If you do @emph{not} want to read any sort of group setup from the tosser
configuration file, then you can turn off the @code{UseTosserGroup} switch by
adding @code{Switch UserTosserGroup Off} to your @value{MSGED} configuration
file. This has to be done before the @code{Areafile} statement to which this
setting should apply.

@node Manual Groups, Arealist Group Functions, Tosser Groups, Grouping
@subsection Manually Defining and Assigning Groups
@findex Group
If @value{MSGED} is not able to read group information from your
@code{Areafile}, or if you want to fine-tune that information, or also if you
are defining some or all areas manually in your @value{MSGED} configuration
file. This is done using the @code{Group} keyword. Here is it's syntax:

@table @asis
@item Syntax:
@code{Group "@var{groupname}" [@var{pattern}]}
@item Example:
@code{Group "OS/2 Echos" *OS2*}
@end table

The @var{groupname} parameter should be a string that uniquely identifies
this group. It may contain spaces if you enclose it in quotation marks, as
shown above.

The optional @var{pattern} argument specifies a wildcard pattern. The pattern
may contain any number of stars and questionmarks, and works like a wildcard
on an OS/2 or Win32 command line. This pattern is matched against the area
@emph{tag} (like for example OS2PROG), and all matching areas will be added
to that group.

If the @var{pattern} argument is omitted, the group will be defined, but no
areas will be added to it yet.

There can only be one @var{pattern} argument, but this is not a problem, as
the @code{Group} keyword is cumulative. This means that if you write
something like

@example
Group "Echos in German Language" *.GER
Group "Echos in German Language" *.024
Group "Echos in German Language" *.AUS
@end example

then the group will contain all areas that match at least one of the given
patterns.

However, each one area can only be member of a single group. This means that
if you add an area to a group that has previously already been added to a
different group, that group will lose this area. Example:

@example
Group "German Echos" *.GER
Group "Linux Echos" *LINUX*
@end example

Here, the @samp{LINUX.GER} echo area would be in the @samp{Linux Echos}
group, and not in the @samp{German Echos} group.

You can put @code{Group} statements anywhere in your configuration file. Even
if an area is defined after a @code{Group} statement, it will still be added
to that group if the wildcard matches. However, the relative ordering of the
@code{Group} file statements may be important: Msged will display
groups (when areas are sorted by group, or in the group menu, see
later) in the order of first mention in the @value{MSGED} configuration
file. A group is @emph{mentioned} either when it's name first appears in a
@code{Group} statement, or when it is automatically defined when reading an
areafile.

For example, let's assume you are using fidoconfig and get all group
information from the areafile. But you want to put some groups that attract
your special interest into a group named @samp{Interesting Groups}. Now you
have to decide if you want to put see this group before all other groups in
the area list, or if you want to see it after all other groups. In the first
case, write

@example
Group "Interesting Groups"
Areafile fidoconfig
Group "Interesting Groups" *LINUX* *OS2*
@end example

In the second case, omit the definition before the @code{Areafile} statement
and simply write

@example
Areafile fidoconfig
Group "Interesting Groups" *LINUX* *OS2*
@end example

@node Arealist Group Functions, Group Templates, Manual Groups, Grouping
@subsection Group Functions in the Message Area List
When you have set up groups, the message area list will make navigation with
many areas a lot easier.

@subsubsection Sorting Areas by Group
The most basic group feature of the area list is that it can display areas
grou-sorted, i.E. first all areas of the first group, then all areas of the
second group, and so on. To achieve this, use the @code{SortAreas} keyword as
follows:

@example
SortAreas G
@end example

Most probably, you will further want to sort the area inside the group. If,
for example, you want to sort all netmail areas to the beginning of each
group, and then sort the areas alphabetically by description, you would use

@example
SortAreas GND
@end example

Once you have activated sorting areas by group, @value{MSGED} will draw
horizontal bars between the groups to visually separate them. If you do not
like this feature, you can disable it using:

@example
Switch GroupSeparators Off
@end example

@subsubsection Displaying only a certain group
You can press @key{Ctrl}-@key{G} in the arealist and get a list of all groups
that have been defined. When you select any of those groups, the area list
will then only display areas that are member of this group. Further more, all
other @value{MSGED} functions, like area scanning, personal mail scan,
switching to the next/previous area in message reading mode, etc., will also
only work on those groups. @value{MSGED} will effectively behave as if only
those groups had been defined. (An exception is when
moving/copying/forwarding mail or replying to a different area: there you
will still get a list of all areas).

You can then again use the @key{Ctrl}-@key{G} menu or press the short cut
@key{Alt}-@key{0} to return to the display of all defined areas. You can also
use the shortuts @key{Alt}-@key{1} @dots{} @key{Alt}-@key{9} to quickly
switch between the first nine groups.

@node Group Templates,  , Arealist Group Functions, Grouping
@subsection Group Default Templates and Usernames
This feature is described in the documentation of the @code{GroupSettings}
keyword. @xref{GroupSettings,,The @code{GroupSettings} Keyword}.

@node Special Characters, Internet Gateways, Grouping, Advanced Concepts
@section Using Special Characters like Umlauts or Cyrillics - The Charset Kludge
@cindex FSC 0054
@cindex FSP 1013
@cindex special characters
@cindex charset kludge
@cindex character set conversion
@cindex russification
@cindex cyrillic letters

Languages other than English often use special characters besides the normal
alphabet. Examples are the accented letters in French or the umlauts in
German, or the cyrillic alphabet used in Russia and elsewhere. IBM block
graphics are also called special characters. This section will describe what
measures have to be taken in order to be able to transmit special characters
via Fidonet.

@menu
* Problems with Special Characters::  Description of the general problem.
* Special Characters in Fidonet::  FSC/FTS proposal to solve the problem.
* MsgEd TE and Special Characters::  How @value{MSGED} implements FSP 1013.
@end menu

@node Problems with Special Characters, Special Characters in Fidonet, Special Characters, Special Characters
@subsection What is so special about special characters?

In order to be able to exchange text between computers, it was necessary to
agree on a scheme on how to encode letters into numbers, the so called
@dfn{character set}. The standard character set for transferring text between
a huge variety of computer systems is the ASCII character set. Unfortunately,
the ASCII character set is only 7 bit wide and does not leave room for
national special characters.

In order to be able to transfer special characters like accents and umlauts,
it was therefore necessary to use eight bit wide extended character sets
that defines how special characters are encoded.

In contrast to the standard 7 bit ASCII character set, which is a single
character set used by nearly all computer systems, there exist several
pseudo-standard character sets that are 8 bits wide. All of them contain
ASCII as an subset, but they all differ in how they encode special
characters. DOS and OS/2 computers typically use the IBM PC character set,
but even there, dependent on what country you live in, there are several
different code pages of the IBM PC character set. Unix computers and the
Amiga in the western world typically use the ISO8859-1 character set, also
known as Latin-1. Windows uses IBM PC for console applications, but ISO8859
for graphical applications. The Macintosh uses the Macintosh character
set.  In Russia, there is a similiar problems: There exist four ways of
encoding cyrillics, namedly the KOI8-R fonts, the ISO 8859-5 fonts, the
codepage 866 of the IBM PC character set, and Windows Codepage 1251.

The consequence of this is clear: If you write a text on a Unix or Windows
computer using special characters like accented letters or umlauts, you
cannot expect it to be properly displayed on a DOS or OS/2 computer, and vice
versa, unless special measures are taken.

@node Special Characters in Fidonet, MsgEd TE and Special Characters, Problems with Special Characters, Special Characters
@subsection How has this problem been solved in Fidonet?
This issue of special characters has been a problem for Fidonet in the past,
but it has been solved by the Fidonet standard FSC 0054 and its successor,
FSP 1013, so that you can now
safely use special characters in Fidonet mail @emph{if} your message editor
supports FSC 0054. FSC 0054 basically works like this:

Every Fidonet editor that wants to be compatible with FSC 0054 must be
delivered along with built-in or external character translation tables that
tell the editor how it can convert text that contains special characters from
one character set to another.

When composing a message using a FSC 0054 compliant editor, you have two
choices: By default, the editor allows you to enter the full range of special
characters that your computer supports, but when saving the message, the
editor will use its character translation tables and convert your text into a
7 bit clean representation that can be displayed on @emph{all} computers even
if they don't support FSC 0054. For example, a German sharp s would be
converted into double s, an e with accent would be converted into an e
without accent, a cyrillic soft a would be converted to its transliteration
"ya", and so on. This is the maximum compatibility mode: It offers
you the comfort of being able to write text just as you would in a letter,
using all special characters that your language requries, but your mails
will still be properly displayed on all computers. This might be an option
for German users, but it certainly is not for Russian users, as the
transliteration of cyrillic letters is not particularly easy to read.

The other (better) possibility is that your editor leaves the special
characters that you typed in as is, or converts them to a common transport
charset (like codepage 866 in Russia, or codepage 850 in Europe), but inserts
a hidden kludge line, from here on referred to as the @dfn{charset kludge},
into the message, that designates which character the mails stored in the
message are composed in. When your message is read on another computer by a
Fidonet message reader that also supports FSC 0054, the message reader will
see the charset kludge in your mail and then use its charset translation
tables to convert your message into the character set that this computer
uses. The consequence is that even if your computer and the computer of the
receiver use different character sets, everything that you typed in will look
just the same on the receiver's screen than on yours, including all special
characters that have been typed.

A particular note to all Russian users of Msged: In Russia, it has been
commonly agreed on to transport all Fidonet mails in Codepage 866. So you
might ask what you do need a charset kludge for - could not just @value{MSGED}
recode everything to codepage 866 when writing a mail and importing from
codepage 866 when reading a mail, and not care about that kludge line? But
imagine a user in Germany who wants to read Russian echomails. His mail
editor needs a way to know if a mail that it is about to display contains
German special letters, or if it contains Russian ones. (Or vice versa,
imagine a Russian person who wants to leran the German or English
language). Only if Russian mails contain the proper charset kludge
(@samp{CP866}), it will be able to display both languages correctly.

@node MsgEd TE and Special Characters,  , Special Characters in Fidonet, Special Characters
@subsection How do I configure @value{MSGED} to support FSC 0054?
@value{MSGED} fully supports FSC 0054. It uses two binary files, a read map
and a write map. The read map contains tables that define how to convert all
the known transport charsets to the local charset (this even includes
transliteration tables for displaying Russian text on Western computers!),
and similarly, the write map contains tables that define how to convert the
local character set to any allowed transport character sets.

The default name of the character set translation files are
@file{READMAPS.DAT} and @file{WRITMAPS.DAT}, and they are searched in the
current working directory when @value{MSGED} starts. (On Unix, the exact name
and location of these files are determined by the defaults you put into the
makefile, or @file{~/.msged.readmaps} and @file{~/msged.writmaps} for the
precompiled binaries, while the RPM distribution might use yet other
locations). You can change the file names and location to use with the
@samp{Readmap} and @samp{Writemap} keywords (@pxref{Readmap,,The Readmap and
Writemap Keywords}).

The binary release of @value{MSGED} ships with a variety of read maps and
write maps. For each character set or codepage, there is a pair of read map
and write map file which contains tables to convert from any charset set to
this codepage and back.

Now all you need to do in order to configure @code{MSGED} to properly encode
and decode all sorts of special characters is to determine which character
set or codepage your computer is using, and copy the corresponding pair of
read map and write map file to the default name and location as noted above,
or use the @samp{Readmap} and @samp{Writemap} keywords to point Msged to the
correct pair of read map and write map files.

The following tables lists all read map and write map files that
@value{MSGED} currently includes:

@example
Filename     | Type of font / character set / computer
-------------------------------------------------------------------------
READMAPS.850 | Any DOS or OS/2 computer, or Windows computer with the OEM
WRITMAPS.850 | console fonts, that uses Codepage 850. This applies to most
             | computers in Western Europe. Some badly configured Linux
             | systems might also use this code page.
-------------------------------------------------------------------------
READMAPS.437 | Any DOS or OS/2 computer, or Windows computer with the OEM
WRITMAPS.437 | fonts, that uses the standard codepage 437. This applies to
             | most US-American installations, and also to some European
             | ones that use Codepage 850 because it has some more IBM
             | graphics characters.
-------------------------------------------------------------------------
READMAPS.865 | This is the "nordic" IBM Codepage 865 used in some
WRITMAPS.865 | Northern European countries.
-------------------------------------------------------------------------
READMAPS.866 | This is IBM Codepage 866, used by DOS and OS/2 or Windows
WRITMAPS.866 | text mode applications in Russia.
-------------------------------------------------------------------------
READMAPS.UKR | This is IBM Codepage 1125, used by some DOS and OS/2 or
WRITMAPS.UKR | Windows installations for text mode applications in
             | Ukraine and Belorussia.
-------------------------------------------------------------------------
READMAPS.IS1 | This is ISO 8859-1. It is the standard encoding for
WRITMAPS.IS1 | X11 fonts and console fonts on Linux and Unix systems
             | in Western Europe.
-------------------------------------------------------------------------
READMAPS.IS5 | This is ISO 8859-5. It is the encoding used for vendor
WRITMAPS.IS5 | shipped additional fonts in Russian editions of commercial
             | Unix systems.
-------------------------------------------------------------------------
READMAPS.KOI | This is KOI8-R, used by the cyrillic cronyx font set,
WRITMAPS.KOI | which is in use in almost any Russian Linux or FreeBSD
             | installation, and can of course also be installed on
             | commercial Unix systems.
-------------------------------------------------------------------------
@end example

So, enabling character set translation is easy, but you have to pay attention
to use the @emph{correct} pair of read map and write map file.

If you have the source code distribution of @value{MSGED}, the @file{bin}
subdiretory contains @file{readmaps.dat} and @file{writmaps.dat} files for
all supported code pages. If you are compiling directly out of CVS, you can
go to the @file{maps} subdirectory and compile and use the @file{makemaps}
utiltiy to build the proper character set maps.

The following table lists all level 2 transport character sets that
@value{MSGED} understands when it finds them in mails (meaning all character
sets that are defined in the @file{READMAPS.DAT} and @file{WRITMAPS.DAT}
files):

@example
@@CHRS-Kludge: | Conventional Name:    | Used by these computers:
--------------+-----------------------+---------------------------
LATIN-1 2     | ISO 8859-1            | Western Unix, Amiga, Windows GUI
MAC 2         | MAC                   | Macintosh computers
CP437 2       | IBM PC, Codepage 437  | DOS, OS/2, Windows console
CP850 2       | IBM PC, Codepage 850  | International / European versions
              |                       |   of DOS, OS/2 and Windows.
CP865 2       | IBM PC, Codepage 865  | Nordic versions of DOS, OS/2, Win
CP866 2       | IBM PC, Codepage 866  | Russian OS/2, DOS, Windows
CP1125 2      | IBM PC, Codepage 1125 | Ukrainian and Belorussian
              |                       |  OS/2, DOS, Windows
@end example

Apart from that, @value{MSGED} also understands the (outdated)
@code{@@CODEPAGE} kludge line.

Most @file{READMAPS.DAT} and @file{WRITMAPS.DAT} files define some more
charset names, like @code{KOI8-R}, @code{ISO-5}, and so on, but these kludge
lines are not intended for message transport, but only as an internal name
for @value{MSGED} to see what charset your computer uses locally.

There are quite some other (though incorrect or obsolete) charset kludges in
widespread use in fidonet. The most prominent one is @code{IBMPC 2}.
Originaly, @code{IBMPC 2} meant the DOS codepage 437, but in the meantime, it
has been used to simply denote the codepage that a "IBM" computer is
typically using. This means that if a Russian user has a kludge that says
@code{IBMPC 2}, he probably means @code{CP866 2}, while if a German user has
@code{IBMPC 2}, he probably means @code{CP850 2}.

Msged supports use of those outdated or incorrect charset kludges with the
@code{CharsetAlias} command. A Western European user should
probably put the following comand into his config file:

@example
CharsetAlias IBMPC CP850
@end example

An American user might prefer

@example
CharsetAlias IBMPC CP437
@end example

A Russian user needs a whole bunch of commands:

@example
CharsetAlias IBMPC CP866
CharsetAlias +7_FIDO CP866
CharsetAlias RUFIDO CP866
@end example

Once FSC 0054 is activated, @value{MSGED} will be able to correctly display
all mails that have been created with one of the characters sets listed
above, as long as they contain the proper charset kludge
line.

Unfortunately, quite some still don't - do tell their authors to correct
their setup! Until those users fix their editors, @value{MSGED} offers you
two options. The one is the @samp{AssumeCharset} keyword, which sets a
default character set kludge name for mails that do not contain such a kludge
line. @xref{AssumeCharset,,The @code{AssumeCharset} keyword}, for more
information. The other option is the @key{Alt}-@key{T} key combination that
you can press in message reading mode. You will get a menu that allows you to
select from all supported codepages and character sets. You can use this menu
if you must read a mail that contains a wrong character set kludge line, or
one that does not contain such a kludge and does not meet the assumption you
made with @samp{AssumeCharset}. @xref{Misc Reader Functions,,Miscellaneous
other Reader Functions}, for more information.

Now that you have set up @value{MSGED} so far, you are able to read almost
all mails with correct 8 bit characters, and mails that you write yourself
may also contain any special characters, but @value{MSGED} will convert them
into a 7 bit ASCII character set when you save them.

If you want to retain special characters in your mail by adding a charset
kludge (which is highly recommended), you have to do two things. First, you
have to define which character set to use for saving your mails
. @xref{OutputCharset,,The @code{OutputCharset} Keyword}, for information on
how to do this. In most cases, you will simply want to add the following line
to your configuration file:

@example
OutputCharset IBMPC
@end example

Although it would be better to use @code{CP437}, @code{CP850}, @code{CP865} or @code{CP866}
(depending on your location), most readers still don't support this, so using
@code{IBMPC} might be better for the moment. If you use @code{IBMPC},
@value{MSGED} will emit an addtional @code{CODEPAGE} kludge line to make
clear which codepage you actually are using.

Exporting in
@code{IBMPC} charset will even work on a Linux box, just if you were wondering.

Then, you have to tell @value{MSGED} in which areas it is allowable to send
mails with special characters and charset kludges. @value{MSGED} will only
write special characters into areas that have the @samp{8} flag set. If you
are importing your message area configuration from a tosser configuration
file, you can simply put the following line to the beginning of your
configuration file:

@example
AreaFileFlags 8
@end example

(If you already have an @code{AreaFileFlags} statement, just add the @samp{8}
character to its parameters). @xref{Areafile AreaFileFlags and AreaDesc, The @code{AreaFileFlags}
Keyword}, for more information.

This will allow @value{MSGED} to use special characters in conjunction with a
charset kludge in all message areas imported from a tosser configuration
file.

If you only want to enable special characters for a few areas, you have to
define these areas manually, giving each of them the @samp{8} flag
individually. The same applies if you have to define your areas manually for
other reasons. @xref{Manual Area Definition,,Manual Area Definition}, for
more information on this.

@node Internet Gateways,  , Special Characters, Advanced Concepts
@section Internet Gateways - Using @value{MSGED} for e-mail and newsgroups

@value{MSGED} has built-in support for Fidonet to Internet Gateways, allowing
for seemless coexistence of Fidonet mail and Internet mail. When you use
@value{MSGED} to talk to your Internet gateway, you do not even have to know
about all the nasty details of gateway addressing - @value{MSGED} does the
job for you. This makes @value{MSGED} the ideal choice as an editor to give
to new users that want instant e-mail access without having to care for
klumsy gateway addressing rules.

@menu
* Gateway Principles::          How does a UUCP gateway work?
* Gateway Configuration::       How to configure @value{MSGED} for e-mail.
* Gateway Usage::               How to use @value{MSGED} to write e-mail.
@end menu

@node Gateway Principles, Gateway Configuration, Internet Gateways, Internet Gateways
@subsection How to properly address an Internet Gateway
There are various ways of designing Fidonet to Internet gateways. The most
common is the @dfn{Gatebau} standard, which among others is
implemented in the excellent gateway software Fidogate by Martin Junius. You
can find more information about Fidogate at @url{http://www.fido.de}. Various
other gateway programs more or less conform to this standard as well.

Addressing a Gatebau compatible gateway works like this: The gateway has its
own node- or point number. When you wish to write an e-mail using a standard
Fidonet editor, you have to address your netmail to this gateway node
number. As receiver's name, you can use the real name of the receiver, or you
can use @samp{UUCP}, if the real name of the receiver is unknown. Some
not-so-smart gateway software requires that you always use @samp{UUCP} as
receiver's name. - In order to tell the gateway the e-mail address that the
mail should be delivered to, the very first line of your message must contain
the e-mail address of the receiver, preceded by @samp{To:}. The e-mail
address can be specified in three different forms. Here are three possible
first lines of gateway-addressed netmails:

@example
To: juser@@somedomain.com
To: juser@@somedomain.com (Joe User)
To: Joe User <juser@@somedomain.com>
@end example

The last of these forms is not supported by some older gateway
software. - The @samp{To:}-line must be followed by an empty line, and then you
can begin with your message text. A complete e-mail addressed to an internet
gateway at @samp{2:99/999.0} could look this:

@example
==========Message Header==================
From:    Bill Sysop, 2:99/123.0
To:      UUCP, 2:99/999.0
Subject: This is a test e-mail
==========Message Body====================
To: juser@@somedomain.com (Joe User)

Hello Joe!

This is a test.

Regards,
Bill.
@end example

Receiving e-mail from the gateway is similar: You receive an e-mail from the
gateway node or point, and in the mail boday, the first line will contain a
@samp{From:}-line which designates the e-mail address the mail was
from. Sometins, the @samp{From:}-line is followed by a @samp{Reply-to:} line,
which indicates that the sender wishes to receive any answers at the e-mail
address shown in the @samp{Reply-to:}-line rather than at the e-mail address
shown in the @samp{From:}-line. Here is an example:

@example
==========Message Header========================
From:    Joe User, 2:99/999.0
To:      Bill Sysop, 2:99/123.0
Subject: Re: This is a test e-mail
==========Message Body==========================
From: Joe User <joe@@some-machine.somedomain.com>
Reply-To: Joe User <juser@@somedomain.com>

Hello Bill!

I received your test e-mail without problems.

Regards,
Joe.
@end example

This interface works with every stone-age Fidonet editor, but it is
clumsy. When replying to an e-mail that came through a gateway, for example,
you would have to remember the sender's e-mail address, and when writing the
reply, you would have to manually insert a correct @samp{To:}-line, just to
name one problem.

Therefore, @value{MSGED} can do the work for you. If properly configured,
@value{MSGED} will to the job of interpreting and inserting @samp{From:},
@samp{Reply-To:} and @samp{To:} lines. With gateway support turned on,
writing an e-mail with @value{MSGED} is just as easy as writing a fidonet
netmail. In the following, we will see how to configure @value{MSGED} for
gateway support and how to use these features.

@node Gateway Configuration, Gateway Usage, Gateway Principles, Internet Gateways
@subsection How to configure @value{MSGED} to use an Internet Gateway
In order to do the gateway addressing stuff for you, @value{MSGED} needs to
know which gateway you wish to use for sending e-mail. @value{MSGED} will
recognise gated e-mail no matter which gate it comes from, but it must be
told which gateway can be used to send replies and new e-mail, because most
gateways require that you pay some sort of registration fee before you can
use them for sending mail.

The @code{UUCP} keyword is used to tell @value{MSGED} the node number of your
internet gateway (@pxref{UUCP,,The @code{UUCP} Keyword}). It simply takes
this node numer as argument. Example:

@example
UUCP 242:4900/99.0
@end example

The @code{UucpName} keyword is used to tell @value{MSGED} the name that must
be in the receiver's name field in a netmail sent to the gateway. For older
gateways, you should use

@example
UucpName UUCP
@end example

If your gateway is running Fidogate or another more advanced gateway program,
you should use

@example
UucpName *
@end example

This enables real name mode, i.E., mail addressed to the gateway will have
the real name of the receiver in the receiver's name field instead of the
pseudo name @samp{UUCP}. The advantage of this is that your message templates
will generate strings like @samp{Hello Joe!} instead of @samp{Hello UUCP!}
@dots{}

If you want to insert Reply-To lines into outgoing mail, and if your gateway
supports them, of course, you might also wish to use the @samp{UucpReplyTo}
keyword. Reply-To lines are used to tell the receiver's software that replys
should be directed to an alternative e-mail account instead of the one you
are mailing from. @xref{UucpReplyTo,,The @code{UucpReplyTo} Keyword}, for more information.

There is yet another task to be done before you can use the gateway
addressing features of @value{MSGED}. For historical reasons, the gateway
addressing features are disabled by default, and you have to enable them on a
per-area basis.

Unless you have special needs, it is best to enable the gateway addressing
features for @emph{all} areas, because a lot of fidonet areas are gated to
internet somewhere. You do this by adding the @samp{u} flag to every area
that you have manually defined in the @value{MSGED} configuration file, and
by specifying @code{AreaFileFlags u} at the beginning of the configuration
file in order to set the @samp{u} flag for all area definitions that are
imported from your tosser configuration file. @xref{Area
Definitions,,Defining Message Areas}, for more information on message area
flags.

@node Gateway Usage,  , Gateway Configuration, Internet Gateways
@subsection Using Internet Gateays with @value{MSGED}
Once you have configured @value{MSGED} with the data of the gateways that you
wish to use and turned on the @samp{u} flag for all areas, writing e-mail is
very simple. When entereing a message, you just have to enter a valid e-mail
address instead of a user name. If @value{MSGED} recognises a valid e-mail
address, it will not look up this name in the nodelist or prompt you for a
node number, but it will automatically address the mail to the configured
gateway nodenumber and generate the necessary @samp{To:}-line. The
@samp{To:}-line will not even be shown to you, unless you have the
@code{ShowNotes} switch on (@pxref{List of Switches,,List of available
switches}).

Reading e-mail that comes from any internet gateway is equally simple. If the
@samp{u} flag is set for an area, @value{MSGED} will automatically recognise
@code{From:} and @code{Reply-To:} lines and hide them from you. Instead of
displaying the gateway pseudo user name and node numer, it will display
the e-mail address that the mail is coming from in the message header field.

@value{MSGED} also supports newsgroups, i.E. echomail areas that are being
received from an internet gateway, as long as the @samp{u} flag ist turned on
for these areas. In newsgroups, @value{MSGED} will handle mails (postings)
just as in netmail areas, i.E. it will display the sender's e-mail address in
the message header. If you do a private reply (i.E. a reply to a netmail area
using @key{Alt}-@key{N}), the e-mail reply will correctly be addressed to
your favorite internet gateway.

@node Keyboard Reference, Configuration Reference, Advanced Concepts, Top
@chapter @value{MSGED} Keyboard Reference
This chapter gives a complete listing of available keystroke combinations in
@value{MSGED}. After that, you will find instructions on how you can redefine
the keyboard to suit your preferences.

Please note: @value{MSGED} traditionally uses a DOS-ish PC keyboard with
@key{Alt} key and function keys. Unix users should refer to the Unix
installation notes before reading this chapter (@pxref{Notes on UNIX keyboard
input}).

@menu
* Arealist Keystrokes::         Keystroke combinations in the Arealist Screen
* Reader Keystrokes::           Keystroke combinations in message reading mode
* Editor Keystrokes::           Keystrokes in the internal message editor
* Redefining the Keyboard::     How to redefine the keyboard layout
@end menu

@node Arealist Keystrokes, Reader Keystrokes, Keyboard Reference, Keyboard Reference
@section Keystroke Combinations in the Arealist Screen

The arealist screen is the screen that normally shows up right after you
start @value{MSGED}. It lists all areas that you have defined in the
configuration file (@pxref{Area Definitions,,Defining Message Areas}).

The arealist screen can be navigated with the cursor keys, or you can also
navigate through the area list by simply typing in the first few letters of
the area name that you are looking for.

In addition, the following commands are available in the arealist screen:

@table @asis
@item @key{Right}
@itemx @key{Enter}
Enter the selected area

@item @key{Alt}-@key{X}
Quit @value{MSGED}

@item @key{*}
@itemx @key{Alt}-@key{T}
Scan all message areas for new messages. Depending on your setup, you will
have to do this on program startup. The scan process can be interrupted by
pressing @key{ESC}.

@item @key{#}
@itemx @key{Alt}-@key{S}
Scan message areas for new messages, but only scan areas that have not been
scanned perviously. Areas that have not yet been scanned for messages are
listed with dashes instead of message numbers in the area list.

@item @key{Ctrl}-@key{G}
Select a group. Display a menu of all message area groups. Selecting any
message are group here will result in the aralist only displaying areas that
are member of this particular group, until you use @key{Ctrl}-@key{G} again
to select another group, or to select to display members of all groups.

@item @key{Alt}-@key{0}
Display all areas (no matter which group they belong to).

@item @key{Alt}-@key{1} @dots{} @key{Alt}-@key{9}
Only display areas that are member of the 1st @dots{} 9th group. The first group
is the group which appears first in the @key{Ctrl}-@key{G} menu, and so on.

@end table

The keyboard setup of the Arealist Screen cannot be modified by the user.


@node Reader Keystrokes, Editor Keystrokes, Arealist Keystrokes, Keyboard Reference
@section Keyboard Commands and Functions in Message Reading mode
When you press @key{Enter} or @key{Right} in the arealist screen, you will
enter message reading mode. (An exception to this is if you have turned the
@code{DirectList} switch on. @xref{List of Switches,,List of available
switches}, for more details. In this case, you will enter the message list
mode instead). In the message reading mode, one message is displayed at a
time. You can scroll through the message, write new messages, jump to other
messages of the same message area, jump to other message areas, and invoke
numerous special functions.

All functions that are accessible from this mode have a unique name. Most
functions are prebound to a reasonable keycode combination, but you can
redefine the keyboard mapping by assigning other keycode combinations to
these function names (@pxref{Redefining the Keyboard,,Redefining the
Keyboard}).

@menu
* Navigation Functions::        Keystrokes for navigating through messages.
* Message Functions::           Keystrokes for entering or changing messages.
* Scanning and Searching::      Keystrokes for scanning or searching mails.
* Options Functions::           Keystrokes for changing program behaviour.
* Misc Reader Functions::       Miscellaneous other functions.
@end menu

@node Navigation Functions, Message Functions, Reader Keystrokes, Reader Keystrokes
@subsection Reader Functions for Navigation

@table @asis
@item Function: @code{down}, bound to: @key{Down}
@krindex down
Scrolls the text of the current message down.

@item Function: @code{up}, bound to: @key{Up}
@krindex up
Scrolls the text of the current message up.

@item Function: @code{help}, bound to: @key{Alt}-@key{H}
@krindex help
Displays online help on available keyboard commands.

@item Function: @code{next}, bound to: @key{Right}
@krindex next
Go to the next message in this area.

@item Function: @code{previous}, bound to: @key{Left}
@krindex previous
Go to the previous message in this area.

@item Function: @code{first}, bound to: @key{Home}
@krindex first
Go to the very first message in this area.

@item Function: @code{slast}, bound to: @key{End}
@krindex slast
Go to the very last message in this area.

@item Function: @code{link_to}, bound to: @key{Ctrl}-@key{Right}
@krindex link_to
Go to the message that is a reply to this message. If there is more than one
reply to this message, you will be presented a select box.

@item Function: @code{u-next}, bound to: @key{Ctrl}-@key{I}
@krindex u-next
Go to the message that is a reply to this message. If there is more than one
reply to this message, this function does not present a select box, but
simply jumps to the first of all replies.

@item Function: @code{link_from}, bound to: @key{Ctrl}-@key{Left}
@krindex link_from
Go to the message that this message is in reply to (if any).

@item Function: @code{next_area}, bound to: @key{+}
@krindex next_area
Go to the next message area.

@item Function: @code{prev_area}, bound to: @key{-}
@krindex prev_area
Go the the previous message area.

@item Function: @code{list}, bound to: @key{Alt}-@key{L}
@krindex list
This will display a list of all messages in this area. You can navigate
through this list with the cursor keys, tag entries by pressing space, and
apply a subset of the functions of the message reading mode (like delete,
move, etc.) to the tagged messages. You can leave the list by pressing either
@key{Enter}, which will position you to the message that was selected
in the list when pressing @key{Enter}, or by pressing @key{Esc},
which will position you to the message that was active before entering the
message list mode.

@item Function: @code{last}, not pre-bound to any key
@krindex last
Go to the last read message in this area (the message right before the first
unread message).

@item Function: @code{astart}, not pre-bound to any key
@krindex astart
Go to the message that was active when you entered this message area.

@item Function: @code{home}, not pre-bound to any key
@krindex home
Go to the first message in the current reply-chain.

@item Function: @code{back}, not pre-bound to any key.
@krindex back
Goes back to where you were in the reply chain before using the
@code{link_to} or @code{link_from} functions. Untested.
@end table



@node Message Functions, Scanning and Searching, Navigation Functions, Reader Keystrokes
@subsection Reader Functions for Entering, Modifying and Deleting Messages

@table @asis
@item Function: @code{newmsg}, bound to: @key{Alt}-@key{E} or @key{Ins}
@krindex newmsg
Enter a new message.

@item Function: @code{reply}, bound to: @key{Alt}-@key{R}
@krindex reply
Reply to the message currently displayed without quoting it.

@item Function: @code{quote}, bound to: @key{Alt}-@key{Q}
@krindex quote
Write a quoted reply to the message currently displayed.

@item Function: @code{repoth}, bound to: @key{Alt}-@key{N}
@krindex repoth
Reply to this message in a different message area. You can use this for
netmail replies as well as for moving a thread from one area to a different
one.

@item Function: @code{followup}, bound to: @key{Alt}-@key{U}
@krindex followup
Reply to this message, but address the reply to the recipient of the message
you are replying to instead of the sender.

@c{FIXME "repext", replyextra},

@item Function: @code{change}, bound to: @key{Alt}-@key{C}
@krindex change
This allows you to edit an existing message.

@item Function: @code{edithdr}, bound to: @key{Ctrl}-@key{H}
@krindex edithdr
Edit the header of the current message (but not the text).

@item Function: @code{move}, bound to: @key{Alt}-@key{M}
@krindex move
Move the message currently displayed to another area.

@item Function: @code{delete}, bound to: @key{Alt}-@key{D} or @key{Del}
@krindex delete
Delete the message currently being displayed.
@end table


@node Scanning and Searching, Options Functions, Message Functions, Reader Keystrokes
@subsection Reader Functions for Scanning and Searching for Messages
@cindex personal mail scan
@cindex new mail scan
@cindex mail scan
@cindex searching mails

@table @asis
@item Function: @code{scan}, bound to: @key{*}
@krindex scan
Scan all message areas for new messages.

@item Function: @code{scan_unscanned}, bound to: @key{#}
@krindex scan_unscanned
Scan message areas for new messages, but only scan areas that have not been
scanned previously.

@item Function: @code{pmail}, bound to: @key{Alt}-@key{P}
@cindex personal mail cscan
@krindex pmail
Personal mail scan: this scans all message areas for messages addressed to you.

@item Function: @code{spmail}, not pre-bound to any key
@krindex spmail
This scans for messages addressed to you in the current area only.

@item Function: @code{search}, bound to: @key{Alt}-@key{F}
@krindex search
@cindex searching
Allows you to search a message area for a specific keyword. The search
direction will be the direction that you previously moved into. For example,
in order to search a complete message area backwards for a certain mail, you
must press @key{End} to go to the end of the area, then press
@key{Left} in order to set the search direction to ``backwards'', and
then press @key{Alt}-@key{F} to start the search.

@item Function: @code{hdrsearch}, bound to: @key{Alt}-@key{Z}
@krindex hdrsearch
This works like @code{search}, but only scans message headers.
@end table

@node Options Functions, Misc Reader Functions, Scanning and Searching, Reader Keystrokes
@subsection Reader Functions for modifying @value{MSGED} Options

@table @asis
@item Function: @code{view}, bound to: @key{Alt}-@key{V}
@krindex view
@cindex kludge lines, showing or hiding
Toggle display of message control lines, kludge lines, etc.

@item Function: @code{config}, bound to: @key{Alt}-@key{S}
@krindex config
This function allows you to set some (but not all) of the system
switches. @xref{Switches,,Switches}, for more information.

@item Function: @code{chngaddr}, bound to: @key{Ctrl}-@key{W}
@krindex chngaddr
Change the origination address used for writing mail. You will not need this
key in normal operation, as @value{MSGED} employs an intelligent mechanism
for AKA matching.

@item Function: @code{chnodel}, bound to: @key{Ctrl}-@key{N}
@krindex chnodel
Change the currently active nodelist.

@item Function: @code{name}, bound to: @key{Ctrl}-@key{U}
@krindex name
If you have defined more than one user name with the @code{Name}
configuration keyword, you can use this function to select the name to use
when writing messages. If you have any @code{GroupSettings} keyword in your config,
this selection will only last until you enter a new area, because in such a
scenario, the username which is used is defined by the area that you are
in. If you don't have any @code{GroupSettings} keyword in your config, this selection
will last until you make a different one. @xref{GroupSettings,,The
@code{GroupSettings} keyword}, for more information.
@end table

@node Misc Reader Functions,  , Options Functions, Reader Keystrokes
@subsection Miscellaneous other Reader Functions

@table @asis
@item Function: @code{export}, bound to: @key{Alt}-@key{W}
@krindex export
@cindex printing messages
@cindex exporting message text
Export the text of the current message to a file or printer port. You will be
shown a dialog box where you can enter a filename and some other
options. @xref{Exporting and Printing}, for further information.

@item Function: @code{selchs}, bound to: @key{Alt}-@key{T}
@krindex selchs
@cindex overriding CHRS kludge
@cindex CHRS kludge, override
This will show a select box where you can manually select which codepage or
character set you think the messages that you are reading are in. You only
need this in two cases: Either when some idiot is inserting a wrong CHRS
kludge into this mail, or when a mail does not have a CHRS kludge and it is
@emph{not} written in the character set that you have specified as argument
to the @code{AssumeCharset} keyword (@pxref{AssumeCharset,,The AssumeCharset
Keyword}.

An example would be if you have configured your computer with
@samp{AssumeCharset 850} because you usually write in a Western European
language, but ocasionally read Russian echomail. Then, if the Russian mail
does not have a charset kludge, you would need to press @key{Alt}-@key{T} and
manually select @samp{CP866 2} in order to view the proper transcription of
the cyrillic text.

The selection that you make lasts until you make a differnt one, or until you
quite @value{MSGED}.

@item Function: @code{shell}, bound to: @key{Alt}-@key{O}
@krindex shell
Call an operating system shell (prompt). Under DOS, @value{MSGED} is swapped
out of memory for this.

@item Function: @code{dos}, bound to: @key{!}
@krindex dos
Directly execute an operating system command.

@item Function: @code{null}, not pre-bound to any key.
@krindex null
Simply does nothing.

@item Function: @code{exit}, bound to: @key{Alt}-@key{X}, @key{Alt}-@key{A} and @key{Esc}
@krindex exit
Leave the message reading mode. Returns to the arealist screen.
@end table

@node Editor Keystrokes, Redefining the Keyboard, Reader Keystrokes, Keyboard Reference
@section Keyboard Commands and the internal Message Editor
@value{MSGED} has a built in message editor. It is suggested that, before you
start using an external editor for writing messages, you should at least try
to use the internal message editor, because it is best suited for composing
FTN-style messages. The internal message editor is highly configurable, so you
should be able to use the internal message editor with the same keyboard
setup as your preferred external text editor.

In the following, you will be shown a complete list of available message
editor functions. These functions are pre-bound to sensible keystrokes, which
are also listed in the following table. Each message editor function has a
unique name, and using this name, you can bind this function to any keystroke
that you might estimate to be adequate. Instructions on how to do this will
be given in the following section (@pxref{Redefining the Keyboard,,Redefining
the Keyboard bindings}).

@menu
* Cursor Movement::             Keystrokes for moving the cursor.
* Killing Text::                Keystrokes for deleting text.
* Text Block Commands::         Keystrokes for cut and paste functionality.
* Miscellaneous Commands::      Other functions like saving, importing, etc.
@end menu

@node Cursor Movement, Killing Text, Editor Keystrokes, Editor Keystrokes
@subsection Editor Functions for Moving the Cursor

@table @asis
@item Functions: @code{left}, @code{right}, @code{up}, @code{down}
@keindex left
@keindex right
@keindex up
@keindex down
These functions are pre-bound to the cursor keys and move the cursor left,
right, up or down by one line.

@item Functions: @code{wordleft}, @code{wordright}
@keindex wordleft
@keindex wordright
These functions are pre-bound to @key{Ctrl}-@key{Left} and
@key{Ctrl}-@key{Right} and move the cursor to the beginning of the
previous or the beginning of the next word respectively.

@item Functions: @code{pgup}, @code{pgdn}
@keindex pgup
@keindex pgdn
These functions are pre-bound to the @key{PgUp} and @key{PgDn} (or on some
Unix boxes, @key{Prev} and @key{Next}) keys and scroll the text up or down by
one page and place the cursor accordingly.

@item Functions: @code{gobol}, @code{goeol}
@keindex gobol
@keindex goeol
These functions are pre-bound to the @key{HOME} and @key{END} keys and move
the cursor to the beginning or end of the current line.

@item Functions: @code{top}, @code{bottom}
@keindex top
@keindex bottom
These functions are pre-bound to the @key{Ctrl}-@key{PgUp} and
@key{Ctrl}-@key{PgDn} keys and move the cursor to the top or bottom
line of the current screen.

@item Functions: @code{first}, @code{last}
@keindex first
@keindex last
These functions are pre-bound to the @key{Ctrl}-@key{Home} and
@key{Ctrl}-@key{End} keys and move the cursor to the very first or
very last line of the mail that is currently being edited.

@item Function: @code{tab}, pre-bound to: @key{Tab}
@keindex tab
This function moves the cursor to the next tabulator position by inserting
whitespace characters (@emph{not} tabulator characters!) into the mail. The distance
between tabulator postitions can be adjusted with the @code{TabSize} keyword
in the configuration file (@pxref{Tabsize,,The @code{TabSize} Keyword}).

@item Function: @code{newline}, pre-bound to: @key{Enter}, @key{RET}
This function inserts a @emph{hard} carriage return and places the cursor to
the beginning of the next line. Note: Normally, hard carriage returns are
only inserted as paragraph delimiters or when posting formatted tables in
fidonet. For normal message text, you should @emph{not} press @key{Enter}
near the end of the line, but you should type a continous text (and leave the
wrapping to @value{MSGED}) and only press @key{Enter} once or twice at the
end of a paragraph. This will allow the receivers of your message to format
the message in a way that nicely fits their screen widths (not everybody is
using 80 column terminals!).
@end table

@node Killing Text, Text Block Commands, Cursor Movement, Editor Keystrokes
@subsection Editor Functions for Deleting text

@table @asis
@item Function: @code{backspace}, pre-bound to: @key{BS}
@keindex backspace
Kills the character on the left side of the cursor and moves the cursor back
one step.

@item Function: @code{del}, pre-bound to: @key{Del}
@keindex del
Deletes the character at the current cursor position.

@item Function: @code{deleol}, pre-bound to: @key{Alt}-@key{K}
@keindex deleol
Deletes all characters from the current cursor position to the end of the
line. This function has no effect if issued in an empty line.

@item Function: @code{delline}, pre-bound to: @key{Alt}-@key{D}, @key{Ctrl}-@key{Y}
@keindex delline
Deletes all characters in the current line and removes this line.

@item Function: @code{emacskill}, pre-bound to: @key{Ctrl}-@key{K}
@keindex emacskill
This function works like @code{deleol}, i.E. it kills all characters from the
current cursor position to the end of the line, but if issued in an empty
line, it removes that line. This is just what pressing
@key{Ctrl}-@key{K} does in the GNU Emacs editor.

@item Function: @code{killword}, pre-bound to: @key{Ctrl}-@key{T}
@keindex killword
Deletes all characters from the current cursor position to the end of the
current word.

@item Function: @code{undel}, pre-bound to: @key{Ctrl}-@key{U}
@keindex undel
This is a rather limited undelete function. It will restore lines that have
previously been killed with the @code{delline} function. It will not
restore single charactres that have been killed with @code{del},
@code{deleol}, @code{killword}, @code{emacskill} or similar functions.

@item Function: @code{zap}, pre-bound to: @key{Alt}-@key{L}
@keindex zap
This function is useful when using the quoted reply features. It will kill
all lines below the current cursor position that only contain quoted text
(these will usually be highlighted in a different color) until the next
unquoted line. This is useful to easily kill quoted signature text etc. Use
this to reduce the number of unnecessary quoted lines in your mails!

@end table

@node Text Block Commands, Miscellaneous Commands, Killing Text, Editor Keystrokes
@subsection Editor Functions dealing with Text Blocks
@cindex cut and paste

These functions provide cut'n'paste functionality:

@table @asis
@item Function: @code{anchor}, pre-bound to: @key{Alt}-@key{A}
This drops an anchor at the current cursor position. You have to drop two
anchors at different places, then the text between the two anchors will be
highlighted and treated as a selected text block.

@item Function: @code{cut}, pre-bound to: @key{Alt}-@key{C}
This will cut the currently selected text block (use @code{anchor} to select
a text block), i.E., it will delete all selected characters and store them in
an internal clipboard. Text that previously was stored in the clipboard will
of course be discarded.

@item Function: @code{paste}, pre-bound to: @key{Alt}-@key{P}
This will paste (insert) the text block from the clipboard (i.E. the last text
that has been cut with the @code{cut} function) at the current cursor
position.

@item Function: @code{unblock}, pre-bound to: @key{Alt}-@key{U}
Any anchors that have been dropped with the @code{anchor} function will be
removed, that is, any previously highlighted text will again be displayed
normally.

@end table

@node Miscellaneous Commands,  , Text Block Commands, Editor Keystrokes
@subsection Miscellaneous Editor Functions

@table @asis
@item Function: @code{abort}, pre-bound to: @key{ESC}
@keindex abort
Aborts the current message without saving.

@item Function: @code{bytecount}, pre-bound to: @key{Alt}-@key{B}
@keindex bytecount
Displays the number of bytes and the quote ratio in the current message.

@item Function: @code{edithdr}, pre-bound to: @key{Alt}-@key{E}
@keindex edithdr
Lets you edit the header of the message (recipient, sender and subject
information) in case you made an error when first entering the header.

@item Function: @code{export}, pre-bound to: @key{Alt}-@key{W}
@keindex export
Export the text of the current message to a file or printer port. You will be
shown a dialog box where you can enter a filename. @xref{Exporting and
Printing}, for further information.

@item Function: @code{insert}, pre-bound to: @key{Ins}
@keindex insert
This function toggles between the ``insert'' and ``overwrite'' modes of the
editor.

@item Function: @code{import}, pre-bound to: @key{Alt}-@key{I}
@keindex import
@cindex importing text files into a message
Imports text from a text file into the message. You will be shown a dialog
box where you can enter a filename.

@item Function: @code{null}, not pre-bound to any key.
@keindex null
Simply does nothing.

@item Function: @code{oscmd}, pre-bound to: @key{Alt}-@key{1}
@keindex oscmd
This allows you to enter an operating system command that will be executed
directly.

@item Function: @code{setup}, bound to: @key{Alt}-@key{T}
@keindex setup
This function allows you to set some (but not all) of the system
switches. @xref{Switches,,Switches}, for more information.

@item Function: @code{shell}, bound to: @key{Alt}-@key{O}
@keindex shell
Call an operating system shell (prompt). Under DOS, @value{MSGED} is swapped
out of memory for this.

@item Function: @code{toggleq}, bound to: @key{Alt}-@key{Q}
@keindex toggleq
This function toggles the quote state of the current line (whatever that
means ...).

@item Function: @code{quit}, bound to: @key{Alt}-@key{S}
@keindex quit
This function saves the message currently being edited and quits the internal
message editor.

@end table



@node Redefining the Keyboard,  , Editor Keystrokes, Keyboard Reference
@section Redefining the Keyboard Bindings
@cindex keyboard bindings, redifining
@cindex redef

If you are dissatisfied with the default keyboard bindings, you can easily
change the keyboard layout. Each of the message reader and message editor
keyboard functions that have been listed on the previous pages can be
assigned an arbitrary keystroke using the @code{ReadKey} and @code{EditKey}
configuration keywords. The syntax of these commands is as follows:

@example
EditKey @var{keycode} @var{function-name}
ReadKey @var{keycode} @var{function-name}
@end example

The @var{keycode} parameter designates wich keystroke you want to
redefine. In order to find out the key code matching a certain keystroke,
invoke the executable of @value{MSGED} with the @samp{-k} option. You can
then press the desired keystroke, and @value{MSGED} will print out the key
code that you have to use as @var{keycode} parameter in the configuration
file. Here is an example session:

@example
[R:\mailer\msged]msgedp -k
Displaying keyboard scan codes in hexadecimal form.

Press any key or key combination, or 'q' (lowercase 'Q') to exit.
Key: 0x2100
Key: 0x0071 (q)
@end example

I pressed @key{Alt}-@key{F} and @kbd{q} to reproduce this
output. From the output, we can see that @key{Alt}-@key{F} has the
keycode @samp{0x2100}, and @kbd{q} has the keycode
@samp{0x0071}. Keycodes might vary depending on your hardware and operating
system. Also, on UNIX consoles sometimes keys are not mapped correctly at
all, in which case different key combinations might have the same key
code. If you find one where this is problematic, contact me for a bug report.

Now that you know the proper keycode, you can assign it to any reader or
editor function. @xref{Reader Keystrokes,, Keyboard Commands and Functions in
Message Reading mode}, for a complete list of available keyboard functions
for message reading mode. @xref{Editor Keystrokes,, Keyboard Commands and
Functions in the internal Message Editor}, for a complete list of available
keyboard functions in the built-in message editor.

As an example, let us assign the keystroke
@key{Alt}-@key{F} to the @samp{wordright} editor function:

@example
EditKey 0x2100 wordright
@end example

With this line in your configuration file, you will be able to press
@key{Alt}-@key{F} in order to move the cursor to the beginning of the
next word.

@node Configuration Reference, Compiling, Keyboard Reference, Top
@chapter @value{MSGED} Configuration Reference
@value{MSGED} has to be configured using a configuration file. This is a
plain text ASCII file containing a list of keywords, settings and switches
that define the behaviour of @value{MSGED}. The configuration file is named
@file{msged.cfg} and should normally be placed in the current working
directory of @value{MSGED}. (On Linux/Unix, it is named @file{.msged} instead
and placed in your home directory).

This chapter describes the syntax of the configuration file and lists all
avilable keywords and switches in alphabetical order.

@menu
* Syntax::                      Configuration file syntax
* Keywords::                    Keywords for use in the configuration file.
* Switches::                    Switches for use in the configuration file.
* Conditionals::                Conditional Statements (IF/ELSE/ENDIF).
* Area Definitions::            How to define message areas
@end menu

@node Syntax, Keywords, Configuration Reference, Configuration Reference
@section Configuration File Syntax
@cindex environment variables, using
@cindex comments, configuration file
Each line in the configuration file should start with a keyword. Each
keyword can be followed by zero or more free-form parameters.

A special case of a keyword is the @samp{switch} keyword. Using the
@samp{switch} keyword, a switch can be turned either on or
off. @pxref{Switches}, for more information.

When parsing the config file, lines that start with a semicolon or with a
semicolon preceeded only by whitespace are treated as comments.

Within the configuration file, you may use environment
variables. Enclose the name of the environment variable within percent
signs. For example, if you give a command like @samp{"Areafile
%MAILBOX%\squish\squish.cfg"}, the string @samp{%MAILBOX%} would be
replaced with the value of the environment variable @samp{MAILBOX}.

You can also disable or enable certain parts of the configuration file based
on the value of environment variables or on the operating system by
using Conditionals. @xref{Conditionals, Conditional Statements in the
Configuration File}, for more information.

@node Keywords, Switches, Syntax, Configuration Reference
@section Configuration File Keywords
The following keywords can be used in the configuration file. Keywords
are generally case-insensitive.

@menu
* Address::                     Specifying your FTN AKAs.
* Alias::                       Your personal address book.
* Alterfunc::
* AreaExcl::                    Excluding areas from the area list.
* Areafile AreaFileFlags and AreaDesc::  Reading a tosser config file.
* AssumeCharset::               Workaround for mails without CHRS kludges.
* CharsetAlias::                About IBMPC 2 and other wrong CHRS kludges.
* Color::                       Configuring the screen colors.
* Colour::
* CurStart/CurEnd::             Configuring the cursor shape.
* Domain::                      About Domain Gating.
* EditKey::                     Configurint the editor's keyboard layout.
* Editor::                      Selecting the internal or an external editor.
* EnableSC::                    Enabling input of ``Umlauts'' on Unix.
* Fido::                        Specifying a Fido *.MSG format mail area
* FreqArea::                    Specifying an area to place file requests in.
* FreqFlags::                   Specifying flags for file request messages.
* Function::                    Creating keyboard macros.
* Gate::                        Enabling Domain- and/or Zone gating.
* Group::                       Defining groups and adding areas to groups.
* GroupSettings::               Different templates for different areas.
* HelpFile::                    Enabling online help.
* Include::                     Including other configuration files.
* Jam::                         Specifying a Jam format mail area.
* Lastread::                    Handling of the lastread pointer.
* MaxX and MaxY::               Hard-wiring the terminal size.
* MountDir::                    DOS to Unix path translation.
* Name::                        Configuring the Sysop's name.
* NodePath::                    Where to find the nodelist files.
* Nodelist::                    Configuring a V7 nodelist index.
* Origin::                      Choosing one or multiple origin lines.
* Outfile::                     Selecting a default export file name.
* OutputCharset::               Selecting the charset to use for umlauts.
* Printer::                     Configuring the default printer.
* PrivateNet::                  Nobody needs this.
* Quick::                       Specifying a QuickBBS/Hudson format mail area.
* QuickBBS::                    Specifying a QuickBBS/Hudson format mail area.
* Quote::                       Configuring the quote characters.
* QuoteRight::                  Configuring the right margin for quoting.
* ReadKey::                     Modifying the keyboard layout.
* Readmap::                     Where READMAPS.DAT and WRITMAPS.DAT are found.
* Right::                       Selecting the right margin for message display.
* RobotName::                   Do not use templates for Areafix mails :-)
* Scan::                        Enabling auto-scan on program startup.
* SoftCrXlat::                  How to treat code 0x8D (e.g. cyrillic En).
* SortAreas::                   Sort message areas by name or group.
* Squish::                      Specifying a Squish format mail area.
* SwapPath::                    DOS users need this @dots{}
* Switch::                      Turning configuration switches on or off.
* Tabsize::                     How many spaces shall a @key{Tab} key insert?
* Template::                    Signoff, Signature, et cetera.
* TossLog::                     Creating @file{ECHOTOSS.LOG} entires.
* UserList::                    Using a @file{FIDOUSER.LST} sysop list.
* UserOffset::                  Each user has a different lastread pointer.
* UUCP::                        Configuring your internet gateway.
* UucpName::                    Configuring your internet gateway.
* UucpReplyTo::                 Redirecting e-mail replies.
* Writemap::                    Where READMAPS.DAT and WRITMAPS.DAT are found.
@end menu


@node Address, Alias, Keywords, Keywords
@subsection Address
@findex Address
@table @asis
@item Syntax:
@code{Address @var{AKA}}
@item Example:
@code{Address 2:2476/418.0}
@end table

The @code{Address} command specifies your FTN network address.
@var{AKA} is a FTN network address with up to five dimensions. The
@code{Address} keyword can be repeated as often as is desired to specify
multiple addresses.

@node Alias, Alterfunc, Address, Keywords
@subsection Alias
@findex Alias
@table @asis
@item Syntax:
@code{Alias @var{alias} "@var{name}" @var{address} [@var{attribute} ["@var{subject}"]]}
@item Examples:
@code{Alias tobias "Tobias Ernst" 2:2476/418.0}
@item
@code{Alias tobi "tobi@@bland.fido.de" UUCP}
@item
@code{Alias af "Areafix" 2:2476/418.0 p "PASSWORT"}
@end table

Aliases are used to simplify the entry of new messages. When you enter a new
message and type in the previously defined @var{alias} into the name field,
all the other fields will be filled in with the values that you have provided
in the alias definition. You must at least specify the sysop's @var{name} in
quotation marks and the corresponding FTN @var{address} in up to five
dimensions.

Alternatively, you may specify @samp{UUCP} as @var{address}. In this case,
the @var{name} field is interpreted as an internet e-mail address and the
mail is addressed to the corresponding gateway.

Optionally, you may also specify one or more message attributes and a message
@var{subject}. The @var{attribute} field is a combination of one or more of the
following letters:

@table @code
@item p
private
@item h
hold
@item c
crash
@item k
kill/sent
@item n
normal (no attributes)
@end table

Note that you must always specify at least one message attribute
(at least @samp{n}) if you want to specify a subject.


@node Alterfunc, AreaExcl, Alias, Keywords
@subsection Alterfunc
@findex Alterfunc
This keyword is presently undocumented.

@node AreaExcl, Areafile AreaFileFlags and AreaDesc, Alterfunc, Keywords
@subsection AreaExcl
@cindex excluding certain areas
@cindex areas, excluding from display
@findex AreaExcl

@table @asis
@item Syntax:
@code{AreaExcl @var{pattern}}
@item Example:
@code{AreaExcl ALT.BINARIES.*}
@end table

This keyword is used to exclude certain areas from the area selection
menu. All area names that match @var{pattern} will not be displayed in the
area selection menu and thus will not be accessible. The @var{pattern}
parameter may be a simple area name or a wildcard pattern containing the
joker characters @samp{*} and @samp{?}.

You must specify the @code{AreaExcl} keyword in the configuration file
@emph{before} the @code{Squish}, @code{Fido}, @code{Quick} and
@code{Areafile} keywords.

@node Areafile AreaFileFlags and AreaDesc, AssumeCharset, AreaExcl, Keywords
@subsection Areafile, AreaFileFlags and AreaDesc

These keywords are documented in the section about area configuration
(@pxref{Areafile Parsing,,Reading a Tosser Configuration File (Areafile)}).

@node AssumeCharset, CharsetAlias, Areafile AreaFileFlags and AreaDesc, Keywords
@subsection AssumeCharset
@cindex default character set
@cindex character set, default for reading
@findex AssumeCharset

@table @asis
@item Syntax:
@code{AssumeCharset @var{charset}}
@item Example:
@code{AssumeCharset IBMPC}
@end table

In Fidonet mail, mails that contain special characters must carray a charset
kludge line (@pxref{Special Characters,,Using Special Characters -
The FSC 0054 Charset Kludge}). However, still a good percentage of
fidonetmail contains special characters, but no charset kludge line. Also,
people often use wrong charset kludge names.

By default, @value{MSGED} will replace all special characters with question
marks in mails without charset kludge or with unknown charset kludge,
because @value{MSGED} does not know how to properly translate such special
characters. If you do not like this, you can use the @code{AssumeCharset}
keyword to specify that @value{MSGED} should assume that all special
characters in mails that do not contain a charset kludge, or have a unknown
charset kludge, have been composed using the character set @var{charset},
and translate the special characters accordingly.

In Germany, for example, nearly all mail that contains special characters but
does not contain a charset kludge has been composed using the IBMPC character
set, so it makes sense to specify @samp{AssumeCharset IBMPC} here.

In Russia, it is best to use @samp{AssumeCharset CP866}.

@node CharsetAlias, Color, AssumeCharset, Keywords
@subsection CharsetAlias
@findex CharsetAlias

@table @asis
@item Syntax:
@code{CharsetAlias @var{charsetInMail} @var{charsetAsKnownToMsged}}
@item Example:
@code{CharsetAlias IBMPC CP850}
@end table

As already noted in the previous section, a lot of mails in Fidonet contain
charset kludges that do not adhere to the current FTSC standard for 8-bit
character transport, @code{FSP1013}. Using the @code{CharsetAlias} keyword,
you can tell @value{MSGED} how to map character set kludge names
commonly found in mails to their official names.

The most prominent example is the @code{IBMPC} charset kludge. This kludge
line is now obsoleted and should be replaced by @code{CPxxx} charset
kludges, where @code{xxx} stands for the codepage that is used. @value{MSGED}
@emph{only} knows about the new @code{CPxxx} charset. Therefore, you need to
use @code{CharsetAlias} to tell @value{MSGED} how to interprete a
@code{IBMPC} charset kludge. Now this is difficult, because, if the
@code{IBMPC} charset kludge is not followed by a @code{@@CODEPAGE} kludge
line, you do not know which codepage the author of the mail has
used. According to @code{FSC0054}, he should have used codepage 437, but in
Western Europe for example the majority of users put @code{IBMPC} charset
kludge lines into their mails, but actually use codepage 850, and in Russia
the same applies for codepage 866. This means that you have to do
assumptions. A users who reads mainly texts in Western European languages
should probably use @code{CharsetAlias IBMPC CP850}, while when you intend to
read Russian echomail, @code{CharsetAlias IBMPC CP866} is probably the right
thing to do.

Also, some users are simply using fantasy names for the @code{CHRS} kludge
line. The following commands have also proven to be handy:

@example
CharsetAlias +7_FIDO CP866
CharsetAlias RUFIDO CP866
CharsetAlias ASCII CP437
@end example

@node Color, Colour, CharsetAlias, Keywords
@subsection Color
@cindex color settings
@cindex colour settings
@findex Color

@table @asis
@item Syntax:
@code{Color @var{item} @var{foreground} _@var{background}}
@item Example:
@code{Color MainNorm White _Black}
@end table

Use this to customize the colors that @value{MSGED} uses. For a list of
available color values and items, refer to the sample color scheme files.

If you are using the Unix version of @value{MSGED}, you must also switch on the
@code{Colors} switch in order to get a non-monochrome display. @xref{Colors
in the Unix version,, Colors in the Unix version}, for more information.

@c FIXME better documentaiton of color shemes

@node Colour, CurStart/CurEnd, Color, Keywords
@subsection Colour
@findex Colour

@code{Colour} is an alternative name for the keyword @code{Color}
(@pxref{Color, The @code{Color} Keyword}.

@node CurStart/CurEnd, Domain, Colour, Keywords
@subsection CurStart, CurEnd
@findex CurStart
@findex CurEnd
@cindex cursor shape
@table @asis
@item Syntax:
@code{CurStart @var{row}}
@item
@code{CurEnd @var{row}}
@item Example:
@code{CurStart 5}
@item
@code{CurEnd 7}
@end table

This keyword is used to control the shape of the cursor (only on terminals
and operating systems that support it). On typical DOS-like consoles, the
cursor constis of 8 rows, labelled top-down from zero to seven. You can
specify a cursor start @var{row} and a cursor end @var{row}. The
@value{MSGED} default values of 6 (start) and 7 (end) result in a standard
"underline" cursor.

If you are using @value{MSGED} with a monochrome display adapter like MDA,
MGA or HGC, the cursor consists of 14 rows instead of 8. There, you will have
to use the @code{CurStart} and @code{CurEnd} keywords to produce a sensible
cursor shape. Values of 11 for start and 12 for end are suggested for mono
display adapters.

@node Domain, EditKey, CurStart/CurEnd, Keywords
@subsection Domain
@findex Domain
@cindex domain gateway
@table @asis
@item Syntax:
@code{Domain @var{5d-address}}
@item Example:
@code{Domain 8:123/45@@rbbs}
@end table

Messages sent with the destination domain equal to the domain of one of the
configured domain gates will always be sent to the domain gate with a @@DOMAIN
kludge inserted into the message.  To enable domain gating, you must
configure all domain gates you are using in your config file by using a
@code{Domain} keyword with the full 5D address of the domain gateway
(including the domain that this gate is gating for) as @var{5d-address}
parameter for each domain gate. You also must have the @code{Gate} config
verb set to either @samp{both} or @samp{domains}. @xref{Gate,, The
@code{GAte} Keyword}, for more information.

With this done, @value{MSGED} will gate any messages being saved with a
destination domain listed as one of the gates.  Note that for this to occur,
the destination domain must be different than your own.

Confused? Luckily enough, most users don't have to deal with domain gating
@dots{}

@node EditKey, Editor, Domain, Keywords
@subsection EditKey
@findex EditKey
@table @asis
@item Syntax:
@code{EditKey @var{key} @var{function}}
@end table

This keyword is used to redefine the keyboard layout in the internal message
editor. @xref{Redefining the Keyboard,,Redefining the Keyboard}, for more information.

@node Editor, EnableSC, EditKey, Keywords
@subsection Editor
@findex Editor
@cindex external editor
@table @asis
@item Syntax:
@code{Editor @var{program-name}}
@item Example:
@code{Editor c:\boxer\b2.exe}
@end table

This command allows you to specify an external editor to use when writing
messages.  The editor program (specified as executable filename with full
path as the @var{program-name} parameter) must accept a filename as the first
and only parameter.

Before you decide to use an external editor, you might first want to look at
the built-in editor of @value{MSGED}. Using the @code{EditKey} keyword, the
built-in editor is highly configurable to emulate the keystroke combination
that you are used to use from your preferred external editor, and you can
safe a lot of unnecessary overhead and gain a lot of comfort when using the
internal editor as compared to the external one.

@node EnableSC, Fido, Editor, Keywords
@subsection EnableSC
@findex EnableSC
@cindex special characters, on UNIX
@table @asis
@item Syntax:
@code{EnableSC [@var{string}]}
@item Example:
@iftex
@code{EnableSC} "a@"o@"u@"A@"O@"U
@end iftex
@ifinfo
@code{EnableSC} @var{type-national-characters-here}
@end ifinfo

@end table

(The example from above will only look correct in the TeX (@file{.DVI} or
@file{.PS} or @file{.PDF}) edition of this document.)

This keyword is only relevant on UNIX. On UNIX, when using a VT100, xterm, or
similar terminal, @key{Alt} or @key{Meta} key combinations generate the same
key codes like national characters with ASCII values greater than 127. This
is a problem, because on the one hand, @value{MSGED} relies on combinations
of normal keys with Alt, but on the other hand, you probably want to use
national special characters in your mail.

By default, the UNIX version of @value{MSGED} enables all @key{Alt} key
combinations and disables all national special characters.

You can revert this behaviour by specifying @code{EnableSC} without
parameters. This will cause @value{MSGED} to interpret all high ASCII
keycodes as national special characters, instead of @key{Alt} key
combination. You'll then have to use the  @key{ESC} key to emulate all
@key{Alt} key cominations. This is probably what users of complete
high ASCII alphabets, like the cyrillic alphabet, will wnat to do.

On the other hand, if your language only has few special characters, you can
also use the @code{EnableSC} keyword to selectively enable some national
special charcters. All special characters that occur in the @var{string}
given as argument will be interpreted as charcters rather then @key{Alt} key
combinations.

The example from above enables all German national charcters. The only
relevant @key{Alt} key combination that you will loose by enabling those
characters is @key{Alt}-@key{V} (``show notes''). This function is also
available by pressing @key{Alt}-@key{K} (``show kludges''), so that
isn't a problem.

Note that you will have to use an editor that allows the input of national
charcters in order to generate the necessary configuration file
entry. @code{vi} should be able to do this, as well as @code{joe -asis}. If
you are not able to type those characters in vi, you should not even try to
type them in @value{MSGED} @dots{}

If you need information on how to set up a FreeBSD system to correctly
process special national characters, you can f`req @file{syscons.tgz} at
2:2476/418.

@node Fido, FreqArea, EnableSC, Keywords
@subsection Fido

This keyword is described in the section about manual message area definition
(@pxref{Manual Area Definition,, Manual Area Definition}).

@node FreqArea, FreqFlags, Fido, Keywords
@subsection FreqArea
@findex FreqArea
@cindex file requests, message area
@table @asis
@item Syntax:
@code{FreqArea @var{area-tag}}
@item Example:
@code{FreqArea NETMAIL}
@end table

This keyword defines the message area where file request messages will be
written when the @key{Ctrl}-@key{F} function is invoked.  If not
defined, @samp{NETMAIL} is the default areatag.  Only one file request area
may be defined.

@node FreqFlags, Function, FreqArea, Keywords
@subsection FreqFlags
@findex FreqFlags
@cindex flavour, of file requests
@cindex flags, for file requests
@cindex file requests, flags
@table @asis
@item Syntax:
@code{FreqFlags @var{flag} [@var{flag} @dots{}]}
@item Example:
@code{FreqFlags CRA K/S}
@end table

This keyword defines the flags that are set for file request message
generated using the @key{Ctrl}-@key{F} feature. If not defined, @samp{DIR
K/S} is the default. The @samp{FRQ} flag will be appended in any case, so
will the local message area flags (usaually @samp{PVT LOC}). Any flags
defined in FSC 0053 are electible, yet the only ones that are useful for file
request messages are listed below.

@example
HLD @r{place file request on hold for the caller}
CRA @r{crash delivery, dial out as soon cost setup permits it}
IMM @r{immediate deilivery, dial out immediately}
DIR @r{direct mail, you have do dial out manually}
K/S @r{kill the file request mail after it has been sent}
@end example

You should at least specify one flag out of @samp{HLD CRA IMM DIR}, because
if none of these is present, the file request will be routed and consequently
be ignored by the destination system.

If you want to specify multiple file request flags, separate them by white
spaces, as shown in the example above.

@node Function, Gate, FreqFlags, Keywords
@subsection Function
@findex Function
@cindex function key macros
@cindex macros
@cindex keyboard macros
@table @asis
@item Syntax:
@code{Function @var{number} @var{keystrokes}}
@item Example:
@code{Function 11 \0x17D:\\text\\*.*^M}
@end table

A function key macro is a predefined keystroke sequence that is assigned on a
function key. If you press this function key, @value{MSGED} will do exactly what it
would have done if you have typed in all the keystrokes of this macro
manually.

The following function key numbers (to be used as the @var{number} parameter)
are available:

@table @code
@item 0
Execute this macro at program startup.
@item 1 .. 10
@key{F1} .. @key{F10}
@item 11 .. 20
@key{Shift}-@key{F1} .. @key{Shift}-@key{F10}
@item 21 .. 30
@key{Ctrl}-@key{F1} .. @key{Ctrl}-@key{F10}
@item 31 .. 40
@key{Alt}-@key{F1} .. @key{Alt}-@key{F10}
@end table

Note that function key numbers 11 through 40 might not work on Unix.

When using key scancodes in a macro, you must escape them with a backslash
character (@samp{\}).  If you wish to have a literal backspace character
appear in the macro string (e.g. if it's needed as part of a path to a
file), use two backslash characters, like in the example above.

The example from above will assign @key{Shift}-@key{F1} to display a
pick list of the files in the @file{D:\TEXT} directory.  After the list is
displayed, you may select a file to import into a message while in Msged's
internal editor.  Note that control characters in a macro such as ^M
(Enter) must be written in UPPER case.

@node Gate, Group, Function, Keywords
@subsection Gate
@findex Gate
@cindex zone gating
@table @asis
@item Syntax:
@code{Gate @var{what}}
@item Examples:
@code{Gate Zones}
@item
@code{Gate Domains}
@item
@code{Gate Both}
@item
@code{Gate Ask}
@end table

The @var{what} parameter to the @code{Gate} keyword specifies if
@value{MSGED} should do zone gating (@code{Gate Zones}), domain gating
(@code{Gate Domains}), or both (@code{Gate Both}). If you specify @code{Ask}
as parameter (this is also the default), you will be asked if you want to use
zone gating for each inter-zone mail that you write.

This has nothing to do with internet gateways!

Domain gating is explained in detail in the section about the @code{Domain}
keyword (@pxref{Domain,,The @code{Domain} Keyword}).

Zone gating works like this: If you write a mail to a node in a zone
different from your own, and zone gating is enabled, the mail will not be
addressed to the receiver in the other zone, but it will be addressed to that
zone's zone gate (which also has an address inside your own zone). The
address of the true receiver will be encoded in an @@INTL kludge
line.

If you don't have a direct inter-zone link set up in your tosser, you may
always enable zone-gating on with the @code{Zone} parameter. All mail that
crosses zone boundaries will then be sent via the zone gate, which is by far
the most reliable mail to send inter-zone mail. If, on the other hand, you do
have a direct inter-zone netmail link, you need the @code{Ask} parameter,
because then you must decide for each netmail individually if it shall be
sent directly via this link, or (probably because it is for a zone not
covered by this link, or because the link partner has not agreed to forward
mail not destined for himself) must be sent via the zone gate.

Turning zonegating off with the @code{None} parameter is not at all
recommended. If you send inter-zone mail wihtout zone-gating, there only need
be one single tosser on the routing path which does not recognise @code{INTL}
kludges, and the mail will probably disappear. So, don't turn off zonegating
unless you have direct links for the destination zones you are writing mail to.

@node Group, GroupSettings, Gate, Keywords
@subsection Group
@findex Group
@table @asis
@item Syntax:
@code{Group "@var{groupname}" [@var{pattern}]}
@item Example:
@code{Group "OS/2 Echos" *OS2*}
@end table

This command is used to set up area groups and add areas to those
groups. @xref{Manual Groups,,Manually Defining and Assigning Groups}, for a
full documentation on how to use this keyword. @xref{Grouping,,Configuring and
Using Message Area Groups}, for an overview on the group concept of
@value{MSGED}.

@node GroupSettings, HelpFile, Group, Keywords
@subsection GroupSettings
@findex GroupSettings
@table @asis
@item Syntax:
@code{GroupSettings "@var{groupname}" @var{name-index} @var{template-index}}
@item Example:
@code{GroupSettings "OS/2 Echos" 0 1}
@end table

This command allows you to select different user names and/or template files
based on the group a message area belongs to.  For example, you might wish to
use a different signoff in OS/2-related areas (probably stating your TeamOS/2
number) than in other areas. Or, if you are moderator in a certain area, you
might want to use the user name "Moderator" instead of the user name that you
are using in normal areas.

The @var{groupname} parameter to the @code{GroupSettings} command specifies
the name of the group. @xref{Group,, The @code{Group} Keyword}, for
information on how to define groups and add areas to those groups.

The @code{name-index} parameter then specifies the index number of the user
name that should be used for all areas in this group. User names are counted
from zero upwards, so if you have two or more @code{Name} keywords in your
config file, the name specified with the first @code{Name} keyword will have
an index number of 0, the second will have 1, and so one. @xref{Name,,The
@code{Name} Keyword}, for more information.

The @code{template-index} number defines which message template file should
be used for areas belonging to this group. The first message template file
that you have specified with the @code{Template} keyword has number 0, the
second has number 1, and so on. Note that if you want to specify multiple
template files, you have to repeat the @code{Template} keyword for each
file. The @code{Template} keyword itself can only take one argument.
@xref{Template,,The @code{Template} Keyword}, for more information.

@node HelpFile, Include, GroupSettings, Keywords
@subsection HelpFile
@findex HelpFile
@table @asis
@item Syntax:
@code{HelpFile @var{file-name}}
@item Example:
@code{HelpFile e:\fido\msged\msghelp.dat}
@end table

Specify the complete path and file name of the compiled @value{MSGED} help
file here. It is usally named @file{msghelp.dat}, or @file{~/.msged.help} on
Unix.

@node Include, Jam, HelpFile, Keywords
@subsection Include
@findex Include
@table @asis
@item Syntax:
@code{Include @var{file-name}}
@item Example:
@code{Include scheme.001}
@end table

The file specified with the @var{file-name} parameter will be read in and
parsed as a normal config file. This is often used for including color scheme
configuration files.

@node Jam, Lastread, Include, Keywords
@subsection Jam

This keyword is described in the section about manual message area definition
(@pxref{Manual Area Definition,, Manual Area Definition}).

@node Lastread, MaxX and MaxY, Jam, Keywords
@subsection Lastread
@findex Lastread
@table @asis
@item Syntax:
@code{Lastread @var{lastread-file}}
@item Example:
@code{Lastread lastread}
@end table

The @var{lastread-file} parameter of this keyword specifies the name of the
default ``lastread file'' that is used to store lastread pointers for Fido
*.MSG areas. This keyword gives the default filename for those username
entries without individual lastread files configured via the @code{Name}
keyword. @xref{Name,,The @code{Name} Keyword}, for more information.

If you do not specify this keyword, a default value of @samp{lastread} is
assumed, which is a very resaonble default. Hence, you normally do not need
this keyword.

@node MaxX and MaxY, MountDir, Lastread, Keywords
@subsection MaxX, MaxY
@findex MaxX
@findex MaxY
@cindex screen size
@table @asis
@item Syntax:
@code{MaxX @var{columns}}
@item
@code{MaxY @var{rows}}
@item Example:
@code{MaxX 80}
@item
@code{MaxY 25}
@end table

The @code{MaxX} and @code{MaxY} keywords are used to define the screen or
text window size @value{MSGED} is running in. Normally this will be
autodetected and @value{MSGED} will automatically use the full window
size. For example, on OS/2, you could execute @samp{MODE CO100,40} and then
start @value{MSGED}, and it will automatically use 100 columns and 40 rows.

In some cases, however, the autodetection fails, or you might not want
@value{MSGED} to use the full screen size. In this case, you have to define
the screen or window size manually with the @code{MaxX} and @code{MaxY}
parameters.

@node MountDir, Name, MaxX and MaxY, Keywords
@subsection MountDir
@findex MountDir
@table @asis
@item Syntax:
@code{MountDir @var{unix-path} @var{dos-path}}
@item Example:
@code{MountDir /mnt/c c:\}
@end table

This keyword is used to tell the Unix version of @value{MSGED} how it can
translate DOSish pathnames found in @file{squish.cfg}, @file{fastecho.cfg} or
even @file{msged.cfg} files that are mounted via NFS, rumba or smbfs from a
DOS, OS/2 or Windows machine.

Suppose you are having a message base that is stored in @samp{c:\msgbase} on
your OS/2 or Windows machine. Also suppose that your complete C: drive on the
OS/2 or Windows machine is mounted as /mnt/c on the UNIX machine. (The
Windows machine and UNIX machine can be two distinct machines connected via
network, or a single machine with multi boot, where UNIX can mount the OS/2
or DOS partitions).

You can then install @value{MSGED} on the Unix machine and let it read in the
same configuration files that are also used on the OS/2 or Windows
machine. Simply put @code{MountDir /mnt/c c:\} into your configuration
file. When @value{MSGED} is running on OS/2 or Windows, it will ignore the
keyword, but when it is running on Unix, it will know how to translate the
DOS-like filenames found in the corresponding configuration files into file
names that are correct for the UNIX system.

Please note that you can have only one @code{MountDir} statement in the
configuration file.

@node Name, NodePath, MountDir, Keywords
@subsection Name
@findex Name
@table @asis
@item Syntax:
@code{Name "@var{name}" [@var{lastread-file} [@var{user-offset}]]}
@item Examples:
@code{Name "Tobias Ernst"}
@item
@code{Name "Joe Sysop"  lastread 0}
@item
@code{Name "Jane Sysop" lastread 1}
@end table

You can specify your user name as the @var{name} parameter inside quotation
marks here. You can specify more than one user name by repeating the
@code{Name} keyword. Then, you can select which name to use during program
execution by pressing @key{CTRL}-@key{U}.

Optionally, you can use the @var{lastread-file} parameter to specify the name
of the file that stores the lastread pointers in Fido *.MSG areas. This one
should be named @samp{lastread} for the sysop. If you configure other users
with the same config file, e.g. your wife, son etc., you should give them
separate lastread file names, so that each person can have individual last
read pointers.

As a third parameter, you can specify a @var{user-offset} for each individual
name. This is used for all message base formats excpet *.MSG. Here, all users
share the same lastread pointer file (with a fixed name that cannot be
configured), but each user has a different offset into this file where he can
store his personal lastread pointer.

Normally, the sysop has a user offset of zero (which is the default for the
@var{user-offset} parameter), and each BBS user has his user number as user
offset. However, if you have two or more sysops (in this context, this simply
means persons accessing your message base directly with @value{MSGED} instead
of using the BBS), you must manually assign unique user offset numbers for
each person.

@node NodePath, Nodelist, Name, Keywords
@subsection NodePath
@findex NodePath
@cindex nodelist path
@table @asis
@item Syntax:
@code{NodePath @var{path-name}}
@item Example:
@code{NodePath e:\fido\nodelist}
@end table

@value{MSGED} can use compiled version 7 nodelists to perform nodelist
lookups. All files pertaining to all version 7 nodelists, i.E. the compiled
index files and the raw nodelist files, must be stored in the V7 nodelist
directory. The @code{NodePath} keyword is used to tell @value{MSGED} that all
v7 nodelist files reside in the directory named
@var{path-name}. @xref{Nodelist,,The @code{Nodelist} Keyword}, for more
information.

@node Nodelist, Origin, NodePath, Keywords
@subsection Nodelist
@findex Nodelist
@cindex V7 nodelist
@cindex version 7 nodelist
@cindex compiled v7 nodelist
@table @asis
@item Syntax:
@code{Nodelist @var{domain-name} @var{base-name} @var{sysop-file}}
@item Example:
@code{Nodelist fidonet nodex sysop.ndx}
@end table

@value{MSGED} can use compiled version 7 nodelists to perform nodelist
lookups. With the @code{Nodelist} keyword, you specify the v7 nodelists that
@value{MSGED} should use. All three parameters are mandatory.

The @var{domain-name} parameter specifies the name of the domain that is
used when picking which nodelist to use for address lookup if the zone number
is not unambiguous. The @var{base-name} parameter specifies the base name of
the index file minus the extension (e.g. @samp{nodex} for @samp{nodex.idx}),
and @var{sysop-file} is the name of the sysop lookup file. You must not
specify any path names for the latter two parameters - these files must
always reside in the directory pointed specified as argument to
@var{NodePath}. @xref{NodePath,,The @code{NodePath} Keyword}, for more
information.

Normally, you will compile all raw nodelists that you have into a single
v7 index. In this case, simply use the example from above. You will only have
to bother about separate indices, domain names and the like if you have two
distinct othernets with identical zone numbers.

@node Origin, Outfile, Nodelist, Keywords
@subsection Origin
@findex Origin
@cindex origin line
@cindex origin shuffling
@table @asis
@item Syntax:
@code{Origin @var{string}}
@item Example:
@code{Origin We love @value{MSGED}!}
@end table

The origin line terminates an echomail and tells the sender`s FTN
address. Thus it has an important technical function. On the other hand, the
origin line also leaves space for about 55 bytes of free-form text. They can
be used to place your BBS system's name there, but you can also place other
meaningful or meaningless messages there. The text that you specify as the
@var{string} parameter may include whitespace characters. It will simply be
copied into the origin line, but be aware of the fact that @value{MSGED}
might have to truncate the text in order to prevent the origin line from
getting longer than 79 characters.

You can use macro tokens in the origin line to provide some sort of dynamic
information. The macros will be expanded to their value when the message is
saved. The following macros can be used:

@table @code
@item @@N
full name of message receiver
@item @@F
first name of message receiver
@item @@L
last name of message receiver
@item @@Y
full name of message author
@item @@D
complete message date (as for example: @samp{24 Dec 97})
@item @@DD
message date, day number (as for example: @samp{24})
@item @@DW
message date, week day (as for example: @samp{Mon})
@item @@DM
message date, month (as for example: @samp{Dec})
@item @@DY
message date, 2 digit year (as for example: @samp{97})
@item @@D4
message date, 4 digit year (as for example: @samp{1997})
@item @@DC
message date, century (as for example: @samp{20})
@item @@T
complete message time (as for example: @samp{12:30:24})
@item @@S
message subject
@item @@A
area tag
@item @@I
message size
@item @@Q
quote ratio
@item @@@@
a single @@ character
@end table

In @value{MSGED}, you can also specify more than one @code{Origin} keyword in
the configuration file. @value{MSGED} will then automatically select a random
line out of those that you have specified each time that it has to generate
an origin line. This feature is called @dfn{origin shuffling}.

@node Outfile, OutputCharset, Origin, Keywords
@subsection Outfile
@findex Outfile
@cindex exporting mails as text
@cindex printing
@table @asis
@item Syntax:
@code{Outfile @var{file-name}}
@item Example:
@code{Outfile export.txt,t}
@end table

This keyword is used to configure the default @var{file-name} that should be
used as a default selection for exporting mails as text by pressing
@key{Alt}-@key{W}.

@node OutputCharset, Printer, Outfile, Keywords
@subsection OutputCharset
@findex OutputCharset
@cindex character set, for writing messages
@table @asis
@item Syntax:
@code{OutputCharset @var{charset}}
@item Example:
@code{OutputCharset IBMPC}
@end table

This specifies which character set should be used for writing messages with
special characters (like umlauts, accents, cyrillic letters, IBM
graphics). The mail will be converted into the given charset, and the proper
charset kludge will be appended. This does only apply to areas which have the
@samp{8} flag set, because in all other areas, the messages will always be
converted into a 7-bit ASCII representation.

The charset that you specify as @var{charset} argument must be a level 2
charset, and a matching translation table must be contained in the
@file{writmaps.dat} file. If there isn't such a table, you will only see this
from the fact that the written message will contain 8-bit characters, but no
charset kludge(!). So be careful not to misspell the option.

@xref{Special Characters,,Using Special Characters like Umlauts or Cyrillics
- The Charset Kludge}, for more information on the concept of
charset kludges. You can list all charset kludges that are listed in this
section as arguments to the @code{OutputCharset} keyword, but usually
@code{IBMPC} is the right option to choose, according with a proper
@code{CharsetAlias} definition (@pxref{CharsetAlias,,The @code{ChrasetAlias}
Keyword}). Msged TE will then also emit a proper @code{CODEPAGE} kludge. A
Russian user will probably want to use @code{CP866}. Once the @code{CPxxx}
charset kludges have found more widesprad use in Europe, @code{OutputCharset
CP850} should replace @code{OutputCharset IBMPC} also in Western European
countries.

The character set that you use for output does not need to match the charset
that your computer is using internally; @value{MSGED} will do all necessary
conversion.

@node Printer, PrivateNet, OutputCharset, Keywords
@subsection Printer
@findex Printer
@cindex Printer, configuring
@cindex Printing
@table @asis
@item Syntax:
@code{Printer @var{printer}}
@item Example:
@example
; On UNIX:
Printer -Phplj4
; On OS/2, DOS, Windows:
Printer LPT3:
@end example
@end table

This keyword is used to configure the printer that @value{MSGED} will use
when printing a message (@key{Alt}-@key{W}). The usage of this keyword
depends on your platform:

On OS/2, DOS and Windows, it specifies the special device filename for
printing. The default value is @code{PRN}. Other values that make sense are
@code{LPT1:}, @code{LPT2:} and so on.

On UNIX, @value{MSGED} prints by piping the message text into the @code{lpr}
command, and the @code{Printer} keyword is used to configure additional
options to the @code{lpr} command. By default, no additional options are
used. If, for example, you do not want to use the default queue, but the
queue named @samp{hpjl4}, you would use @code{Printer -Phplj4} in your
configuration file.


@node PrivateNet, Quick, Printer, Keywords
@subsection PrivateNet
@findex PrivateNet
@cindex privatenets
@cindex pointnets
@cindex fakenets
@table @asis
@item Syntax:
@code{PrivateNet @var{fakenet-number}}
@item Example:
@code{PrivateNet 12345}
@end table
Modern mailers, message reader/editors (including @value{MSGED}), and mail
processing programs are fully 4D address aware and do not require the
@code{PrivateNet} keyword.  However, if you are operating a point system
whose boss node uses a "fakenet" to service points, this keyword should be
used.

The @var{fakenet-number} parameter specifies the private net number number to
use for non-4D points. The fakenet point scheme was designed to work with
systems which were unable to support true points, such as BinkleyTerm 2.50
and lower.  The actual "fakenet" number and address must be assigned to you
by your boss node.

@node Quick, QuickBBS, PrivateNet, Keywords
@subsection Quick

This keyword is described in the section about manual message area definition
(@pxref{Manual Area Definition,, Manual Area Definition}).

@node QuickBBS, Quote, Quick, Keywords
@subsection QuickBBS
@findex QuickBBS
@cindex hudson message base path
@cindex HMB file path
@table @asis
@item Syntax:
@code{QuickBBS @var{path-name}}
@item Example:
@code{QuickBBS e:\fido\hmb}
@end table

In order to use a hudson message base (also known as Quick BBS message base),
you have to specify the path where the HMB files are stored using the
@var{path-name} parameter of the @code{QuickBBS} keyword. You must specify
the @code{QuickBBS} keyword in the configuration file before any @code{Quick}
or @code{AreaFile} keyword.

@node Quote, QuoteRight, QuickBBS, Keywords
@subsection Quote
@findex Quote
@cindex quote string
@table @asis
@item Syntax:
@code{Quote @var{quote-string}}
@item Example:
@code{Quote _&>_}
@end table

When quoting a mail, every line of quoted text will be prefixed with
@var{quote-string}. The following tokens inside the quote string have special
meanings:

@table @code
@item &
will be replaced with all initials of the writer of the quoted message
@item _
will be replaced with a whitespace
@item ^
will be replaced with the first initial of the writer of the quoted message
@item *
will be replaced with the second initial of the writer of the quoted message
@end table

Following common fidonet practice, you should use @samp{_&>_} as quote string.

@node QuoteRight, ReadKey, Quote, Keywords
@subsection QuoteRight
@findex QuoteRight
@cindex right margin, for quoted text
@table @asis
@item Syntax:
@code{QuoteRight @var{column}}
@item Example:
@code{Quoteright 75}
@end table

The @var{column} argument specifies the right margin to use when quoting
text. Because quoted text - in contrast to normal text - is stored with a
carriage return after each line, you should not specify a value greater than
75 in order to assure that the text can be displayed on standard 80 columns
displays without problems.

@node ReadKey, Readmap, QuoteRight, Keywords
@subsection ReadKey
@findex ReadKey
@table @asis
@item Syntax:
@code{ReadKey @var{key} @var{function}}
@end table

This keyword is used to redefine the keyboard layout in message reading
mode.  @xref{Redefining the Keyboard,,Redefining the Keyboard}, for more information.

@node Readmap, Right, ReadKey, Keywords
@subsection Readmap and Writemap
@findex Readmap
@findex Writemap
@table @asis
@item Syntax:
@example
Readmap @var{filename}
Writemap @var{filename}
@end example
@item Example:
@example
Readmap /usr/local/share/msged/readmaps.is1
Readmap /usr/local/share/msged/writmaps.is1
@end example
or
@example
Readmap  c:\msged\readmaps.850
Writemap c:\msged\writmaps.850
@end example
@end table

These keywords are used to tell @value{MSGED} where to find the character set
translation map files.
@xref{Special Characters,,Using Special Characters like Umlauts or Cyrillics
- The Charset Kludge}, for a detailed explanation.

@node Right, RobotName, Readmap, Keywords
@subsection Right
@findex Right
@cindex right margin, for normal text
@table @asis
@item Syntax:
@code{Right @var{column}}
@item Example:
@code{Right 79}
@end table

The @var{column} argument specifies the right margin to use when writing
normal text. Normally, there is no reason to use this parameter, as
@value{MSGED} will always simply use the width of the window or console it is
running in. Please note that because of the way text is stored in Fidonet
messages (carriage returns are only placed at the end of a paragraph), it is
no problem to use right margins higher than 80. Even then, users with only 80
columns will still be able to read your message nicely formatted.

@node RobotName, Scan, Right, Keywords
@subsection RobotName
@findex RobotName
@table @asis
@item Syntax:
@code{RobotName @var{name}}
@item Example:
@code{RobotName Areafix}
@end table

Using the @var{name} parameter of the @code{RobotName} keyword, you can
specify names of robot machines like Areafix, Allfix, VoteMgr and so on. Each
@code{RobotName} keyword only accepts a single @var{name} parameter, but you
may repat the @code{RobotName} keyword as often as necessary.

The reason for defining the names of common fidonet robots is the following:
When writing a mail that is addressed to a user name that matches one of the
defined robot names, @value{MSGED} will not insert the usual message
template. (VoteMgr will be confused if the first line in your Message is
"Hello VoteMgr" instead of the expected meta command @dots{}).

@node Scan, SoftCrXlat, RobotName, Keywords
@subsection Scan
@findex Scan
@table @asis
@item Syntax:
@code{Scan}
@end table

If this keyword is specified, @value{MSGED} will automatically scan all
message areas on startup.

@node SoftCrXlat, SortAreas, Scan, Keywords
@subsection SoftCrXlat
@findex SoftCrXlat
@table @asis
@item Syntax:
@code{SoftCrXlat @var{ascii-code}}
@item Example:
@code{SoftCrXlat 72}
@end table

Fidonet, historically, has a problem with the character with ASCII code 142
(0x8D). The FTS 0001 document says the following about this code:

@quotation
So   called  'soft'  carriage  returns,  8DH,  may  mark  a   previous
processor's  automatic line wrap, and should be ignored.
@end quotation

Despite of the fact that I do not know any single mail editor which adds
stray 0x8D characters into a mail, without the SoftCrXlat keyword,
@value{MSGED} behaves exactly like this: It ignores any 0x8D that it finds in
a message, i.E. it simply does not display it.

This may be a problem for you because some languages need to use that
character. For example, in codepage 866, this code represents the cyrillic
big en, or in codepage 437, it is an i with accent grave.

Specifying the SoftCrXlat keyword changes the behaviour of @value{MSGED} in
two ways. First, as soon as this keyword is present and has a non-zero
numerical argument, Msged will no longer ignore any 0x8D character in the
input, but display it as a normal letter. So if other people use those
characters in their mails, you will be able to see them.

Second, if you yourself type a character which, in the transport character
set that you have chosen (@pxref{OutputCharset,,The OutputCharset Keyword}),
would result in a character with hex code 0x8D, it will be replaced with the
character that has the ASCII code which is specified as argument when the
message is being saved. In the example above, any 0x8D would be replaced with
a character with code 72, which is the latin big H. This would be the ideal
setting for a user in Russia, who has to use codepage 866 as transport
character set, because the latin big H looks exactly like the cyrillic big
en.

So a Russian user who specifies "SoftCrXLat 72" will be able to see any big
en character that other users write, and any big en character that he writes
will be replaced with it's low-ASCII-look alike, thus avoiding problems at
other message readers.

Now suppose that you don't want to translate the 0x8D character
to any other value. If your language uses the i with accent grave, for
example, there is no other equivalent of this character, so you could only
change it to an i without accent grave, which you might not like. In this
case, you can also instruct @value{MSGED} to keep the 0x8D character as is,
by setting @code{SoftCrXlat 141} (141 is the decimal representation of
0x8D). With @code{SoftCrXlat 141}, the 0x8d character becomes an ordinary
character for @value{MSGED}, i.E. it does not behave different to any other
character any more.

However, be aware of the fact that this might cause problems on other systems
that behave according to FTS 0001 and ignore any 0x8D characters. Another
option specifically for the language that needs the i with accent grave would
of course be not to use codepage 437 or 850 as transport character set, but
to use Latin-1 (ISO 8859-1). In this charset, all printable characters are at
non-critical positions.

@node SortAreas, Squish, SoftCrXlat, Keywords
@subsection SortAreas
@findex SortAreas
@table @asis
@item Syntax:
@code{SortAreas @var{criteria}}
@item Example:
@code{SortAreas GND}
@end table

Normally, @value{MSGED} displays all message areas in the order in that they
have been defined in the configuration file and/or in the area
files.

With the @code{SortAreas} keyword, you can instruct @value{MSGED} to sort the
areas by certain criteria. The @var{criteria} parameter is a string that
consists of letters each specifying a sort criterium. The leftmost letter is
the most significant. The following letters can be used to define sorting
criteria:

@table @code
@item N
Sort netmail areas on top, then local areas, then echomail areas.
@item T
Sort by area tag.
@item D
Sort by area description.
@item G
Sort by group.
@end table

The meanings of @samp{D} and @samp{T} may vary depending on which area file
you imported the area from.  T is the true area tag, while D is what you
actually see on screen.  You will usually wish to use D, because ordering by
what you see seems to be more logical than ordering by what you don't see.

The @samp{G} criterium works on @value{MSGED} area groups. An area can belong
to a group either because you used the @code{Group} statement to add it to a
group, or because the group setting has been imported from a tosser
configuration file. When areas are sorted by group, those areas that do not
belong to any group will come first, followed by the members of the group
that has been defined first, then those of the group that has been defined
after that one, and so on.

Please note that the arealist feature of displaying Group separators can of
course only work if the @samp{G} ciretrium is the first criterium in your
@code{SortAreas} statement.

@node Squish, SwapPath, SortAreas, Keywords
@subsection Squish

This keyword is described in the section about manual message area definition
(@pxref{Manual Area Definition,, Manual Area Definition}).

@node SwapPath, Switch, Squish, Keywords
@subsection SwapPath
@findex SwapPath
@table @asis
@item Syntax:
@code{SwapPath @var{file-name}}
@item Example:
@code{SwapPath c:\temp\msged.swp}
@end table

Use the filename and path to your swapfile as value vor the @var{file-name}
parameter. This is only for DOS users but it should @emph{definitely} be
used.  If you don't use it, you must return to the Msged directory before
returning to the editor.

@node Switch, Tabsize, SwapPath, Keywords
@subsection Switch

This keyword is explained in the section about configuration switches (@pxref{Switches,,Switches}).

@node Tabsize, Template, Switch, Keywords
@subsection Tabsize
@findex Tabsize
@table @asis
@item Syntax:
@code{Tabsize @var{size}}
@item Example:
@code{Tabsize 8}
@end table

When you enter a message and press the @key{TAB} key, it will be expanded
into the number of white space characters that you have specified as
@var{size} argument to the @code{Tabsize} keyword. @key{TAB} characters in
other messages will not be expanded.

@node Template, TossLog, Tabsize, Keywords
@subsection Template
@findex Template
@table @asis
@item Syntax:
@code{Template @var{file-name}}
@item Example:
@code{Template msged.tpl}
@end table

The template file is used to define standard "hello strings", signoff
messages, and much more. See the provided sample template file for
information on how to do this. Specify the filename of your template file as
the  @var{file-name} parameter to the @code{Template} keyword.

You can specify multiple template files by repeating the @code{Template}
keyword on a new line for each filename, but the @code{Template} keyword
itself can only take one argument. @xref{Group,,The @code{Group} Keyword},
for applications of this.

@node TossLog, UserList, Template, Keywords
@subsection TossLog
@findex TossLog
@cindex echotoss log file
@cindex confmail out file
@table @asis
@item Syntax:
@code{TossLog @var{file-name}}
@item Example:
@code{TossLog echotoss.log}
@end table

The log file named @var{file-name} will contain a list of area tags of all
areas into which you have entered messages. Such files are usually named
@var{echotoss.log} or @var{confmail.out} and are used by tossers to
accelerate the scanning process. In @value{MSGED}, the echotoss log file is
updated immediately as soon as you have entered a new message.

@node UserList, UserOffset, TossLog, Keywords
@subsection UserList
@findex UserList
@cindex user list
@cindex fidouser lst file
@cindex lookup, by sysop name
@cindex nodelist lookup, by sysop name
@table @asis
@item Syntax:
@code{UserList @var{filename}}
@item Example:
@code{UserList e:\nodelist\fidouser.lst}
@end table

The fido user list file is a text file that contains all fidonet sysop names
and the corresponding node numbers. It is used for looking up node numbers by
sysop name. A fido user list file is typically named @file{fidouser.lst}. You
can specify up to two fido user list files by repeating the @code{UserList}
keyword.

Note that even when you are using a version 7 lookup, it is still preferable
to also have a @file{fidouser.lst} file and to use the @code{UserList}
keyword, because only the fidouser list file lookup routines of @value{MSGED}
can deal with multiple matching node numbers for one sysop name (they will
present you a list to select from), while the V7 lookup routines currently
cannot do this.

The exact format of a fido user list file is as follows: Each line in this
file must have eactly the same length. Sysop names are left justified and
node numbers are right justified. Node Numbers must come after column 40. The
file must be sorted alphabetically in a way like the C @code{strcmp()}
function would do it.

@node UserOffset, UUCP, UserList, Keywords
@subsection UserOffset
@findex UserOffset
@table @asis
@item Syntax:
@code{UserOffset @var{user-offset}}
@item Example:
@code{UserOffset 0}
@end table

@xref{Name,,The @code{Name} Keyword}, for information about the meaning of
the @var{user-offset} parameter and lastread pointer principles. The
@code{UserOffset} keyword specifies a default user offset number valid for
those users that do not have their individual user offset number configured
in their @code{Name} statement.

@node UUCP, UucpName, UserOffset, Keywords
@subsection UUCP
@findex UUCP
@cindex UUCP gateway address
@cindex e-mail gateway address
@cindex internet gateway address
@table @asis
@item Syntax:
@code{UUCP @var{address}}
@item Example:
@code{UUCP 242:4900/99.0}
@end table

The @var{address} parameter designates the FTN address of the gateway that
your are using to send Internet/Usenet e-mail.
@xref{Internet Gateways,,Using @value{MSGED} for e-mail and newsgroups},
for more information.

@node UucpName, UucpReplyTo, UUCP, Keywords
@subsection UucpName
@findex UucpName
@cindex UUCP gateway name
@cindex e-mail gateway name
@cindex internet gateway name
@table @asis
@item Syntax:
@code{UucpName @var{name}}
@item Example:
@code{UucpName UUCP}
@end table

Some Internet gateway software requires that mail addressed to the gateway
must be addressed to a specific user name in order to be gated into the
Internet. This specific user name is usually @samp{UUCP}, and you can specify
it as the @var{name} parameter to the @code{UUCP} keyword.

If your gateway is using a better gateway software, like Fidogate, it will
not have this restriction. Instead, such gateway software uses the name
fields in the FTN header to exchange real name information. In this case, you
should specify @samp{UucpName *}, which tells @value{MSGED} that the gateway
software allows any name to be put into the FTN header field.

@xref{Internet Gateways,,Using @value{MSGED} for e-mail and newsgroups},
for more information.

@node UucpReplyTo, Writemap, UucpName, Keywords
@subsection UucpName
@findex UucpReplyTo
@cindex Reply-To: header lines
@cindex redirecting e-mail replies
@table @asis
@item Syntax:
@code{UucpReplyTo @var{email@@address}}
@item Example:
@code{UucpReplyTo user@@some.domain.com (Joe Sysop)}
@end table

The Internet e-mail standards specified so-called @samp{Reply-To:} header
lines. The presence of such a header line speicifes that any reply to this
message should not be sent to the sender of the mail, but to the alternate
e-mail account that is specified in the @samp{Reply-To:} header.

A common scenario is the following: You have two e-mail accounts, one at home
and one at your university or at your office. You have set up the account at
your university to send copies of all incoming messages to your account at
home. Then you want, of course, that all replies to any e-mail you write are
directed at your university account, because you can read any mail that
arrives at the university both at the university or at home, while an e-mail
that you receive at home won't be visible at the university. Therefore, if
you are writing an e-mail from your home account, you want to insert a
@samp{Reply-To:} header line that points at your university account.

If you sepcify the @samp{UucpReplyTo} configuration keyword, Msged will
insert such header lines whenever a netmail is created that is addressed to
your UUCP gateway. The e-mail address that you specify as arugment to the
@samp{UucpReplyTo} keyword may also include realname configuration in
parentheses, like shown in the example above. The header line that is created
by the example above would look like

@example
Reply-To: user@@some.domain.com (Joe Sysop)
@end example

Please note that of course the whole thing can only work if your gateway
software can recognise @code{Reply-To:} headers in fido netmail. As always,
Fidogate can, while others probably can't.

@node Writemap,  , UucpReplyTo, Keywords
@subsection Writemap
@table @asis
@item Syntax:
@code{Writemap @var{filename}}
@end table

@xref{Readmap,,The Readmap and Writemap Keywords}, for more information.


@node Switches, Conditionals, Keywords, Configuration Reference
@section Switches
@findex Switch
@cindex switches

Switches are used to configure the behaviour of @value{MSGED}. In contrast to
a full configuration keyword, which is used to pass detailed parameters to
@value{MSGED}, a switch toggles a simple state that can be turned on or
off. Switches are usually used to switch certain features on or off.

@menu
* How to use Switches::         How to toggle switches on or off.
* List of Switches::            A complete list of available switches.
@end menu

@node How to use Switches, List of Switches, Switches, Switches
@subsection How to turn switches on and off

To turn a switch on or off, you can use the @code{Switch} keyword, which has
the following syntax:

@example
Switch @var{switch-name} On
Switch @var{switch-name} Off
@end example

The @var{switch-name} parameter must be the name of a valid switch (a
complete list of switches follows below). The first line from above turns the
selected switch on, the second turns it off. (You knew it before, did'nt you?
<g>).

For example, in order to turn the @code{SEEN-BYs} switch on, you would add
the following line to your configuration file:

@example
Switch SEEN-BYs On
@end example

@node List of Switches,  , How to use Switches, Switches
@subsection List of Available Switches

The following switches are available:

@table @code
@item AdaptiveCase
@findex AdaptiveCase
@cindex case sensitivity
@cindex dos file systems, using from unix
The @code{AdaptiveCase} switch is only relevant if you are running the
Unix/Linux version of Msged. It should be turned on if you are accessing
DOSish file systems (via Samba, NFS or the FAT or HPFS file system drivers),
from Msged running on Unix, or if DOS programs have access to your Unix file
system. DOSish fidonet programs usually create a really messed up message base
with mixed case spelling (i.E. it might contain both @code{.MSG},
@code{.msg} and @code{.Msg} file name extensions in a single netmail
directory). If the @code{AdaptiveCase} switch is turned on, each time that
Msged tries to open or create a file, it will first do a search over the
directory to determine the correct spelling of a file. This enables Msged
to cope with such mixed spelling as it is often found in DOSish message
base directories. - On the other hand, if only Unix programs have access to
your message base and the message base is stored on a Unix file system, you can turn this
switch off. This will give you a little performance improvement and save you
about 200 kilobytes of memory (which is otherwise used for directory
caching).  Default: Off.

@item ArealistExactMatch
@findex ArealistExactMatch
When the area list is displayed, you can search a message area by entering the
first few characters of this name. This is the default. If you turn off the
@code{ArealistExactMatch} switch, @emph{any} substring is matched in an area
search; you don't have to type an area name from the beginning. Default: On.

@item ChopQuote
@findex ChopQuote
When set to on, and you are quoting a message for reply, this switch will
cause all quoted lines at the end of the message to be removed (chopped) when
the message is saved.  This works only when using the internal editor. If you
are using an external editor, ChopQuote has no effect.  When set to off, all
quoted lines are saved, regardless of their location in the message.  Note
that you can also manually chop quotes by pressing
@key{Alt}-@key{L}. Default: Off.

@item BS127
@findex BS127
@cindex backspace, on Linux console
Most UNIX consoles (xterm, syscons, and many others) return the ASCII code 8
(@key{Ctrl}+@key{H}) if you press the backspace key, and ASCII code 127 or an
extended escape sequence if you press the @key{Del} key. However, there are
some exceptions, notably the Linux system console. The Linux console returns
ASCII code 127 if you press the backspace key. The result is that the
backspace key behaves like @key{Del} in @value{MSGED}, i.E. it deletes the
character under the cursor instead of the character on the left. As this is
probably not what you want, you can change this behaviour by switching the
@code{BS127} switch on. You will probably want to enclose the @code{Switch
BS127 On} statement in a Conditional that tests if the @code{TERM}
environment variable is set to @code{Linux}. @xref{Conditionals,,Conditional
Statements in the Configuration File}, for more information. Default: Off:

@item Carthy
@findex Carthy
This switch fine-tunes the behaviour of the @code{delete_line} function of
the internal message editor, which is usually bound to @key{Alt}-@key{D} and
@key{Ctrl}-@key{Y}, for the special case that you delete the very last line
of a message. If the switch is on (default behaviour), the last line will be
cleared, but the cursor will remain there. This way, if you are in the middle
of a message and press @key{Ctrl}-@key{Y} multiple times intending to zap the
rest of the message, you will never delete anything that is above the line
where you started to press @key{Ctrl}-@key{Y}. If you turn the switch off
(behaviour of older versions of Msged TE), the last line will be deleted
completely, and the cursor will be moved to the previous line. The switch
name @samp{Carthy} is an appreviation for the function description,
``@strong{C}ut @strong{A}nd @strong{R}emain @strong{TH}ere when pressing
Alt+@strong{Y} on the very last line''. Or well @dots{} the true reason is
that there was a user named Matt Mc_Carthy who really got mad about the old
behaviour of the editor, so I implemented the switch and the new behaviour
for him. Default: On


@item Colors
@findex Colors
This switch is only relevant for the Unix versions of @value{MSGED}. If it is
disabled, @value{MSGED} will not send any ANSI color codes to the terminal,
but will restrict itself to the most basic monochrome text styles ``normal'',
``bright'' and ``inverted''. This allows you to use @value{MSGED} on
terminals like the standard xterm, hardware VT100 terminals, and others that
do not understand color codes. Note that you'd better not use the @code{Color}
configuration keyword, nor include any color scheme file, as long as this
switch is disabled. @xref{Colors in the Unix version}, for more
information. Default: Off for Unix, On for all other versions.

@item Confirm
@findex Confirm
@cindex confirmations
By disabling this switch, you will put @value{MSGED} into the ``You asked for
it, you got it!''-mode, that is, you will disable any kind of confirmation
dialog boxes on critical actions like deleting messages, aborting message
entry, and the like. Default: On. (That is, by default, @value{MSGED}
@emph{will} display confirmation requests).

@item DateArvd
@findex DateArvd
If this switch is set to on, the date/time when a message
arrived on your system will be displayed on the right side of the
header information block below the date written information. You might want
to turn this off if your tosser should not fill in this date field
correctly. Default: On.

@item DirectList
@findex DirectList
If you turn this switch on, you will directly drop into the message listing
mode when entering a message area, instead of the individual message reading
mode. Default: Off.

@item DMore
@findex DMore
When set to on, this will display the message number of the message currently
being read on the top line of the header after the area description in the
form: @samp{(currentmsg# of maxmsg#)}. Default: Off.

@item DomainMsgid
@findex DomainMsgid
@cindex MSGID, generation
@cindex message IDs
@cindex soupgate compatibility
Controls if the address in a MSGID control line will be printed in 5D with the
domain identifier (On) or in 4D without.  When you are using an internet
gateway which runs the Soupgate software by Tom Torfs, you should turn this
switch to off in order to enable reply linking to self-written messages in
newsgroups (Soupgate does not properly handles MSGID's with domain identifier,
unfortunately). Default: On.

@item DomainOrigin
@findex DomainOrigin
If turned on, @value{MSGED} will generate five dimensional origin lines
(i.E., it will append the domain string to the address in the origin
line). It is suggested that you turn this switch off, but is is turned on by
default. Default: On.

@item EchoFlags
@findex EchoFlags
When this switch is set to on, @value{MSGED} will append a FLAGS control
kludge line to messages entered in echomail areas whenever there are message
attributes other than Loc, Snt and Rcv, and it will recognise FLAGS control
lines in echomail areas. (Note that Msged always writes FLAGS control lines
in netmail areas when necessary and always recognises these lines for netmail
messages). Setting this switch to on allows the transportation of all sorts
of message flags in echomail areas. These flags, however, do not make too
much sense in echomail areas (or why would you want to set a Pvt flag in an
echo area for example?). However, the default is On.

@item EditCROnly
@findex EditCROnly
If turned on, the internal message editor will mark hard carriage returns
with an ampersand sign. Default: Off.

@item EditTearLines
@item EditOriginLines
When these switches are turned off, the tearline and the origin line will be
appended to an echomail message after you have entered and saved it. When
they are turned on, tearline and/or origin line will be appended to the
message before you start to edit it, so that you have for example the chance
to modify the origin text or similar. Default: Both On.

@item ExtFormat
@findex ExtFormat
Indicates if text created in an external editor should be reformatted by
@value{MSGED}. It is a good idea to leave this on when using an external
editor. Default: On.

@item GroupSeparators
@findex GroupSeparators
When this switch is turned on, @value{MSGED} will draw horizontal bars
between different area groups in the area list. However, this will only work
if the first area sort criterion is @emph{sort by group}. Otherwise, this
switch will have no efect. @xref{SortAreas,,The @code{SortAreas} Keyword},
for information on how to make @value{MSGED} sort your area list by area
groups. @xref{Grouping,,Configuring and Using Message Area Groups}, for an
introduction on how to use groups with @value{MSGED}. Default: On.

@item HardQuote
@findex HardQuote
When switched on, this option causes the column formatting to be preserved
when quoting, i.e. it doesn't reformat quotes. Default: On.

@item ImportFN
@findex ImportFN
When using the built-in editor to  import a text file into a message, this
text file will be bracketet by some horizontal dashes and the name of the
file like this one: @samp{"------ test.txt begins -----"} before and
@samp{"----- test.txt ends -----"} after the file. You can disable these two
lines by turning the @code{ImportFN} switch off. Default: On.

@item LowerCase
@findex LowerCase
@cindex lowercase filenames
@cindex case-sensitive file systems
If you turn the @code{LowerCase} switch on, @value{MSGED} will convert all
file names that it reads from the configuration file or from any areafile to
lower case before it attempts to read to, write from, or create any
file. This switch is not very helpful - if you think you need it, you should
probably use @code{AdaptiveCase} instead.

@item MSGIDs
@findex MSGIDs
@cindex MSGID, generation
@cindex message IDs
MSGIDs are used to uniquely identify a message coming from your system.
Unfortunately no two message editors use the same MSGID-generating algorithm,
so you cannot guarantee that you conform to the MSGID specs unless you have
used a specific message editor (only) for a particular address in a 3-year
period.  Most people just ignore this potential problem and use them anyway.
Leaving MSGIDs ON will help mail tossers in duplicate message checking and/or
reply linking. Default: On.

@item NetmailVia
@findex NetmailVia
@cindex via lines
If this switch is turned on, @value{MSGED} will append a Via control line to
each netmail entered. You should turn this switch on, if your tosser does not
append Via lines to netmail that originates from your system (like Squish
does), but you should switch it off if your tosser does append via lines to
netmail even if the mail originates from your own system (like Fastecho
does).

@item OpusDate
@findex OpusDate
The old MsgEd documentation states differently, but judging from the source
code, turning this flag @emph{on} would @emph{stop} @value{MSGED} from
@emph{reading} the Opus date_written and date_arrived date fields of Fido
*.MSG messages. @value{MSGED} will, however, always fill in those fields (in
the worst case with the current timestamp). Probably you should leave this
flag as is. Default: Off.

@item Origins
@findex Origins
This switch controls if echomail messages will be appended with an origin
line. You absolutely @emph{must} leave this switch turned on, because origin
lines are technically necessary for a smooth operation of the
network. Default: On.

@item PseudoGraphics
@findex PseudoGraphics
This switch is currently only of interest for the Unix version. If turned on,
@value{MSGED} will query your termcap database to see if your terminal can
draw nice pseudgraphics characters for frames around windows and dialog
boxes, and if so, use them instead of the default "minus, plus, pipe" - style
frames. However, on a lot of Unix configurations the termcap database
contains false information about this capability, or the TERM variable is not
properly set. Turning on the switch may or may not work on your
system. Therfore, the default is: Off.

@item QQuotes
@findex QQuotes
This switch controls how @value{MSGED} will modify the quote string when
quoting text that already is quoted. When turned on, @value{MSGED} will try
to add another @samp{>} character to the existing quote strings. If turned
off, @value{MSGED} will not modify existing quote strings and thus behave
much like Maximus 2.0 or TimEd do. Default: On.

@item RawCC
@findex RawCC
@cindex carbon copies, saving the raw original message
This switch is only of relevance if the @code{SaveCC} switch is turned on.
Then, if @code{RawCC} is on, the raw cc:  msg is saved (along with the cc:
header that you typed in, so that if you re-edit the message, also all carbon
copies will be re-generated). Otherwise, the first formatted cc:  will NOT be
marked kill/sent and will therefore remain as a future reference, but the
original raw message will not be saved. Default: On.

@item RealMsgN
@findex RealMsgN
If this switch is turned on, the message list screen (@key{Alt}-@key{L}) will
display the actual message number of each message instead of displaying the
messages in sequential order, starting with 1. Default: Off.

@item ReceiveAllNames and ReceiveAllAddresses
@findex ReceiveAllNames
@findex ReceiveAllAddresses
These switches control under which circumstances the @code{Rvd} flag of a
netmail is turned on, indicating that the mail has been received (read) by
you. When these switches are turned on, the flag is set whenever the
destination address of the mail matches any of your AKAs, and whenever the
destination user name of the mail mathes any of the user names that you have
configured with the @code{Name} keyword.  Default: Both On.

You should turn off @code{ReceiveAllNames} if you have configured multiple
user names that belong to different persons (i.E. you and your girl friend /
boy friend <g>). In this case, only the user name that currently is active
will count when determining if the message is addressed to you or not. You
can switch the active user name by pressing @key{Ctrl}-@key{U}.

@item RightNextUnreadArea
@findex RightNextUnreadArea
When in message reading mode, and this switch is set to on, and there are no
more unread messages in the current message area, pressing the right arrow
key will go to the next area with unread messages. Default: Off.

@item SaveCC
@findex SaveCC
@cindex carbon copies, saving the original message
When generating carbon copies, and if this switch is turned on, a duplicate
of the original message is saved with no kill/sent flag set for future
reference, and possible re-editing and/or resending (along with the normal
copied messages that are sent out and flagged kill/sent). Default: On.

@item Seen-Bys
@findex Seen-Bys
This switch is a synonym for the @code{ShowSeenBys} switch. See below.

@item Shadows
@findex Shadows
If this switch is enabled, @value{MSGED} will draw nice shadows round dialog
boxes and other popup windows. You might want to disable this switch if you
use the Unix version of @value{MSGED}, because on a VT100 compatible
terminal, drawing those borders can slow down the program
considerably. Default: On.

@item ShowAddr
@findex ShowAddr
If this switch is enabled, the FTN address that you are currently using for
the current area will be displayed on the left-hand side of the line that
separates the message header from the message text. Default: On.

@item ShowCR
@findex ShowCR
If turned on, @value{MSGED} will mark the location of hard carriage
returns with ASCII code 20, as known from common word processors. This might
not work on a VT100 terminal. Default: Off.

@item ShowEOL
@findex ShowEOL
If turned on, @value{MSGED} will mark the location of each end-of-line
character with ASCII code 29. This will only work if the @code{ShowCR} switch
is also turned on. Default: Off.

@item ShowNotes
@findex ShowNotes
@cindex kludge lines, displaying
@cindex notes, displaying
If turned on, @value{MSGED} will display kludge line information in message
reading mode. You can also toggle this switch during program execution by
pressing @key{Alt}-@key{V}. Unlike in older MsgEd versions, this switch
does not pertain to origin and/or tear lines. Default: Off.

@item ShowOrigins
@findex ShowOrigins
This switch toggles the display of origin lines in message reading
mode. Default: On.

@item ShowSystem
@findex ShowSystem
This enables the lookup and display of a system name in your compiled version
7 nodelists. If set to on, the nodelisted system name will appear in the
header, after the sender's name and address, in netmail and echomail message
areas. If switched off, the lookup will not be performed. Default: On.

@item ShowTearlines
@findex ShowTearlines
This switch toggles the display of tearlines in message reading
mode. Default: On.

@item ShowSeenBys
@findex ShowSeenBys
@cindex SEEN-BY lines, showing
If this switch is turned on, @value{MSGED} will display SEEN-BY lines in
message reading mode. This is probably only useful for echomail routing
debugging purposes. Default: Off.

@item ShowTime
@findex ShowTime
Shows the current time.  This isn't a real time clock; it simply shows what
the current date and time were when the screen was last refreshed with a new
message, or when other keyboard hits were detected.  Default: Off.

@item SOTEOT
@findex SOTEOT
@cindex start of text / end of text
If this is set to on, @value{MSGED} will add SOT and EOT (Start Of Text/End
Of Text) kludge lines to bracket the text in the message body. Please note
that Paul Edwards' SOT/EOT specification does not permit domains in echomail
origin lines.  If both the @code{DomainOrigin} and @code{SOTEOT}
configuration switches are enabled, @value{MSGED} will exit and suggest to
disable one or the other. Default: Off.


@item SquishLock
@findex SquishLock
@cindex locking the message base, for performance reasons
@cindex message base locking, for performance reasons
If the @code{SquishLock} switch is turned on, @value{MSGED} will lock every
message area that is entered (and of course unlock it when it is left), thus
effectively denying access to this area to any other program. This will
result in a considerable speed increase when browsing message areas, but it
has the drawback that the tosser will not be able to toss to an message area
as long as it is open in @value{MSGED}. Also, some other problems have been
observed with this switch in network environments. So you'd best leave this
switch off unless you are running your Fido system on a non-networked, single
tasking DOS machine.

Note that this switch has nothing to do with data integrity concerns. MsgEd
will of course lock the Squish Message Base when writing a message in order
to insure data integrity even if the SquishLock switch is turned off.

The default value of the SquishLock switch is Off (in contrast to the
mainstream MsgEd 4.30, where it is turned on by default).

@item StatBar
@findex StatBar
Shows a status bar along the bottom of the screen. Default: On.

@item Tearlines
@findex Tearlines
@cindex tearlines, disabling
This switch controls if echomail messages will be appended with a tear
line (three consecutive dashes) or not. You should leave this switch
on. Default: On.

@item TZUTC
@findex TZUTC
@cindex TZUTC kludge line
@cindex timezone information
Msged generates a TZUTC kludge line according to FSP-1001 by default. This
kludge line gives the recipients of your mail a hint as to in which timezone
you are living. This is important because message timestamps in fido
messages always show local time, so they are useless for the recipient
without this kludge line information. Msged automatically detects your
timezone. In case it is doing this wrong, please send a bug report and
disable generation of this kludge line by setting the @code{TZUTC} switch to
off. Default: On.

@item UseLastr
@findex UseLastr
You should leave this switch turned on. It instructs @value{MSGED} to use the
lastread pointer for Fido *.MSG style areas. On the other hand, turning this
switch off probably does not disable @emph{all} lastread pointer handling
code in @value{MSGED} @dots{} Older @value{MSGED} versions had this switch
turned off by default and it was undocumented. Hence a lot of problems with
lastread pointers in those versions @dots{} Default: On.

@item UseMouse
@findex USeMouse
Some features of @value{MSGED} can be controlled through the
use of a mouse.  This switch tells Msged whether or not you're using one.
Note that the Windows NT and the Unix versions of @value{MSGED} presently do
not support a mouse at all. - Default: On.

@item UsePID
@findex UsePID
If this switch is turned on, @value{MSGED} will put its version information
in a @@PID kludge line, and leave the tearline blank. If turned off,
@value{MSGED} will not generate a @@PID kludge, but put its version
information in the tear line. Default: Off.

@item UseTosserGroups
@findex UseTosserGroups
This switch controls if @value{MSGED} will read any avialable group
information from an @code{Areafile} or not. If turned on, and if the areafile
contains group information that can be read by @value{MSGED} (currently this
is the case for Fastecho and Fidoconfig type area files), then each group
defined in your areafile (tosser configuration) will become a @value{MSGED}
group, and all areas that according to the tosser configuration are member of
this group will also be members of this group in
@value{MSGED}. @xref{Grouping,,Configuring and Using Message Area
Groups}. Default: On.

@item XXLTearline
@findex XXLTearline
If you set this, you can have a tearline of up to 79 characters (instead of
35), and the Unix version of @value{MSGED} will print system information in
the tearline. But be aware that this violates FTSC rules, so using this is
discouraged. Default: Off.

@end table

@node Conditionals, Area Definitions, Switches, Configuration Reference
@section Conditional Statements in the Configuration File
@cindex conditionals
@cindex environment variables, testing
If you use @value{MSGED} with the same configuration file on different
operating systems, you will probably want to make some settings in the
configuration file dependent on the environment you are currently running
in. This is where @dfn{Conditionals} come into place. A Conditional can be
used to include a certain part of the configuration file only if a certain
version (OS/2, DOS, ...) of @value{MSGED} is running, or only if an environment
variable has a certain value.

@menu
* Statements: cond-statements.  Formulating Conditional Statements.
* Conditions: cond-conditions.  Conditions that can be tested.
* cond-examples::
@end menu

@node cond-statements, cond-conditions, Conditionals, Conditionals
@subsection Formulating Conditional Statements
The easiest form of a Conditional is as follows:

@example
IF @var{condition}
  @var{configuration statements @dots{}}
ENDIF
@end example

The @var{condition} parameter can simply be an operating system name like
@samp{OS/2} or @samp{Linux}. You will soon see other conditions that can be
formulated (@pxref{cond-conditions, Conditions that can be tested}). For the
moment, we will always use operating system names as conditions.

For example, the following statement will only be evaluated on OS/2:

@example
IF OS2
   Editor c:\boxer\b2.exe
ENDIF
@end example

In addition, you can specify that an alternate block of statements should be
evaluated if the condition was not true:

@example
IF OS2
   ;OS/2 version of the Boxer Editor
   Editor c:\boxer\b2.exe
ELSE
   ;DOS version of the Boxer Editor
   Editor c:\boxer\b.exe
ENDIF
@end example

If you want to test for multiple configurations, the ELSEIF statement is
handy. Instead of writing a complicated statement like

@example
IF OS2
  Editor c:\boxer\b2.exe
ELSE
  IF UNIX
    Editor /usr/bin/vi
  ELSE
    ;Must be DOS
    EDITOR c:\boxer\b.exe
  ENDIF
ENDIF
@end example

you can simply write:

@example
IF OS2
  Editor c:\boxer\b2.exe
ELSEIF UNIX
  Editor /usr/bin/vi
ELSE
  Editor c:\boxer\b.exe
ENDIF
@end example

For compatibility with other Fidonet editors, the @code{ELIF} command can be
used instead of the @code{ELSEIF} command.

As you might already have guessed from the examples, conditionals can be
nested down to any depth, that is, inside an @code{IF} - @code{ENDIF} -
block, you can start another @code{IF} block, and so on.


@node cond-conditions, cond-examples, cond-statements, Conditionals
@subsection Conditions that can be tested
We already saw that operating system names can be used as conditions for the
@code{IF} command. Below, you see the complete list of conditions that can be
used:

@table @code
@item IF OS2
@itemx IF OS/2
These conditions are true if you are running the OS/2 version of @value{MSGED}

@item IF DOS
These conditions are true if you are running any DOS version (16 bit or 32
bit) of @value{MSGED}.

@item IF DOS16
This condition is true if you are running the standard 16 bit DOS version of
@value{MSGED}.

@item IF 386
This condition is true if you are running the 32 bit DOS version of @value{MSGED}.

@item IF W32
This condition is true if you are running the Windows 95/98/NT version of
@value{MSGED}.

@item IF UNIX
This condition is true if you are running any Unix version (Linux, FreeBSD,
AIX, Rhapsody, ...) of @value{MSGED}.

@item IF LINUX
This condition is true for any version of @value{MSGED} that announces itself
as @samp{MsgEd/LNX TE}.

@item IF 0
This condition is always false. It is useful if you want to disable a large
part of the configuration file, but do neither want to erase it nor to place
semicolons in front of each line. Simply place @code{IF 0} and @code{ENDIF}
around such a part of the configuration file.

@item IF 1
This condition is always true.

@item IF @var{variable}=@var{value}
This condition is true if the specified environment @var{variable} has the
specified @var{value}. For example, on OS/2, @code{IF HOSTNAME=mycomputer}
will be true only if you have @code{set HOSTNAME=mycomputer} in your
@file{config.sys} file, or if you have given the @code{set
HOSTNAME=mycomputer} command on the command line before starting
@value{MSGED}.

@end table

@node cond-examples,  , cond-conditions, Conditionals
@subsection Usage example for Conditionals
Here are some more useful examples for Conditionals in the configuration
file:

@table @asis
@item Specifying a swap file for the 16 bit version:
@example
IF DOS16
  Swappath c:\temp\msged.swp
ENDIF
@end example

@item Selecting the proper Origin string:
@example
IF OS2
  Origin "Warp 4, Mister Sulu!"
ELSEIF W32
  Origin "My employer forces me to use Windows ..."
ELSEIF DOS
  Origin "DOSwidanja!"
ELSEIF UNIX
  IF LINUX
    Origin "Penguins ahead!"
  ELSE
    Origin "UNIX - a professional's choice"
  ENDIF
ENDIF
@end example

@item Fine-tuning the terminal setup on Unix
@example
IF UNIX

  ;By default, switch colors off (might cause problems with
  ;VT100 and xterm), as well as shadows (too slow)

  Switch Shadows Off
  Switch Colors Off

  IF TERM=linux
    ;The peculiarities of the Linux console ...
    switch bs127 on
    switch colors on
  ENDIF

  IF TERM=vt220
    switch colors on
  ENDIF

  IF TERM=ansi
    switch colors on
  ENDIF

ENDIF
@end example

@end table

@node Area Definitions,  , Conditionals, Configuration Reference
@section Defining Message Areas
@cindex definining message areas
@cindex message area definition
@cindex area definition

One of the most important tasks in configuring @value{MSGED} is to tell it
where it can find the message areas that you wish to read and to write
to. There are basically two ways to do this: You can either manually define
each area in the configuration file using the @code{Quick}, @code{Fido} and
@code{Squish} keyword, or you can tell @value{MSGED} to read in the
configuration file of your tosser. The latter method saves you much work, but
sometimes you will ned to use the manual method to do some fine-tuning.

It is advisable to put all keywords that have to do with area configuration
at the end of your configuration file, because other keywords (like
@code{QuickBbsPath}, @code{MountDir}, et. al.) that change the behaviour of
the area definition keywords will only work if they are read in before the
area definition keywords.

@menu
* Manual Area Definition::      Configuring areas one by one.
* Areafile Parsing::            Reading all areas from a tosser config file.
@end menu

@node Manual Area Definition, Areafile Parsing, Area Definitions, Area Definitions
@subsection Manual Area Definition
@findex Squish
@findex Quick
@findex Fido
@findex Jam

You can manually define a message area by putting a line of the following
format into your configuration file:

@example
@var{format} @var{flags} "@var{description}" @var{path} @var{areatag} [@var{address}]
@end example

Except for the @var{address} parameter, all parameters are mandatory. The
meaning of these parameters is as follows:

@table @var
@item format
The @var{format} parameter tells the message base format this message area is
held in. It can be either @samp{Fido}, designating a message area in Fido
*.MSG file format, @samp{Quick}, desingating a message area held in a
QuickBBS or Hudson Message Base, @samp{Squish}, designating a message area
in the Squish format, or @samp{Jam}, designating a message area in the JAM
format (Jam will only be enable when @value{MSGED} was compiled with Smapi
2.0 or higher).

@item flags
The @var{flags} parameter is a sequence of characters where each character is
a flag that toggles a certain option. The following flags can be used:

@enumerate
@item
Flags that specify the message area type. You have to use exactly one of
those:

@format
@code{m} - netmail area,
@code{e} - echomail area,
@code{l} - local mail area.
@end format

@item
Flags that toggle certain special features of @value{MSGED}. All of these
flags are optional. @xref{Advanced Concepts}, for more information on the
meaning of these flags.

@format
@code{8} - allow 8 bit characters with the proper @code{@@CHRS} kludge,
@code{u} - enable internet gateway support for this area,
@code{n} - this flag is obsolete.
@end format

@item
Default message attributes for messages written in this area. You should
specify @samp{p} for netmail areas. The @samp{loc} flag will always be set,
so you can't specify it here.

@format
@code{p} - private,
@code{h} - hold,
@code{k} - kill/sent,
@code{d} - direct.
@end format

@end enumerate

@item description
The @var{description} parameter specifies the name under which the area will
appear in the area selection screen. It may contain white spaces if you place
it between quotation marks.

@item path
The @var{path} parameter gives the location of the message area. For Fido *.MSG
areas, this is the path name of the corresponding directory. For QuickBBS
areas, it is the area number. For Squish and Jam areas, it is the base name of the
area files without extension.

@item areatag
The @var{areatag} parameter gives the official area tag of this area. You
@emph{must} specify this parameter for echomail areas, and you @emph{must
not} specify this for netmail areas!

@item address
Finally, the @var{address} parameter specifies the FTN address to use for
this area. You must use this for othernet areas where you must use an AKA
different to your main AKA.

@end table

Here are some examples:

@example
Fido   mup "Fidonet Netmail" e:\fido\netmail   2:2476/418.0
Squish eu  "MsgEd Support"   e:\fido\sq\msged  MSGED_ECHO
Squish eu8 "OS/2 Debate"     e:\fido\sq\os2deb OS2.DEBATE.GER
Squish eu  "c't conference"  e:\fido\sq\ctger  CT.GER  21:492/2851.0
Quick  lp  "To Sysop Area"   1
@end example

@node Areafile Parsing,  , Manual Area Definition, Area Definitions
@subsection Reading a Tosser Configuration File (Areafile)
@cindex tosser configuration, parsing
@cindex area file, of tosser

@value{MSGED} can read your area configuration from a tosser configuration
file. Supported tossers currently include:

@itemize @bullet
@item Fastecho 1.45 and above
@item GEcho 1.20 (but not older versions)
@item hpt / fidoconfig
@item Squish 1.11 and above
@item Generic AREAS.BBS file
@end itemize

This saves you much work: You only have to declare an area once in the tosser
configuration file, and MsgEd will automatically always display all areas
that are configured in your tosser configuration file.

The following three keywords are used to perform this goal:

@menu
* Areadesc::                    How to display the area description
* AreafileFlags::               Enabling charset or uucp features for all areas
* Areafile::                    Which tosser config file shall be used
@end menu

@node Areadesc, AreafileFlags, Areafile Parsing, Areafile Parsing
@subsubsection AreaDesc
@findex AreaDesc
@table @asis
@item Syntax:
@code{AreaDesc [@var{how}] @var{what} @dots{}}
@item Examples:
@code{AreaDesc tag}
@item
@code{AreaDesc tag desc}
@item
@code{AreaDesc upper tag asis desc}
@end table

The tosser configuration file normally stores two sorts if information about
a message area: its canonical area tag, like @code{MSGED_ECHO}, and a
description of the area topic, like @code{International Msged support
conference}. The @code{AreaDesc} keyword is used to tell @value{MSGED} how to
make up the arealist entry of each area from this information.

The @var{what} parameter specifies what to include. @code{TAG} means to use
the areatag, and @code{DESC} means to use the description. You can specify
both parameters separated by a blank like in the example above, in which case
both information will be displayed, separated by a dash.

The @var{how} parameter is a modifier for all following @var{what} parameters
and specifies how this information should be displayed. It can be
@code{ASIS}, which means to display it as in the config file, or it can be
@code{UPPER}, which means to display anything in upper case, or @code{LOWER},
i.E. display everything in lower case letters.

The default value if no @code{AreaDesc} keyword is given is @code{asis tag desc}.

@node AreafileFlags, Areafile, Areadesc, Areafile Parsing
@subsubsection AreafileFlags
@findex AreafileFlags
@table @asis
@item Syntax:
@code{AreafileFlags @var{flags}}
@item Example:
@code{AreafileFlags 8u}
@end table

There is one big problem with reading echo definitions from tosser
configuration files: Those files do not contain all information that can be
specified in a manual area configuration. Certain features of @value{MSGED}
need a flag that has to be set for each area in order to enable that feature.
For example, in order to be able to write mails with umlauts, cyrillic
characters etc., you must set the 8 flag for each area, designating that
high ASCII characters are allowable therin. This is where you use the
@code{AreafileFlags} keyword.

The @var{flags} parameter has the same syntax as the @var{flags} parameter of
the @code{Fido}, @code{Quick} and @code{Squish} keywords (@pxref{Manual Area
Definition,,Manual Area Definition}).

You must specify the @code{AreaFileFlags} keyword @emph{before} the
@code{AreaFile} keyword which it should apply to. Then, all areas imported
from the area files will have the specified @var{flags}.

If you want only a few, but not all areas form an areafile to have some
flags, you can manually redefine areas with the syntax described in the
preceding section. For this to work, the manual redefinition must come
@emph{after} the @code{AreaFile} keyword. Vice versa, if you want almost all
areas from an areafile to have a certain flag, but want a few exemptions, you
should use the @code{AreaFileFlags} and @code{AreaFile} keywords to import
all areas from the areafile with the specific flag set. After that, you can
redefine some areas manually without this flag.

Note: Using @code{AreaFileFlags} to globally turn on the @samp{u} flag
probably won't hurt you. On the other hand, you should only use
@code{AreaFileFlags} to globally turn on the @samp{8} flag if you know that
the moderators of the echo areas that you are posting in do not forbid
8-bit-codes.

@node Areafile,  , AreafileFlags, Areafile Parsing
@subsubsection Areafile
@findex Areafile
@table @asis
@item Syntax:
@code{Areafile @var{type} @var{filename}}
@item Examples:
@code{Areafile Fastecho c:\fastecho\fastecho.cfg}
@item
@code{Areafile Squish c:\squish\squish.cfg}
@item
@code{Areafile AreasBBS c:\squish\areas.bbs}
@item
@code{Areafile GEcho c:\gecho}
@item
@code{Areafile Fidoconfig}
@end table

This keyword tells @value{MSGED} which areafile to use. The @var{type}
parameter designates the type of tosser configuration file to use. It can be
@samp{Squish}, @samp{Fastecho}, @samp{GEcho}, @samp{fidoconfig} or
@samp{AreasBBS}. The @var{filename} parameter specifies werhe to find the
tosser configuration that should be read. It's useage depends on the type of
your tosser:

@itemize @bullet
@item @samp{AreasBBS}, @samp{Fastecho}

The path to and filename of the configuration file, like
@code{c:\fastecho\fastecho.cfg}.
@item @samp{Gecho}

You must specify the path to your GEcho installation directory rather than a
configuration file name, e.g. @code{c:\gecho}. Only GEcho 1.20 is supported.
@item @samp{fidoconfig}

According to the Husky policy of doing things, the path to the fidoconfig
file is read from the default value or from the @samp{FIDOCONFIG} environment
variable. Hence, for fidoconfig, the second parameter of this keyword is not
used to configure the path to the config file. Instead, it is used to
configure how the config file should be treated. This can be:

@itemize  @bullet
@item @samp{Areas}

Only the mail area configuration (echo-, local and netmail areas) is read
from fidoconfig, i.E. the fidoconfig file is only used like any other
areafile. This is also the default behaviour if you omit the second
parameter.

@item @samp{Settings}

If you specify @samp{Areafile Fidoconfig Settings}, @value{MSGED} will read
as much configuration settings from the fidoconfig file as possible. Among
other things, this is the user name(s), the Fido AKA(s) and the echotoss log
file position. Mail area configuration, on the other hand, is @emph{not} read.

@item @samp{Both}

With this setting, both the general configuration settings and the mail area
configuration will be read from fidoconfig.
@end itemize

The fidoconfig routines are able to follow include statements inside the
fidoconfig file automatically.

@item @samp{Squish}

The path to and name of the configuration file, like in
@code{c:\squish\squish.cfg}. Plase note that only the area definitions from
this file itself will be read. If the Squish configuration file references
another @file{areas.bbs} file, you have to define it separately for
@value{MSGED} using a second @code{Areafile} statement.
@end itemize


@node Compiling, Concept Index, Configuration Reference, Top
@appendix Compiling the Source Code
@cindex source code
@cindex compiling the source code
This appendix provides information on how to compile the source code of
@value{MSGED}. Most of the information of this chapter applies to all
supported platfroms (including Unix, OS/2, Windows and DOS).

This appendix only covers stand-alone compilation of @value{MSGED}. You can
also decide to build @value{MSGED} in the Husky environment, i.E. link
@value{MSGED} against the fidoconfig library and use the @file{huskymak.cfg}
compile configuration file. If you want to do this, please refer to the
compliation and installation instructions which are provided by the Husky
team. They can be found in the file @file{INSTALL} in the @file{huskybse}
package.

In the following we are assuming you don't want to deal with
@file{huskymak.cfg}, don't want to download @file{fidoconfig} etc., but
simply build a standard @value{MSGED} executable for your operating
system. It will still be able to read  a @file{fidoconfig}
type configuration file, as @value{MSGED} also has it's own fidoconfig access routines.

@menu
* Preparations::                Obtaining and unpacking the files.
* Configuring::                 Selecting the proper Makefile.
* Path Names::                  Specifying the location of the config file.
* Building the Executables::    Invoking the compiler.
* Building the other Files::    Compiling the manual and help files.
* Installing::                  Installing the files you have created.
@end menu

@node Preparations, Configuring, Compiling, Compiling
@section Step 1: Preparing the build directories; Obtaining the SMAPI
Besides the source code of @value{MSGED}, which is supplied in
@file{msged-te-6.3.tar.gz} or in @file{MSGTE63S.ZIP}, you need the source code
of the special edition of the Squish Message API, from here on called
@dfn{Smapi}, that is required to build @value{MSGED}.

Unfortunately, there are a lot of different versions of the Smapi floating
around. The best choice would be if you would use the same version of Smapi
that I used to compile the binary releases. for @value{MSGED}
@value{VERSION}, this is Smapi 1.6.3, which can be obtained as
@file{smapi-2.5.tar.gz} or as @file{smapi25.zip}. You should be able to
obtain these files from the same location you got @value{MSGED} from.

Alternatively, you can use any @emph{newer} Smapi from the Husky development
stream. All other versions of the Smapi or the Msgapi32 are probably not
suited for building @value{MSGED}. They are definitely not suited if you want
to compile for Unix.

After you have obtained @file{SMAPI163.ZIP} and @file{MSGTE6_S.ZIP}, unzip
them into two directories at the same level.  The files in the archives stick
to the 8.3 notation, so you can even do this on FAT drives. You should use
either Info-ZIP for unpacking these files, or use pkunzip with the @samp{-d}
option, because the @value{MSGED} archives contains subdirectories.

On OS/2, this could look  as follows:

@example
[C:\] mkdir compile
[C:\] mkdir compile\smapi
[C:\] mkdir compile\msged
[C:\] cd compile\msged
[C:\COMPILE\MSGED] unzip c:\download\msgte63s.zip
[C:\COMPILE\MSGED] cd ..\smapi
[C:\COMPILE\SMAPI] unzip c:\download\smapi25s.zip
@end example

If you use the version in @file{.tar.gz} format, you don't need to make the
subdirectories - the @file{.tar.gz} files already contain them. So, on Unix,
it would probably look like this:

@example
~ $ mkdir ~/compile
~ $ cd ~/compile
~/compile $ tar xzf ~/downloads/msged-te-63.tar.gz
~/compile $ tar xzf ~/downloads/smapi-2.5.tar.gz

@end example

@node Configuring, Path Names, Preparations, Compiling
@section Configuring - Selecting the proper Makefile for your Compiler

@value{MSGED} does not provide a @code{configure} skript. It rather provides
a set of different makefiles. You ``configure'' the source code by selecting
the makefile of your choice.

The following compilers and target operating systems are supported:

@example
Makefile     | Platform
-------------+-----------------------------------------
makefile.bcd | DOS with Borland C++ 3.1 or Turbo C
makefile.bco | OS/2 with Borland C 2.0
makefile.bcw | Windows 95/NT with Borland C++ 4.0
makefile.djg | DOS/386 with DJGPP GCC 2.7.2
makefile.emo | OS/2 with EMX 0.9c GCC 2.7.2
makefile.ibo | OS/2 with IBM CSET/2 or Visual Age C++
makefile.rxw | 95/NT with RSXNT + EMX GCC 2.7.2
makefile.unx | Any UNIX, BSD or Linux with any compiler
makefile.bsd | FreeBSD with GCC
makefile.lnx | Linux with GCC
makefile.mgw | 95/NT via Mingw32 cpd (running on Unix)
@end example

The following makefiles are also provided, but they are not supported, either
because I do not have the appropriate compilers or because I cannot give
support for some special features they are using. I try to update these
makefiles along with the others, but I cannot make any promises.

@example
Makefile     | Platform
-------------+----------------------------------------------
makefile.hco | OS/2 with Metware High C
makefile.qcd | DOS with MS Quick C
makefile.wcd | DOS with Watcom C
makefile.wcw | NT with Watcom C
makefile.wco | OS/2 with Watcom C
makefile.wcx | DOS/386 with Watcom C
@end example

There is also a file which is simply named @file{Makefile}. This file is for
building using a @file{huskymak.cfg} environment, and will not be described
in this manual.

@node Path Names, Building the Executables, Configuring, Compiling
@section Selecting Path Names
Msged has to know where to find its primary configuration file and the
character set translation files. You must tell this at compile time (the
location of all other configuration files can then be configured in the
primary configuration file). The following paths are selected per default:

@example
What file               DOS/WIN/OS2     UNIX
=========================================================
Configuration file      msged.cfg       ~/.msged
Charset Input Map       readmaps.dat    ~/.msged.readmaps
Charset Output Map      writmaps.dat    ~/.msged.writmaps
@end example

These path's will be different if you compile via @file{huskymak.cfg}.

On Non-Unix systems, you normally do not need to change the default (which
is finding everything in the current directoy). On Unix, you might want to
change the locations if you are administrator and want to provide a
system-wide default configuration (that can then include files in the user
home directory if necessary). You can do this by redefining variables in the
Makefile. Just have a look at the first three lines of @file{makefile.unx}
to see how it works.

@node Building the Executables, Building the other Files, Path Names, Compiling
@section Building the Executables
Now that you have done all necessary preparations, compilation is easy:

@enumerate
@item Change into the @file{smapi} directory and type @code{make -f
MAKEFILENAME} (replace @code{MAKEFILENAME} with the name of the makefile that
you have selected in the previous step). This will generate a library, the
name of which depends on the makefile you used. For instance
@file{libsmapiunx.a} or @file{smapiibo.lib}.

@item Change into the @file{msged} directory and type @code{make -f
MAKEFILENAME} (again substituting the proper makefile name). This will
genereate the executable, whose name depends on the makefile you used. For
instance @file{msgedp.exe} or @file{msged} or @file{msged.exe}.

@item If, on Unix, you get errors about unresolved symbols when linking the
@value{MSGED} executable, change into the Smapi directory and run
@code{ranlib smapiunx.a}. Then change back to the Msged directory and try
again.
@end enumerate

@node Building the other Files, Installing, Building the Executables, Compiling
@section Compiling the help file, the charset files and the documentation

After you have created the executables, you need to create some other files,
namedly the compiled online help file, the character set translation files,
and the manual.

To compile the help file, call the @value{MSGED} executable with the
@samp{-hc <infile> <outfile>} options. On OS/2:

@example
[C:\COMPILE\MSGED] msgedp -hc msghelp.src msghelp.dat
@end example

and on Unix:

@example
~/msged $ ./msged -hc msghelp.src msghelp.dat
@end example

In order for @value{MSGED} to behave smoothly in environments where mails
with special national characters are received and/or transmitted (i.E.:
everywhere in Europe, both Western Europe and particularly in Russia), you must
create @file{readmaps.dat} and @file{writmaps.dat} files @emph{that match
your local character map settings}. On Unix, this is easily done thanks to
the shell expansion feature:

@example
~/msged $ cd ~/msged/maps
~/msged/maps $ gcc -o makemaps makemaps.c
~/msged/maps $ ./makemaps LATIN-1 *.CHS *.chs
@end example

(If you have misconfigured your Unix to use CP850 or CP437 instead of
ISO-9660, you should enter @samp{IBMPC} instead of @samp{LATIN-1} in the
example above).

On OS/2, DOS and NT it is a little more cumbersome. First, you have to
compile the @file{makemaps.c} file with your C compiler. Then, you have to
specify all character map files that are to be included into
@file{readmaps.dat} and @file{writmaps.dat} manually:

@example
[C:\COMPILE\MSGED] cd c:\compile\msged\maps
[C:\COMPILE\MSGED\MAPS] icc makemaps.c
 (...)
[C:\COMPILE\MSGED\MAPS] makemaps CP437 IBM_ISO.CHS ISO_IBM.CHS
IBM_ASC.CHS IBM_MAC.CHS MAC_IBM.CHS IBM_850.CHS 850_IBM.CHS 866_IBM.CHS 1125_IBM.CHS
@end example

Finally, you may want to create the documentation in your favourite output
format. This requires quite some prerequisite software to be installed on
your system, so you probably might simply want to grab @file{MSGTE6_M.ZIP}.

But if you really want to compile the manual by hand, proceed as follows:
Change to the @file{doc/manual} subdirectory:

@example
[C:\COMPILE\MSGED\MAPS] cd \compile\msged\doc\manual
@end example

or on Unix:

@example
~/msged/maps $ cd ~/msged/doc/manual
@end example

There, you have various options. You can type:

@table @code
@item make info
This creates the documentation in GNU info format. It requires the
@file{makeinfo} tool to be installed, and the @file{info} viewer for
viewing. Both should be part of any modern Unix installation. For OS/2, they
can be found in @file{GNUINFO.ZIP}

@item make html
This creates the documentation in HTML format. This requires Perl 5 to be
installed as well as the texi2html.pl perl script. (The latter script does
also work on OS/2 with the Perl for OS/2 port).

@item make dvi
This creates the documentation in DVI format. DVI can be converted to PS with
dvips and yields a very high-quality output. However, this requires a working
TeX installation and the @file{texi2dvi} shell script. (On OS/2, you need
pdksh for executing the script and EmTeX. With a little manual work, it can
also be done with Juergen Kleinboehls OS2TeX.

@item make inf
This creates the documentation in OS/2 INF format. It requires a Texi2Ipf
tool as well as the IPFC compiler (which only runs on OS/2).

@end table

@node Installing,  , Building the other Files, Compiling
@section Installing
You have now created all files that are necessary to install
@value{MSGED}. @xref{Installation,,Installation Procedures and Release
Notes}, for information on how to install these files.

@node Concept Index, Keyword Index, Compiling, Top
@appendix General Index
@printindex cp

@node Keyword Index,  , Concept Index, Top
@appendix Configuration File Keyword Index
@printindex fn

@bye
