welcome: please sign in
location: ModernClientsWithFBB

AmateurRadio > PacketRadio > PacketRadioBBS > FBB > ModernClientsWithFBB

Using Modern Clients with FBB

Packet BBSs work great for what they're intended to do: provide access to messaging within a low-bandwidth environment. They, however, don't do a good job of things such as tracking what bulletins you've already read.

The tips on this page are premised on the notion that both packet P-mail ("private" mail) and bulletins bear strong resemblance to standard Internet RFC2822-format email. I (JohnGoerzen) have set up systems so that I can use standard mail clients like mutt and Thunderbird with packet mail and BBSs.

To do this, I set up FBB with the POP, NNTP, and SMTP servers on my machine. This lets you choose your own client with the features you like. I'll go over the setup for this on this page.

FBB setup

As mentioned on the FBB page, FBB includes POP, NNTP, and SMTP servers. For those of you not familiar with those, they function in this way:

The exact setup probably requires a very recent 7.04r FBB release; see the FBB page for information on the (sometimes surprising) locations for obtaining the latest releases.

port.sys setup

The first step to enabling POP, SMTP, and NNTP is editing your FBB's port.sys file.

The key to doing this is not very well-documented, but it works like this, as an example:

  #Com Interface Address (device)   Baud
  6    9         56B9:56BA:77       0

The address field has three port numbers, expressed in hex, in this format: POPPORT:SMTPPORT:NNTPPORT. If you don't wish to run a specific server, you can list a port number of 0.

In this example, the POP server is on port 22201, SMTP on 22202, and NNTP on 119. This puts POP and SMTP on non-standard ports, and NNTP on a standard port, reasoning that few machines are likely to already have an NNTP server running.

After restarting FBB, you should be able to telnet to each of these ports and see a greeting string.

User account setup

As the SYSOP, you will need to run EU on the user account and set a password. You may also have to set some flags such as M; this needs further testing.

P-mail setup

This is pretty easy. You can set up any mail reader that supports POP and distinct SMTP accounts. Thunderbird is one example. Here's what you'll tell it:

Other programs, such as fetchmail, can easily pull down this mail as well.

The moment you download your mail with a POP client, the message will be marked Y (read) on the FBB server.

This is all you need to do and it'll make things Just Work.

Bulletin Setup

Now, let's look at bulletins. Bulletins can be both read and posted using the NNTP protocol. However, in testing, I discovered that the NNTP protocol implementation in FBB is too buggy for every current newsreader I tried. Its XOVER and XHDR implementations both are severely broken and may cause a client to hang.

However, there's a very nice NNTP command-line scriptable client called sinntp, which actually provides what may be a more elegant solution. I will show you how to set up sinntp along with some scripts to integrate it nicely with mutt.

sinntp basics

sinntp downloads messages from an NNTP server and saves messages from each "newsgroup" into an individual mbox-style mailbox file. FBB defines newsgroups as those groups listed in themes.sys, though when posting a bulletin, the Newsgroups header should be set to CALL@DEST instead. Once you have an mbox-style file, you can do just about anything with it -- read it with a mail client, transfer it to your regular mail account, etc.

My scripts will take that mbox and copy the messages in it to a Maildir, another standard mailbox format that is a bit easier to work with reliably.

sinntp also includes a command-line tool to post new messages to an NNTP server. I will show you how to integrate this with mutt.

These sinntp commands will be used:

Basic Scripts

I have set up a ~/Mail-fbb for this stuff. Within it, I made four directories: incoming, data, folders, and bin. The scripts I will show are to be saved into bin.

You will need some tools. Here are the Debian package names; on other distros, look for something similar:

We'll start building this up from the most specific to the most general. This script is called bin/proc-each-msg and is called for each message downloaded. It copies the Newsgroups: header to a Mail-Followup-To header, which causes replies generated in mutt to be posted to the correct newsgroup automatically. It also delivers to a destination Maildir automatically.

   1 #!/bin/bash
   2 
   3 # Script to receive each message from formail -s.
   4 # Copy the Newsgroups header to Mail-Followup-To.
   5 # Deliver to a destination Maildir.
   6 
   7 # Needs destination Maildir as "$1".  Additional destinations may be listed
   8 # as parameters as well.
   9 
  10 set -e
  11 
  12 if [ ! -d "$1" ]; then
  13     echo "Syntax: $0 destMaildir"
  14     exit 5
  15 fi
  16 
  17 TEMPDIR=`mktemp --tmpdir -d fbb-procmsg.XXXXXXXX`
  18 TEMPFILE="$TEMPDIR/msg"
  19 
  20 cat > "$TEMPFILE"
  21 
  22 NEWSGROUPS=`formail -x Newsgroups: < "$TEMPFILE"`
  23 
  24 while [ -n "$1" ]; do
  25     formail -A "Mail-Followup-To: $NEWSGROUPS" < "$TEMPFILE" | \
  26         deliverquota "$1"
  27     shift
  28 done
  29 
  30 rm -r "$TEMPDIR"

