A.M.C.

A U T O M A T I C
M E S S A G E
C R E A T O R

A program to post messages automatically
to the MBSE BBS/mailer or
to Internet

Version 0.99.4/Linux
June 11, 2004

Copyright © Johannes D.H. Beekhuizen

1.	Legal notices.

The author of this program, henceforth called “the Author”, is Johannes D.H. Beekhuizen <jbeekhui@duinheks.xs4all.nl>. The copyright of this program lies with him. The copyrights of various used and mentioned utilities rest with their owners.

This program is free to use and distribute as far as this is allowed under the law of your country.
Payment for AMC is not and will never be due. But the Author would appreciate it if you would send him a picture postcard of your home town as token of your appreciation. The address of the Author may be requested by e-mail from jbeekhui@duinheks.xs4all.nl or by Fidonet netmail from Johannes Beekhuizen (2:280/1018).

AMC was originally developed under DOS, using Borland's Turbo pascal 6.0. The Linux version is developed using the Free Pascal Compiler.

AMC COMES WITHOUT WARRANTY!

BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

2.	Introduction.

The purpose of this program is to automatically post messages to Fidonet, or networks using Fidonet technology, by means of the MBSE BBS/mailer, or to Internet using the sendmail command.

Although the program will post to Fidonet echo mail areas, this seems in general not a very sensible thing to do. It could cause an unnecessary high data flow. The Author suggests to restrict usage to writing messages in Fidonet netmail or local areas, or to Internet

As a bonus, the program has the possibility to look into a birthday list, display people who will have a birthday in the near future (no more silly excuses now!) and/or to send them electronic good wishes.

For messages to Fidonet AMC needs the mbmsg program from the mbse BBS/mailer package AMC tries to find this from the user mbse settings in /etch/passed. For messages to Internet the sendmail program; AMC looks for this in your search path and in /user/bin.

Text and messages appear in your favourite language when you set the AMC_LANG environment variable [see: Internationalisation].

Fidonet was originally designed as a way for computer hobbyists to exchange mail and news over the telephone net using an analogue modem. Much as the question is now “Do you have e-mail?” it used to be “Are you in Fidonet?”.

Like the majority of programs for Fidonet, AMC was developed under DOS. Only some people used Windows, even less Linux. Now that Linux is becoming more popular and some good programs for Fidonet exist for Linux, AMC is developed under Linux.

3.	Installation.

Installation is very simple...

To install the program for your personal use, unzip the distribution archive file into a directory of your own choice.

To make the program publicly available, login as root, unzip the distribution archive file into a temporary directory and run the install.sh installation shell script.

This will by default create the directory /opt/amc, which we will call AMC_ROOT from now on, and the subdirectories AMC_ROOT/bin, AMC_ROOT/etc, AMC_ROOT/doc and AMC_ROOT/log. Installation under other directories than /opt is also possible.

The binary executable resides in AMC_ROOT/bin. AMC_ROOT/etc contains the Default configuration and text input files and an example birthday list, AMC_ROOT/doc the full documentation in Adobe PDF and OpenOffice (StarOffice) Writer format and AMC_ROOT/log the log file.

Change into AMC_ROOT/etc and use your favourite text editor to adapt the default files to your own taste and needs.

4.	Usage.

4.1	The run command.

The run command is
amc [option [argument]] ... [option [argument]]

The possible options are explained later on in this document.

Configuration may be done from three places: the configuration file, the text input file and the command line.
Options entered on the command line supersede those given in the text input file and the configuration file. Options defined in the text input file supersede those defined in the configuration file.
This makes configuration of AMC very flexible. You can have one or more configuration files for the general cases; text files for more special requirements and the command line for the odd exception.

4.2	Options and parameters.

Parameters may be set using keywords in the configuration and/or text input file.
Keywords MUST start in the first column of the line and have a colon [:] as first character. All other lines are regarded as comment in the configuration file or message text in the text input file. Keywords are not case sensitive.
Options and parameters may also be set in the command line. They may be given in the short form [-o] or the long form [--option], followed by a space and an argument where necessary and allowed. Arguments consisting of more than one word must be enclosed in double quote characters [--option “a long option”].

The possibilities are presented as follows:

-o	description

--option	more description

:keyword(s)

Option/parameter	Meaning

-?	Shows a list of valid options and exits the program.

---help	If this option is used, all other options will be ignored.

-A	Displays a list of available Fidonet message areas.

--fido-areas	If this option is used, all other options except --help will be ignored.

