AMIBINKD
Native AmigaOS 3.x port of binkd, the FTN mailer
===============================================================================
DESCRIPTION
===============================================================================
AmiBinkD is a native AmigaOS 3.x build of binkd, the FidoNet Technology
Network (FTN) mailer, used to send and receive FTN echomail/netmail
packets over TCP/IP using the BinkP protocol.
Unlike every prior Amiga build of binkd, this one does not require
ixemul.library or ixnet.library. It talks to bsdsocket.library directly,
and every place the historical Amiga port depended on ixemul's vfork()-
based process model has been replaced with a native AmigaOS equivalent:
each BinkP session (inbound or outbound) runs as its own real AmigaOS
process, spawned via CreateNewProcTags() -- genuine concurrent sessions,
not one session at a time.
This is a from-scratch reconstruction, not a recompile of the old ixemul
Amiga port. It was built by tracing every ixemul/ixnet dependency in
upstream binkd's own historical Amiga support and replacing each one with
a direct AmigaOS/bsdsocket.library equivalent, then hardening the result
against several real behavioral differences between Amiberry's
bsdsocket_emu and genuine Roadshow/BSD sockets that only showed up under
live testing, not at compile time. See manual.txt section 15 for the
full list, if you're maintaining this on a different TCP/IP stack.
If you carry several FTN networks, one config file and one command line
cover all of them:
AmiBinkD:AmiBinkD -p -PALL AmiBinkD:AmiBinkD.cfg
"-P ALL" polls every node listed in the config, instead of naming each
uplink with its own -P switch or keeping a separate config and script
per network. See manual.txt section 07.
For full installation notes, configuration reference, known real-hardware
findings, and version history, see manual.txt.
FILES INCLUDED
===============================================================================
AmiBinkD Compiled AmigaOS executable (m68k, AmigaOS 3.0+)
AmiBinkD.info Workbench icon (colour image needs AmigaOS 3.5+)
readme.txt Quick overview and install notes
manual.txt Full SysOp documentation
AmiBinkD-example.cfg Example configuration file
AmiBinkD.scr Example AmigaDOS poll-all driver script
COPYING The GNU General Public License, version 2
Copy AmiBinkD-example.cfg to a name of your choosing (e.g. AmiBinkD.cfg,
or one file per network -- see manual.txt section 07) and edit it for
your system before running.
AmiBinkD.scr is a ready-to-edit "-P ALL" poll script -- point it at your
config name and schedule it from your BBS's event system.
REQUIREMENTS
===============================================================================
* Commodore Amiga or compatible/emulated Amiga system, AmigaOS 3.0+ (m68k)
* bsdsocket.library -- Roadshow, AmiTCP, or (as tested) Amiberry's
bsdsocket_emu
* An FTN-aware BBS engine or tosser to hand packets to/from (built and
tested against C-Net/5 Amiga Pro, but AmiBinkD itself only reads/writes
standard FTN packet and outbound-flow files -- it doesn't call into
C-Net/5 directly)
* At least one FTN address and an uplink/hub willing to carry your mail
AmiBinkD is a standalone compiled executable. It has no ixemul.library or
ixnet.library dependency of any kind -- confirmed via string search on
the built binary.
IPV4 AND IPV6
===============================================================================
AmiBinkD is IPv4-only, and this is a limit of AmigaOS itself rather than a
missing build option.
The AmigaOS TCP/IP API has no IPv6 in it. Roadshow's sys/socket.h -- the
official AmigaOS 3.2 networking headers -- defines 26 address families,
ending at AF_SIP 24 / AF_MAX 26. There is no AF_INET6, no sockaddr_in6, no
in6_addr and no IPPROTO_IPV6 anywhere in the netinclude tree. That is a
pre-IPv6 BSD snapshot, and bsdsocket.library has no v6 protocol behind it.
AmiTCP and Miami are IPv4-only as well, and Amiberry's bsdsocket_emu adds
nothing here either.
So every IPv6 branch inside binkd's own sources compiles out on this
platform. Upstream binkd speaks IPv6 on PC because the host stack hands it
AF_INET6 sockets; the Amiga has none to hand over. Defining the constants by
hand would not help -- socket() would simply return EAFNOSUPPORT.
If you need IPv6 callers to reach your board, put a small v6-to-v4 relay in
front of the BinkP port. On a Linux host running Amiberry, one socat process
is enough:
socat TCP6-LISTEN:24554,ipv6only=1,fork,reuseaddr TCP4:127.0.0.1:24554
Verified working: an IPv6 caller completes the full BinkP greeting and
session through it.
One thing to know before you rely on it. The relay is what connects to
AmiBinkD, so the log records every IPv6 caller as coming from 127.0.0.1 --
the real address is not recoverable from AmiBinkD's own log. Two points
follow. First, do not use address-based node restrictions on a port reached
this way; BinkP's CRAM-MD5 password authentication is unaffected and remains
your real access control. Second, run the relay with logging turned on so
the peer address is recorded somewhere -- socat's -d -d writes it at NOTICE
level, which under systemd lands in the journal.
CONCURRENCY
===============================================================================
Classic AmigaOS has no fork()/pthreads without ixemul, but it does have
CreateNewProcTags() (dos.library) -- the native primitive this port uses
to spawn each BinkP session as its own real process. An inbound
connection arriving while an outbound poll is already in flight, or
several networks polled back-to-back, no longer have to wait their turn.
See manual.txt section 05 for the full technical writeup of how this
works and what it took to get right on classic AmigaOS specifically.
QUICK INSTALL
===============================================================================
1. Copy the AmiBinkD folder to your BBS mail directory.
Example:
Mail:AmiBinkD/AmiBinkD
2. Copy AmiBinkD-example.cfg to AmiBinkD.cfg (or a per-network name --
see manual.txt section 07) and edit it: your domain(s), your FTN
address(es), sysname/location/sysop, log path, inbound directories,
and your node/hub line(s) with the real host, port, and password.
3. Create the directories your config references if they don't already
exist: the outbound directory named in each "domain" line, the
inbound/temp-inbound directories, and the log directory.
4. Test an outbound poll manually first, from a Shell:
AmiBinkD:AmiBinkD -p -P<address> AmiBinkD:AmiBinkD.cfg
Once that works, "-P ALL" in place of "-P<address>" polls every node
in the config in one go.
5. Review the log, then set up your regular polling schedule and/or
inbound server (see manual.txt sections 09-10).
BASIC MAIL FLOW
===============================================================================
1. AmiBinkD polls (outbound) or accepts a connection (inbound), performs
the BinkP handshake, and exchanges queued files/packets over TCP.
2. Received .pkt files land in your configured inbound directory.
3. Your tosser (e.g. C-Net/5's Toss) processes them into your message
bases.
4. Outbound mail queued by your BBS/tosser into the domain's outbound
directory gets picked up and sent on the next poll.
COMPANION TOOL
===============================================================================
AmiBinkD moves the mail. It does not process TIC files -- the file-echo
announcements that arrive alongside your packets.
RoFTIC handles that half: TIC processing, nodelist detection and
installation, archived-nodelist extraction, and a TrapList run when a
nodelist actually changed. It is a separate program with its own release
cycle, on Aminet as RoFTICv3_2c.lha.
Be aware of its scope: RoFTIC is written around C-Net/5's file base, and
its file-area destinations map into that layout. Every path is a config
keyword, so pointing it elsewhere is a matter of editing roftic.cfg -- but
it has only been run in anger against C-Net/5, and the documentation is
written from that angle. If you run another BBS, treat it as a starting
point rather than a drop-in.
Neither tool requires the other. AmiBinkD works with any tosser and any
TIC processor; RoFTIC works with whatever mailer put the files there.
===============================================================================
KNOWN ISSUES
===============================================================================
Very rarely, a write intended for one file can still appear in another. The
cause is in the C library: its file-descriptor table is a shared global with
no locking anywhere in its file layer, and this port runs sessions as
separate Processes in one address space, so two opening files at once can be
handed the same slot.
**v10.33 removes the log from that path entirely** -- it was the heaviest
user by far, one open and one close per line -- and 4,133 lines across two
days with outbound traffic showed none of the corruption that was previously
running at about 0.2%.
What remains is the lock-file writer and the file-transfer paths, which still
use the library's descriptors. Those operate at a small fraction of the
frequency, and v10.32's bound on the stale-lock loop means the worst
consequence -- a poll spinning and stopping outbound mail -- cannot recur.
Only ever observed under emulation.
===============================================================================
VERSION HISTORY
===============================================================================
v10.35 - Polls That Do Not Stall
--------------------------------
* A poll could stop dead partway through a session and stay stopped for
anything from ten minutes to two hours, ending only when the node at the
far end gave up waiting. The process stayed alive throughout and the log
simply went quiet, so nothing in it pointed at a cause.
On C-Net/5 this was worse than a lost poll. C-Net runs its polls from the
event scheduler, so a session that will not finish holds the scheduler
with it: on 30 August a stalled 13:30 poll took the local console login
down too, and the machine had to be restarted to get it back.
The cause was the mailer doing housekeeping on its own lock. Partway
through every handshake it scans the outbound queue, and that scan tidies
away stale .bsy and .csy lock files. The locks it examines are those of
the node at the other end of the call -- which, during a live session, is
exactly the node whose lock this session created when it dialled. It was
finding its own lock, judging it old, and going to the filesystem to deal
with it while the session sat on an unread socket.
The giveaway was that stall length tracked the kill_old_bsy setting
precisely: about two hours while that was set to 2h, then about fifteen
minutes three times running once it was lowered to 15m.
A lock a live session holds is by definition not stale, so there is
nothing there to clean up. It is now skipped without touching the
filesystem at all. Measured before the fix: nine stalls in 243 scans over
three days. After it, across five days of live polling, thirty-six polls
began and thirty-six ended.
* Nothing to configure. kill_old_bsy keeps whatever value you have given
it, and now applies only to locks no running session owns -- which is
what it was always meant to mean.
v10.34 - Says Who And What It Runs On
-------------------------------------
* The VER string sent to every node now follows the convention the rest of
the network uses -- mailer, version, operating system, then protocol:
AmiBinkD/10.34/Amiga binkp/1.1
Compare what arrives here from other systems:
binkd/1.1a-115/Linux binkp/1.1
Mystic/1.12A49 binkp/1.0
Through v10.33 this was sent as "AmiBinkD v10.33-binkp/1.1", which named
no operating system, used a space where the convention uses a slash, and
attached the protocol token with a hyphen instead of a space. binkd's own
parser searches for "binkp/" and so was never troubled by it, but a
stricter one could read "v10.33-binkp/1.1" as a single token, and nothing
told the remote SysOp what the mailer was running on. Every other mailer
reports its platform; there is no reason an Amiga should be the one that
stays quiet about it.
* The version number now has one definition in the source instead of two.
v10.33 collapsed three hardcoded copies into one and this splits that
cleanly into the bare number the VER string wants and the v-prefixed form
the log lines use, both derived from the same constant. Version drift of
this kind is what left the VER string reporting v10.19 for fourteen
releases.
* The time zone announced to peers is now read from AmigaOS instead of
guessed. Every mailer sends its local time and UTC offset during the
handshake; through v10.33 AmiBinkD sent the right wall-clock time with
the offset "+0000" attached, telling every node it polled that it sat on
the Greenwich meridian no matter where in the world it actually was.
binkd normally works the offset out by comparing gmtime() against
localtime(). That cannot work on this platform: AmigaOS has no TZ
database, and the C runtime's localtime() is gmtime(t - __timezone) with
__timezone never set, so the two agree exactly and the difference comes
out as zero.
AmiBinkD now asks locale.library, which is where AmigaOS actually keeps
the answer -- the zone you pick in Prefs/Locale, the same setting every
other localised program reads. Nothing to configure in AmiBinkD.cfg and
it is correct in any country.
IF YOUR OFFSET STILL SHOWS +0000: open Prefs/Locale, set your time zone,
and Save. An Amiga that has never had Locale prefs saved reports a GMT
offset of zero, and AmiBinkD cannot tell that apart from a system
genuinely running on GMT. Setting it once fixes it permanently.
DAYLIGHT SAVING IS MANUAL. AmigaOS has no concept of it anywhere --
loc_Flags is documented "always 0 for now" and the locale autodocs never
mention it. Locale prefs holds one fixed offset, and the zone entries are
STANDARD time. So if you are in a region that observes summer time, the
offset AmiBinkD reports is an hour off for half the year unless you
change it.
Worked example. Prefs/Locale set to Eastern stores a GMT offset of 300,
so AmiBinkD announces -0500. That is correct in winter and an hour out
from mid-March to early November, when the same clock is really -0400.
Two ways to handle it, both needing a change twice a year:
- pick the zone entry one hour off during summer time, or
- set "tzoff" in your config, which overrides Locale entirely:
"tzoff -4h" for US Eastern summer time, "tzoff -5h" for winter.
The second is usually tidier, since it leaves the system-wide Locale
setting alone for every other program on the machine.
This is a property of the operating system, not of AmiBinkD -- no Amiga
program can do better without a timezone database the OS does not have.
* Documented that AmiBinkD is IPv4-only, why that is a property of AmigaOS
rather than of this port, and how to put a v6-to-v4 relay in front of the
BinkP port if you need IPv6 callers to reach you. See the IPV4 AND IPV6
section in this file. No code change -- the behaviour was always this,
it simply was not written down, and a SysOp testing IPv6 had no way to
tell a platform limit from a bug.
v10.33 - Writes No Longer Land In The Wrong File
-----------------------------------------------
* Rarely, a write meant for one file appeared in another: log text inside a
.bsy lock file, or a fragment in the log with no timestamp. v10.32 shipped
with this documented as a known issue. The cause is now found, and the
worst of it is fixed.
It is in the C library, not in this port's logic. Every file descriptor
comes from libnix's ___allocfd, which scans a shared global table and grows
it with realloc(), reassigning the global pointer. Disassembly of that
layer -- open, close, write, read, lseek, fopen, fwrite -- shows ZERO
locking calls: no Forbid/Permit, no semaphore, nothing atomic.
This port runs each session as a separate Process sharing ONE address
space, so they all share that table. Two Processes opening files at the
same moment can be handed the same slot, and the loser's descriptor then
refers to the winner's file.
Log() was that layer's heaviest user by a wide margin -- one open and one
close for EVERY line. It now writes through dos.library directly
(Open/Seek/Write/Close on a BPTR) and never touches the descriptor table,
so the log can no longer corrupt another file or be corrupted by one.
Measured: 4,133 log lines across two days with outbound transfers, zero
corrupted lines. Before the change the rate was ~0.2%, which would predict
eight or nine.
NOT a complete fix -- the lock-file writer and the transfer paths still use
the library's descriptors and can still collide with each other. Those are
far lower frequency. See KNOWN ISSUES.
* THE VERSION YOUR PEERS SAW WAS WRONG BY FOURTEEN RELEASES. The name and
version were hardcoded in three separate places -- the BEGIN line, the END
line, and the VER string sent to every node polled. VER still read
"AmiBinkd v10.19" while the binary was v10.33, so every node you polled
since v10.19 recorded the wrong version, including under v10.32. There is
now one definition used by all three, so they cannot drift apart again.
* The name is normalised to AmiBinkD throughout -- program strings, shipped
filenames, configuration and documentation.
v10.32 - A Bad Address Can No Longer Spin Forever
------------------------------------------------
* A poll process span inside the stale-lock cleanup from 12:00 until a
restart at 18:52 -- 2.2 million log lines, 181MB, and no outbound mail for
6 hours 52 minutes. Inbound sessions carried on normally throughout, which
is exactly why nothing looked broken.
It looped on "80:774/999@amiganet": the wrong domain for that zone, a node
number that does not exist, and a matching lock file on disk. The address
came from corruption -- a sibling lock file was found holding a fragment of
a LOG LINE where its contents should have been.
The cleanup has two safety mechanisms, a backoff hold and a give-up
counter, and BOTH are stored on the node record. An address that matches no
configured node has no record, so both were skipped -- the protections
switched themselves off precisely when the input was garbage.
An unknown address now gets one unlink attempt and is then left alone. A
stale lock for a node you do not carry is harmless; nothing polls it.
This BOUNDS the damage. It does not fix the corruption that produced the
bad address -- see KNOWN ISSUES.
v10.31 - A Log You Can Read Without Editing It
---------------------------------------------
* At loglevel 4 a single received file cost three lines and one OPT exchange
cost seven:
- receiving 86be1d03.pkt (2249 byte(s), off 0)
+ 86be1d03.pkt -> DH3:Echomail/Inbound/86be1d03.pkt
+ rcvd: 86be1d03.pkt (2249, 2249.00 CPS)
Measured over one night, the remote's greeting block alone (OPT, ZYZ, LOC,
NDL, TIME, VER, BUILD, TRF, QSIZE) was 22% of the log -- all of it emitted
by one Log() call in the M_NUL handler.
Level 4 is now meant to be read as-is: one line per connection, one per
file, one per result, plus the remote's SYS name and FTN addresses. The
detail moved to level 5 and above, where raising loglevel brings it back.
A 139-line poll window became 54.
* Removed AmiBinkD's own "handoff:" debug lines from normal view (now level
7). Those trace the AmigaOS ReleaseSocket/ObtainSocket dance used to pass a
socket to a child process. Upstream binkd forks and inherits the descriptor,
so it has no equivalent message -- this port had been printing its own
internals, including pointers and file descriptor numbers, into every
sysop's log since v10.17.
* The benign .bsy unlink race is now level 5. It is a race between processes,
not a fault, and nothing accumulates on disk -- but at level 4 it produced
dozens of "could not remove own lock ... Permission denied" lines a night,
which reads like a broken install.
* Because level 4 no longer needs trimming, the "nolog" masks are gone from
the example config. "nolog" is unchanged and still documented (manual
section 06) for masking a message once you have RAISED loglevel.
* Protocol and behaviour are untouched. Every change was a log level.
v10.30 - One Line Per Inbound Connection
----------------------------------------
* An inbound connection was announced twice, by two different processes:
incoming from 72.58.128.97 (60539)
Incoming: 72.58.128.97
The first is kept and renamed -- it carries the port, which the second did
not -- and the second is now outbound-only. Outbound output is unchanged.
One consequence worth knowing: inbound peers are shown by IP rather than
reverse-DNS name, because the accepting code resolves numerically on
purpose. The session logs the remote's own SYS/ZYZ/LOC identity moments
later, so the peer is not anonymous.
v10.26 to v10.29 - Session IDs and a Quieter Lock Race
------------------------------------------------------
* Every session logged the same id, so concurrent sessions could not be told
apart in the log. Each session now logs its own AmigaOS task id.
This is the shared-address-space trap that runs through this port: sessions
are separate Processes but share ONE address space, so a file-scope static
is shared by all of them. (v10.27 promptly reintroduced the same bug in a
diagnostic and v10.29 removed it again.)
* Failing to remove our own .bsy lock is no longer reported as a fault when
another process got there first -- that is the job done, not an error.
v10.25 - Log Lines Stop Being Shredded
--------------------------------------
* Log lines were being torn apart mid-write when two AmiBinkD instances ran
at once. A real example:
+ 18 Aug 21:07:52 [1081963032] pwd protected session (MD5)
nux/64 <- fragment of "Linux/64"
115 <- fragment of "binkd/1.1a-115"
Log() already took a lock, but a PRIVATE one. Upstream binkd is a single
process with threads, so a private semaphore covers every writer it has.
This port runs the inbound server and each poll as separate program
invocations, so two or three instances write the same file with no lock
between them.
Log() now uses an Exec PUBLIC semaphore ("AmiBinkD.log"), which is the
AmigaOS mechanism for locking across separate programs.
NOTE: the fix only holds once EVERY instance is running v10.25. Replacing
the binary is not enough on its own -- the long-running inbound server keeps
the old code until AmigaOS restarts it, and a v10.24 server will still
interleave with a v10.25 poll.
* Removed the "servmgr listen on *:24554" line. The port is already in the
config, and the line cost width without adding anything.
* The startup banner now credits the port alongside the original author.
v10.24 - Outbound Mail Actually Leaves The System
-------------------------------------------------
* THE BIG ONE: no outbound mail had ever left this port. Every bundle went
out at 0 bytes while a perfectly good ZIP sat on disk holding the packet.
Nothing logged an error, because no layer had one -- the tosser packed
correctly, and AmiBinkD sent exactly the number of bytes it was told the
file contained.
The cause is in the C library, not in binkd. libnix13's fstat() always
reports st_size == 0: it seeks to the start of the file and then measures
with SEEK_CUR, which can only ever return zero. It should use SEEK_END.
fstat() SUCCEEDS while doing this, so every caller receives a valid-looking
struct describing an empty file.
protocol.c does fopen + fstat + use st_size, exactly as upstream binkd
does on every other platform. amiga/fstat.c now overrides fstat() to
re-measure with SEEK_END and restore the caller's file position.
If you run any Amiga software built with -mcrt=nix13 that depends on file
sizes, this bug affects it too.
* Socket errors now name their real cause. bsdsocket.library never wrote to
errno because SBTC_ERRNOPTR was never set, yet binkd reads socket errors
as strerror(errno) on AmigaOS -- so every socket error printed a stale
value left by some unrelated call, usually "Permission denied" from a
failed .bsy unlink. You will now see "Connection reset by peer" and
"Broken pipe" where the log used to blame permissions.
* AmigaOS "Please insert volume ..." requesters no longer freeze the mailer.
pr_WindowPtr is set to -1 so DOS errors return to the caller instead of
waiting for a human to click Cancel.
* Poll times dropped from ~14s to 3-5s. Removing one of our own lock files
used a 4-second blocking delete; it is now ten bounded retries totalling
about 400ms, and stale-lock cleanup makes a single non-blocking attempt.
* libnix stdio's global file list is now guarded by a semaphore. Sessions
are real concurrent AmigaOS Processes sharing one address space, and
libnix's stdio has no locking of its own.
v10.18 - Inbound Sessions Stop Hanging, Readable Session Log
-----------------------------------------------------------
* The session log was rewritten to be readable on an 80-column screen --
a blank line between sessions, an explicit END marker, and shorter
messages. "BEGIN" alone went from 120 columns to 68; it had been the
only line in a poll that wrapped twice. Lines over 80 per poll dropped
from nine to four.
Everything else is done from configuration, not code. "loglevel"
controls detail. Level 4 is the default and is meant to be read as-is:
one line per connection, one per file transferred, one per result, with
the remote's SYS name and FTN addresses. Raise it to 5 or higher for the
full protocol conversation -- the remote's greeting block, mode
negotiation, per-file bookkeeping and socket handoff all live there.
Because level 4 is already trimmed, the "nolog" masks that earlier
versions needed are gone from the sample config. "nolog" is still
supported and documented in manual section 06, for masking a specific
message once you have raised loglevel. It takes ONE MASK PER WORD: a
mask written with spaces is split, and a stray bare "*" among the
pieces silences the log completely.
* AmiBinkD no longer identifies itself as part of any BBS package. The
VER string sent to every node you poll is now "AmiBinkD v10.18-binkp/1.1",
matching the form other mailers use. It previously named a specific BBS,
which was wrong for a general AmigaOS mailer.
* Upgrade from v10.15, which is the previous public release. v10.16 and
v10.17 were never released -- they are listed further down because
they explain the version jump and because the AmigaOS problems they
uncovered are worth passing on to anyone else porting to this
platform. Nothing shipped between v10.15 and this release.
* The root cause, after three releases of narrowing it down, was
setting a file's datestamp. On AmigaOS that is SetFileDate(), and
when another Process holds the file it does not return an error --
it never returns. No timeout bounds it, nothing watches the session,
so the session is gone: it keeps its server slot, socket and .bsy
locks forever. Enough of those and the server hits "maxservers" and
refuses all inbound.
It only bites when something else is touching the same directories.
On the author's system that is C-Net/5's own overnight file-catalog
jobs, which is why it looked like a night-time-only fault: 66 of 66
inbound commits succeeded during the day, and 7 of 7 hung after
21:00. One of those hangs landed inside a poll client, so the BBS
event that launched it never finished and outbound mail was dead
for seventeen hours.
* Fix: new "set-file-dates" setting, defaulting OFF on this port (see
the manual, section 06). Every other binkd platform defaults it on;
this is the one place AmiBinkD deliberately differs. What you give
up is cosmetic -- received files carry their arrival time rather
than the sender's timestamp. Nothing in BinkP, tossing or duplicate
detection depends on it. Turn it on only if you are certain nothing
else touches your inbound/outbound directories while the mailer
runs.
* Verified over an 18-hour run spanning the overnight window that
broke the previous release: 89 inbound sessions started, 89 closed,
nothing leaked, 351 file commits, concurrent-session count peaking
at 5 and returning to zero between polls, and all 59 scheduled BBS
mail events completing. For comparison, v10.16 saturated in 13
hours and v10.17 had leaked 55 sessions by 26 hours.
* Also fixed: "unknown domain" errors and silently-skipped polls. Not
a bug you could have hit -- it existed only in an unreleased build
-- but the cause is worth passing on, because the build system, not
the code, was at fault. Object files did not depend on headers, so
changing a shared struct rebuilt only some of the program and left
the rest reading the old field offsets. The binary linked, ran, and
quietly stopped calling out on six of seven networks. If you build
this yourself from an older Makefile, do a full "make clean" after
touching any header.
v10.17 - One Hung Session No Longer Takes The Others With It (unreleased)
------------------------------------------------------------------------
* Never released; superseded by v10.18. Sessions refresh their
.bsy datestamps on every pass of the protocol loop, and that work
was done holding a single global lock across file I/O. One session
blocking in there pinned the lock and every other concurrent session
piled up behind it -- so a single stuck file operation took down
every session on the system, and the pile-up fed itself. v10.17
stopped the cascade (the lock is never held across I/O now, and is
never waited on), but a session could still hang on its own. v10.18
removes the hanging call entirely.
v10.16 - Inbound Socket Handoff (unreleased; fix retained in v10.18)
-------------------------------------------------------------------
* Never released. Its inbound fix was real and is retained in v10.18,
but on test it traded one failure for another: sessions that hung
leaked permanently and piled up until inbound stopped, which in
practice was worse than v10.15's quieter failure. That leak is what
v10.17 and v10.18 went on to fix. The notes below are kept because
the underlying problem is instructive for anyone porting to AmigaOS.
* Worth doing whatever mailer you run: if your BBS event script
deletes .bsy/.csy files before polling, make sure a failed delete
cannot abort the script -- on AmigaDOS, wrap them in "FAILAT 21"
and "FAILAT 10". A lock file held by a live session is otherwise
enough to kill the whole event, and your mailer never runs. The
"kill-old-bsy" setting already removes stale locks for you.
* Inbound BinkP sessions never worked at all, in any release from
v10.5 through v10.15.
The symptom was easy to blame on the other end. Your log recorded
"incoming session with <peer>" and then nothing further - no error,
no timeout, no session close - while the caller gave up reporting
"Session timeout" and "Authorization failed". Worse, a stuck session
never freed its server slot, so the next caller was refused outright
and inbound mail stopped within minutes of every startup. Restarting
appeared to help, which made it look like an intermittent fault.
Outbound polling was completely unaffected, so mail you fetched
yourself kept arriving normally and the problem was easy to miss.
Cause: AmigaOS gives each Process its own bsdsocket.library context.
Since v10.5 every session runs as its own Process, and inbound
sessions were using the parent's shared library base for a socket
they did not own. Socket readiness is delivered by signal, and those
signals never reached the child - so an inbound session could neither
send nor receive, and simply sat there. v10.12 fixed the same class
of problem for outbound connections but did not cover inbound.
AmiBinkD now transfers the socket to the session's own private
library base (ReleaseSocket/ObtainSocket), which is the documented
AmigaOS way to hand a socket between Processes.
* Also resolved by the same fix: sessions ignoring the "timeout"
setting. A stalled session used to linger indefinitely; it now closes
on schedule. No configuration change is needed - if you added
settings while working around the old behaviour, you can remove them.
* Do NOT set "maxservers" as a workaround for the old symptom. On this
port a rejection can take the server manager down with it. Leaving it
unset (default 100) is correct.
* Verified live: five consecutive inbound sessions from a network hub
in 44 seconds - full handshake, CRAM-MD5 authentication, packets
received, clean teardown each time, listener still accepting
afterwards. Outbound polling unchanged in the same period.
v10.15 - Poll Every Network From One Config ("-P ALL"), Custom Icon
------------------------------------------------------------------
* New: "-P ALL" polls every node in the config in a single invocation:
AmiBinkD:AmiBinkD -p -PALL AmiBinkD:AmiBinkD.cfg
Stock binkd's -P takes one FTN address per switch, so carrying
several networks meant either repeating -P once per uplink or
keeping a separate config and driver script for each. One config
and one command line now cover all of them; the inbound server
("-s") already used the combined config, so both sides finally read
the same file. Nodes with no host to call, and your own addresses,
are skipped rather than polled, and the log summarizes what was
created ("ALL: created 7 poll(s)"). See manual.txt sections 07-09.
* Worth checking alongside it: "maxclients" now decides something it
never did before. With every uplink pollable in one run, its default
of 100 means all of them are called at once, where the one-script-
per-network pattern was strictly sequential. See manual.txt section
06.
* Confirmed live: a scheduled poll cycle logged "ALL: created 7
poll(s)" and completed clean sessions with all seven networks.
* The icon work below was briefly released on its own as a
packaging-only 10.15 carrying the v10.14 binary. "-P ALL" was folded
into the same version number rather than becoming 10.16, so that
10.15 isn't a version with nothing to point at. If your AmiBinkD10_15
archive holds a binary that reports v10.14 at startup, it's that
earlier cut -- replace it with this one.
* Replaced AmiBinkD.info -- previously a reused copy of another local
project's icon -- with a purpose-made one: the Reign of Fire
dragon-head badge, cropped to its circular emblem, quantized to a
64-colour palette-mapped image, and alpha-masked to a circle so it
sits cleanly on the Workbench desktop instead of carrying a black
square background. Includes a distinct brighter "selected" image for
the icon's clicked state.
* Built with icon.library's own V44+ API (NewDiskObject/IconControlA/
PutIconTagList) instead of a hand-rolled on-disk format, so the OS's
own code produces the file. See manual.txt section 18 for the full
writeup and where the build tooling lives.
Requires AmigaOS 3.5+ (icon.library V44) to render the colour image;
older Workbench versions fall back to a generic tool icon.
v10.5-v10.14 - Real Concurrency, and the Hang It Exposed
-----------------------------------------------------------
Thirteen point releases' worth of work, summarized here; see manual.txt's
own Version History (section 18) for the full technical writeup of each.
* v10.5 added real concurrency: each BinkP session now runs as its own
AmigaOS process via CreateNewProcTags(), instead of one session at a
time synchronously. See manual.txt section 05.
* v10.6-v10.7 fixed two bugs concurrency itself exposed: a stale-lock
give-up/backoff that wasn't actually being honored, and an errno race
at a critical logging section under real concurrent inbound load.
* v10.8-v10.12 chased down and fixed the hardest bug in this project:
every outbound poll would hang indefinitely, even though the real TCP
connection completed in under a second every time. Two plausible-
looking fixes (different techniques for detecting when a non-blocking
connect() finishes) both failed live before the real cause was found:
a blocking bsdsocket.library call's internal completion notification
never reaches a spawned, non-opener AmigaOS process. Fixed by giving
each outbound-connecting session its own private bsdsocket.library
instance. See manual.txt section 05 and readme's counterpart, this
project's README.md, "Real-hardware findings" #10, for the full story.
* v10.9/v10.13/v10.14 dealt with the same root cause showing up in
gethostbyname() too. v10.9 worked around it with a host-side DNS
cache; once v10.12's real fix landed, v10.13 confirmed (over a
two-day, two-reboot soak) that the cache was no longer needed, and
v10.14 removed it for good -- hostname resolution is a plain
gethostbyname() call again, same as every other platform binkd
supports.
v10.1 - .csy/.bsy Unlink Fix
------------------------------
* Fixed the .csy/.bsy busy-flag file occasionally failing to clean up
after a session ("Text file busy") -- the cleanup now retries instead
of giving up after one attempt. Cosmetic in v10.0 (never blocked a
session either way), but the retry is more robust and matches how the
rest of the codebase already handles this class of transient Amiga
file-lock race. Verified live on production. See manual.txt section
18 for the full technical writeup.
v10.0 - Native AmigaOS Port
----------------------------
* Rebuilt from a clean upstream binkd checkout with every ixemul/ixnet
dependency replaced by native AmigaOS/bsdsocket.library equivalents,
rather than patching an incomplete existing Amiga port.
* Runs each BinkP session synchronously (no fork()/pthreads needed) --
a genuine, working single-session-at-a-time design.
* Found and fixed several real behavioral differences between
Amiberry's bsdsocket_emu and genuine BSD sockets that only surfaced
under live testing (getaddrinfo(), non-blocking I/O, accept()
blocking after a ready select(), WaitSelect() signal handling) -- see
manual.txt section 15 for the full list.
* Verified two ways before shipping: cross-compiled clean (zero
warnings) with the bebbo/amiga-gcc toolchain, and run live on a
production Amiberry instance -- confirmed both outbound (client/poll)
and inbound (server) sessions, including a full multi-network polling
run (7 networks) with real inbound file reception and successful
tosser import, not just clean-looking session logs.
* Soak-tested unattended overnight across all 7 configured networks with
no hangs, no gaps, and no recurrence of any fixed bug.
For the full technical history -- every ixemul-era assumption replaced,
every real-hardware finding, and why each fix works the way it does --
see manual.txt sections 15 and 18.
SECURITY NOTES
===============================================================================
AmiBinkD accepts inbound TCP connections and moves files onto your
system based on what a remote FTN node sends it.
Recommended precautions:
* Set a real per-node password (areafix password) for every "node" line
-- don't leave a node unauthenticated unless you mean to.
* Use send-if-pwd (on by default in the example config) so an
unauthenticated session can only receive, not pull mail from you.
* Keep your inbound/outbound directories separate from directories your
BBS treats as directly executable or auto-processed without review.
* Review your log regularly.
* Keep backups.
LICENCE
===============================================================================
AmiBinkD is free software. It is a port of binkd, every source file of
which carries the GNU General Public License header, so AmiBinkD is
distributed under the same terms:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
The complete licence text is in COPYING, included in this archive. Read
it before you redistribute AmiBinkD, modify it, or bundle it with a BBS
package -- it permits all three, and it has conditions.
SOURCE CODE
The GPL requires that anyone who receives this binary can get the source
it was built from. The complete source for this release, including the
AmigaOS-specific work that is not in upstream binkd, is at:
https://github.com/SpitfireTN/AmiBinkD
Each release is tagged, so v10.35 is the exact tree this executable was
compiled from. If you cannot reach GitHub, write to
spitfiretn@gmail.com and a copy of the source will be sent to you.
Upstream binkd, from which this is ported, is at:
https://github.com/pgul/binkd
Copyright:
binkd (C) 1996-2015 Dima Maloff 5047/13 and others
AmigaOS port (C) 2026 Gary "Spitfire" McCulloch
AmiBinkD is free of charge, and free in the GPL's sense as well: you
may pass it on, put it in your own BBS's file area, or ship it with a
package, provided this licence and the source stay available with it.
DISCLAIMER
===============================================================================
AmiBinkD is provided as-is. It is a from-scratch reconstruction of
ixemul-dependent Amiga binkd behavior verified against one real system
(Amiberry-emulated AmigaOS 3.x, bsdsocket_emu) -- other bsdsocket.library
implementations (real Roadshow, AmiTCP) have not been tested and may
behave differently; see manual.txt section 15 before assuming a finding
there applies to your setup.
Every FTN network and BBS system is different. Test carefully before
using this on a live system carrying real mail.
The author is not responsible for lost mail, misconfigured domains/
addresses, missing passwords, or damage caused by improper setup.
Always keep backups.
CREDITS
===============================================================================
AmiBinkD is a native AmigaOS port of binkd
(https://github.com/pgul/binkd), originally written by Dima Maloff and
maintained by the binkd project. All BinkP protocol logic, FTN packet
handling, and configuration semantics are upstream binkd's; this port's
own work is the AmigaOS/bsdsocket.library integration layer and the
real-hardware fixes documented in manual.txt.
Earlier Amiga port (AmiBinkD v5.00 - v9.02, 2012-2013):
Rudi Timmermans, X-TReMe BBS
AmiBinkD carried this name on the Amiga long before the present release.
Rudi Timmermans built and maintained it through v9.02, made it freeware
at v5.00, and got a working BinkP mailer onto classic AmigaOS at a time
when that meant living with ixemul.library. This port is a from-scratch
reconstruction rather than a recompile of his -- the ixemul dependency is
gone and every session now runs as a native AmigaOS process -- but the
program's name, its configuration file format, and the shape of its
session log all come from his work, and the log is still recognisably the
same one his v9.01 produced in 2013. Credit where it is due.
Built and tested for:
Reign of Fire BBS
C-Net/5 Amiga Pro
call.rofbbs.com:6800
Website:
https://www.rofbbs.com
SysOp / Author (Amiga port):
Gary "Spitfire" McCulloch
Networks tested against:
AmigaNet, ArakNet, CommodoreNet, DiscipleNet, FidoNet, PiNet, RetroNet
===============================================================================
END OF README.TXT SpitfireTN Entertainment
===============================================================================
|