Next, here's bin/get-news, the main driver behind all of this. You will need to edit this one a bit. If you use the archive feature, run "maildirmake ~/Mail-fbb/archive" before using this. The archive feature places a copy of every received message in an archive area for future processing or reference.

   1 #!/bin/bash
   2 
   3 # Main runner script
   4 
   5 # Set this to the top-level directory for your setup.
   6 
   7 FBBMAILHOME=~/Mail-fbb
   8 
   9 # Before running, cd to that directory and run:
  10 #    mkdir incoming data folders
  11 #    maildirmake archive
  12 # If you don't want archiving, delete the reference to archive on the
  13 # formail -s line below.
  14 
  15 # Groups to ignore.
  16 IGNOREGROUPS="ASIA|WPUPDATES|SAT|SATELLITE|WEATHER"
  17 
  18 # script follows.
  19 
  20 set -e
  21 
  22 # Change to home directory for the system
  23 cd "$FBBMAILHOME"
  24 
  25 # Grab the list of groups.
  26 
  27 SINNTPOPTS="-S localhost -U XX0XX -P MYPASSWORD"
  28 nntp-list $SINNTPOPTS | egrep -v "^($IGNOREGROUPS)$" > data/groups
  29 
  30 # Download the mail into incoming/
  31 
  32 cd incoming
  33 for GROUP in `cat ../data/groups`; do 
  34     nntp-pull $SINNTPOPTS "$GROUP" || true
  35 done
  36 
  37 cd "$FBBMAILHOME"
  38 
  39 # Store the mail into folders.
  40 
  41 for GROUP in `cat data/groups`; do 
  42     if [ ! -d "folders/$GROUP" ]; then
  43         maildirmake "folders/$GROUP"
  44     fi
  45 
  46     if [ -f "incoming/$GROUP" ]; then
  47         formail -s bin/proc-each-msg "folders/$GROUP" archive < "incoming/$GROUP"
  48         rm "incoming/$GROUP"
  49     fi
  50 done
  51 
  52 # All done!
  53 

Mutt setup

Now, let's set up ~/Mail-fbb/muttrc for mutt. A few things we want to do here:

  1. Recognize the folders under ~/Mail-fbb/folders
  2. Support posting replies to bulletins and new bulletins there.
  3. Optionally, also support sending P-mail using the SMTP server.

So here we go. You'll need to edit your callsign and password in here a few places.

# Example muttrc for FBB NNTP integration

# Set this to your BBS hierarchical path
set from="XX0XX@ZZ0ZZ.#ENY.NY.USA.NOAM"

# Set this to your folder path
set folder=$HOME/Mail-fbb/folders

# And this to your INBOX folder
set spoolfile=$HOME/Mail-fbb/folders/INBOX

mailboxes "=INBOX"

`echo -n "mailboxes " ; \
 for group in $(ls $HOME/Mail-fbb/folders/); do \
    echo -n " =" ; \
    echo -n "$group" ; \
 done ; \
 echo " " `

# Other Settings

# Delete without prompting
# set delete=yes

set use_from=yes
set mbox_type=Maildir

unset sendmail

folder-hook INBOX unset sendmail
folder-hook INBOX set smtp_url="smtp://localhost:22202/"
folder-hook INBOX unmy_hdr To
folder-hook !INBOX unset smtp_url
folder-hook !INBOX 'set sendmail="nntp-push -S localhost -U MYCALL -P PASSWORD -p strip_headers"'

#set record="~/Maildir/.sent-mail"

set delete=yes
set mark_old=no

And finally, how about a simple script to use to start mutt with? Save this to bin/fbbmutt:

   1 #!/bin/bash
   2 exec mutt -F ~/Mail-fbb/muttrc "$@"

Use

Now, run bin/get-news to download your mail. You can then run bin/fbbmutt to read your mail. You can press c to change to a different group, and any groups with unread mail will show up automatically. You can send a new message to CALL@DEST from any folder but INBOX to post a new bulletin, can use g to reply to a bulletin with a new bulletin.

WikiCompleteOrg: ModernClientsWithFBB (last edited January 03, 2011 by JohnGoerzen)