-a	An alias or nickname.

--alias

:alias

:nickname

--c	The name of the configuration file.

--config-file	If no argument or the argument “-” is given,the use of a configuration file is inhibited.
Default is /AMC_ROOT/etc/amc.cfg.

-d	The address of the person that you want to send the

--to-address	message to. A Fidonet address should be given in the

:dest	form: zone:net/node.point. AMC is not clairvoyant, but

:destination	tries to correct incomplete Fidonet addresses (see below).

:toaddress

-f	The Fidonet message flavour (attribute). This may be “c”

--flavour	for crash, “h” for hold, “i” for immediate, “n” for normal or

:attrib	“-” for the system's default.

:attribute

:flavour

-h	Your Fidonet address. This MUST be provided for Fidonet

--from-address	messages.

:home`	For Internet messages your address will be taken from the

:homeadress	environment variables USER and HOSTNAME.

:fromaddress

-i	The sender's name. Usually you will use your real name

--from-name	here, but in principle anything may be used.

:from	Default: “Automatic Message Creator”.

:fromname

-l	The name of the AMC log file. AMC uses the same format

--log-file	as Binkley, Squish and Maximus, so their log file may be

:log	used for AMC as well,

:logfile	Default is AMC_ROOT/log/amc.log

-m	The Fidonet message board number.

--message-board	When this is specified AMC assumes the message is for

:area	Fidonet, otherwise it tries to send it to Internet.

:echoarea

:board

-y	The Fidonet message type. This may be “netmail” or

--message-type	“echomail”.

:messagetype	If not provided, AMC assumes netmail if a valid Fidonet to-address and a message board are given.

-n	The name of the person the message should be sent to.

--to-name	Default: “<somebody>”.

:toname

-q	Quiet mode. Log messages will not be displayed to the

--quiet	screen unless writing to the log file is impossible.

-t	The name of the text input file. A text input file MUST be

--text-file	specified.
Default is AMC_ROOT/etc/amc.txt

-x	Log level. This determines the amount of information in

--log-level	the log file. The range is 0 to 6 (fatal to informational), the default is 3.

-I	The name of the text import file. See below.

--import-file

-O	The Fidonet origin.

--origin	The default is “«AMClong» v«AMCver» (c) «AMCauthor»”.

:origin

-S	The subject of the message. Default “<unknown>”.

--subject

:subj

:subject

-T	The Fidonet tear line. Default «AMCshort» v«AMCver»”

--tearline

:tearline

4.3	Fidonet address completion.

AMC tries to complement an incomplete Fidonet destination address in the following way:

Entered:	Changed to:

.point	yourzone:yournet/yournode.point
node	yourzone:yournet/node
net/node	yourzone:net/node
net/node.point	yourzone:net/node.point

4.4	Text substitution

In the text and the tear line and origin you may use several dynamic text substitutions. They look like:

«replacementtoken»

The text replacement tokens recognised are:

ToAddr	the recipient's address

ToName	the recipient's full name

ToFName	the recipient's first name, i.e. the first word from the name string

ToLName	the recipient's last name, i.e. anything that's left after the first name

FromAddr	the sender's address

FromName	the sender's full name

FromFName	the sender's first name

FromLName	the sender's last name

Alias	...

AMCver	the AMC version number

AMCshort	A.M.C.

AMClong	Automatic Message Creator

AMCdate	the AMC creation date

AMCcreator	the name of the author of amc

Note that the text replacement tokens are not case sensitive.

4.5	The text import function.

A special text replacement token is «Merge», also known as «Import». This will be replaced by text read from an import text file, which CAN ONLY be specified on the command line, using the -I or --import-file option.

If this replacement token appears embedded in a line, line feeds will be added before and after the imported text.

5.	The birthday calendar.

With the birthday calendar feature you may display a list of people who celebrate their birthday within the near future and/or send them an electronic mail message a specified number of days before the event.

The input comes from an ASCII text file with records in the following format:

day month [year] name [address] [message board]

Have a look in the example list, amcbirth.day, to get an idea.

If the "year" field is not filled in (or -1), the age of the person will not be calculated.

The message board number should be specified as “#nnn”. If the "message board" is filled in, the person will receive an automatic birthday congratulation via Fidonet. If a valid Fidonet address is specified, it will be via netmail, otherwise via echo mail. If no “message board” is given, but a valid, complete, Internet address is specified, the message will go to the Internet. The "message board" will override any values in your AMC configuration file or command line.

Invocation of the birthday calendar feature is ONLY possible from the command string by using the -b or --birthday-list option.

The following options and parameters are only for the birthday calendar feature:

Option/parameter	Meaning

-b	Specifies the name of the birthday list.

--birthday-list	If no full path is specified, it will be looked for in AMC_ROOT/etc
There is no default.

-o	The number of days before the event to send out a

--send-out	congratulation message. The range is 0 to 31 days, the default 1 day.
No argument or “-” inhibits the sending of messages and only displays a list of impending birthdays.

-s	Sort the birthday list according to date of birth, The

--sort-birthday-list	original list will be saved as .bak file.

-w	The number of days to look in the future for the birthday

--look-ahead	list display. The range is 0 to 31 days, the default is 1 day.

There are also some extra text replacement tokens:

WhichDay	the day on which the forthcoming birthday takes place

WhichDate	the date of the birthday mentioned above

WhichAge	in case you want to be indiscreet.

Currently it is not checked whether the program has already run on the current day (this might be added at some time). It is ENTIRELY UP TO THE USER to ensure that the program is run ONLY ONCE A DAY with the automatic congratulation creation option.

6.	Internationalisation.

AMC shows text and messages in your preferred language when you set the AMC_LANG environment variable. You do this in bash by typing 'export AMC_LANG=<languagecode>'; in csh by typing 'setenv AMC_LANG <languagecode>'.

Currently AMC comes with the following languages: English (en), Dutch (nl) and German (de).

The resource files for the text and messages are AMC_ROOT/lib/lang/amc_messages.xx.po, where xx is the two-letter language code. The file AMC_ROOT/lib/lang/amc_messages.00.po is the master resource file and may not be changed.

To change a language or to add a new one you need the msgfmt program from the GNU gettext utilities and preferably GNU or a compatible make.
If you want to change or add a language, change to the languages directory AMC_ROOT/lib/lang. You add a new language by copying the master resource file, amc_messages.00.po, to amc_messages.xx.po, where xx is the two-letter code for the new language (e.g. 'fr' for French). Then use your favourite text editor to change the contents of the 'msgstr; entries in amc_messages.xx.po. Take care to keep the 'msgid' entries as they are, they are the key to the translation.
When you are finished with your translation, add the language code to the variable AMCLANGUAGES in the Makefile and do a 'make'. If all goes well, a file amc_messages.xx.mo will be created. This file will be loaded by the AMC program. If there were no errors in your input file, you are finished.

See also AMC_ROOT/lib/lang/README.

7.	Runtime messages.

By default only fatal to serious (level 3) execution errors will be written to the standard output device and the log file.

If the program does not seem to do what you want it to do, use the command line option -x or –log-level

-x n

where n is a number from 0 to 6, increasing the amount of information you get when the program runs.

Apart from writing error messages, AMC returns several error codes related to problems. The Author thinks it suffices for the user to know that any error code which is not zero means a problem. If you have problems and need support, please raise the log level to maximum and send the Author the log file and the configuration files you used, and the command line as you typed

8.	Revision history.

Version:	Date:	Comments:

0.99.5	July 03, 2004	Removed leftover debug string. Removed option -h for help: this was in conflict with -h for from-address. Added display of available Fidonet areas.

0.99.4	June 25, 2004	Internationalisation. Also looks in /usr/sbin for sendmail. Improved install script. Warning if user not in group bbs. Documentation updated.

0.99.3	June 22, 2004	Only cosmetic source changes

0.99.2	June 17, 2004	Check for existing and executable mbmsg and sendmail. Explanation [at log level 6] when execution fails.

0.99.1	June 11, 2004	This version is to a great extent based on AMC 1.15d for Dos by the same Author.

9.	Known bugs.

There are none at the moment ☺

10.	Acknowledgements.

The Author specifically likes to thank (in no special order):

Michiel Broek (2:280/2802):
for MBSE - a complete Fidonet/BBS platform independent package for Linux and other *nixes and for distributing AMC in the MBSE file echo.

Joris Teepe (2:280/1018.1)
For proofreading the documentation, testing the first Linux versions and providing the German translation of the messages.

Astrid Veltman:
for complaining about a birthday announcing program which went haywire in the last week of the year - this started the whole AMC exercise.

Kasper de Roo, Richard de Mos, Frans van Ballegooijen and many others:
for testing, bug hunting, suggestions and moral support during development of the original DOS version.

AMC page 2 of 9

2004-06-02T20:49:19