Server

Installing the PSKmail Server

.

The PSKmail server files

fldigi a multimode digital modem program for linux
arq.pm a PERL module containing the common primitives for the arq protocol
rflinkserver.pl the program containing the server protocol, the POP client, the SMTP client and the internet document server
pskmailrc.pl The configuration file
user_db.pl the database maintenance program
rflink_users.db the PSKmail user database (empty, 1 TEMPLATE)

Current version is pskmail_server-0.7.1 (When page this was created)

UPDATE : Current version is pskmail_server-2.4beta (17/12/2017)

Download the archive at http://sharon.esrac.ele.tue.nl/pub/linux/ham/pskmail/ Nota: URL need to be updated

Install

Briefly the install procedure is as follows
1.Get fldigi and install it
2.Get the latest server archive and unpack it in your home folder
3.Get necessary dependencies through cpan and your distro package manager
4.Edit pskmailrc.pl and set your callsign and position etc
5.Move word_table and cbh_code.pl to the hidden folder ~/.cbh
6.Install the elinks browser, gpsd and libhamlib tools from your package manager
7.For UBUNTU install scripts for the libraries and the program are included in the archive

Here follows detailed descriptions for some popular distros.


Fedora Core 8

1. Get fldigi, unpack and copy the binary to /usr/bin (like "cp fldigi /usr/bin") as root
2. Open the graphical package manager and install the following:
hamlib
perl-CPAN-1.76_02-32.fc8
perl-Digest-CRC-0.10-2.fc8
perl-IO-Socket-SSL-1.02-1.fc8.1
perl-Net-SSLeay-1.30-5.fc8.1
compat-libstdc++-296-2.96-139
compat-libstdc++-33-3.2.3-62
gpsd-2.34-8.fc8
lynx-2.8.6-7.fc8

After that is installed just start fldigi and make sure it works…

3. Get the latest pskmail server and unpack it in your home folder, get that here DownloadDownloads
4. Create an empty file named aprslog in your home folder: touch aprslog
5. Proceed to configure pskmailrc.pl and the local database (if necessary)

That should be it. You wont have to recompile Net::SSLeay as its fine in the distro.


Ubuntu 8.04 (Hardy)

The install procedure of the pskmail server
has been divided in two scripts:

•libinstall.sh to install necessary libraries and fldigi (2.05)
•install.sh to install the latest version

Installing libraries and Fldigi

You need to be connected to the internet to install the following packages:
libportaudio2, libhamlib2 and fldigi.

and the needed libraries:
libgtk2-gladexml-perl, libdigest-crc-perl, gpsd, Net::GPSD, hamlib-utilities

To install them just run the script from the installation directory:

cd pskmail-x.x
sudo ./libinstall.sh
answer 'Y' to the questions…

Installing pskmail

To install the newest version run the install.sh script from
the installation directory as root:

sudo ./install.sh

The install script copies the executables to their proper location
and makes a directory ~/.pskmail which contains your files and directories.

Run the server
Do pskmail_server in a terminal.


Ubuntu 7.04

1. Get fldigi and copy it to /usr/local/bin. I got the precompiled nhl-version from here http://www.w1hkj.com
2. Create an empty file in your home folder that sets modem mode for fldigi: echo "" > PSKmailserver
Explanation: When fldigi finds that file, in the directory where it is started, it sets pskmail mode.
3. Get the latest pskmail server and unpack it in your home folder, get that here Downloads
4. Install gpsd, lynx, elinks and libhamlib-utils from synaptic

The following steps use cpan, in order for that to work you need gcc and g++ (fetch using synaptic if not installed).
5. get Digest::CRC through cpan. Enter: "sudo cpan Digest::CRC"
6. Get openssl: "wget http://www.openssl.org/source/openssl-0.9.7d.tar.gz"
7. unpack openssl: "tar zxvf openssl-0.9.7d.tar.gz"
8. Prepare to build openssl: "cd openssl-0.9.7d" and "sudo bash" (This sets root mode for the terminal)
9. Install openssl, enter as follows:
"./config"
"make"
"make test"
"make install"
10. Time to get Net::SSLeay. Cpan failed to install that on my server so I had to do it "manually". If cpan succeeds then you wont need the manual procedure. Start by entering "cpan Net::SSLeay", on my server cpan failed to find open ssl and I had to do the install manually:
cd ~/.cpan/build/Net_SSLeay.pm-1.30
./Makefile.PL
make
make install
11. Time to get some more from cpan, answer yes if cpan wants to take care of dependencies for you:
cpan IO::Socket::SSL
cpan Mail::POP3Client
cpan Net::GPSD
cpan Email::LocalDelivery
cpan Email::Folder
cpan Net::SMTP::TLS
This ends the need to use the root user, leave by entering: exit
12. Create an empty file named aprslog in your home folder: touch aprslog
13. Create the word table folder and copy necessary files there:
mkdir .cbh
cp word_table .cbh
cp cbh_code.pl .cbh
14. Proceed to configure pskmailrc.pl and the local database (if necessary)


Mandriva 2007:

1. Get fldigi and copy it to /usr/bin. I got the precompiled nhl-version from here http://www.w1hkj.com
2. Create an empty file in your home folder that sets modem mode for fldigi: echo "" > PSKmailserver
Explanation: When fldigi finds that file, in the directory where it is started, it sets pskmail mode.
3. Get the latest pskmail server and unpack it in your home folder, get that here Downloads
4. Install gpsd, lynx and elinks from urpmi (urpmi lynx) or use rpmdrake
5. Get hamlib and install it. Fetch an rpm and install it.
Fetch by: wget http://rpm.blacklion.org/10.1/RPMS/i586/hamlib-1.2.4-1.mdk10.1.BL.i586.rpm
Install by: urpmi hamlib-1.2.4-1.mdk10.1.BL.i586.rpm

The following steps use cpan, in order for that to work you need gcc and g++ (fetch using urpmi if not installed).
Perform the following as root:
6. get Digest::CRC through cpan. Enter: "cpan Digest::CRC"
7. Get openssl: "wget http://www.openssl.org/source/openssl-0.9.7d.tar.gz"
8. unpack openssl: "tar zxvf openssl-0.9.7d.tar.gz"
9. Prepare to build openssl: "cd openssl-0.9.7d"
10. Install openssl, enter as follows:
"./config"
"make"
"make test"
"make install"
11. Time to get Net::SSLeay. Cpan failed to install that on my server so I had to do it "manually". If cpan succeeds then you wont need the manual procedure. Start by entering "cpan Net::SSLeay", on my server cpan failed to find open ssl and I had to do the install manually:
cd ~/.cpan/build/Net_SSLeay.pm-1.30
./Makefile.PL
make
make install
12. Time to get some more from cpan, answer yes if cpan wants to take care of dependencies for you:
cpan IO::Socket::SSL
cpan Mail::POP3Client
cpan Net::GPSD
cpan Email::LocalDelivery
cpan Email::Folder
cpan Net::SMTP::TLS
This ends the need to use the root user, leave by entering: exit
13. Create an empty file named aprslog in your home folder: touch aprslog
14. Create the word table folder and copy necessary files there:
mkdir .cbh
cp word_table .cbh
cp cbh_code.pl .cbh
15. Proceed to configure pskmailrc.pl and the local database (if necessary)
Administer the server, see "Operating the server" below.


UBUNTU-5.10:

goto http://pskmail.wikispaces.org
click 'download'
download gMFSK_arq.0.6.tar.gz
mv ~/Desktop/gMFSK_arq.0.6.tar.gz ./
tar zxvf gMFSK_arq.0.6.tar.gz
chmod +x gmfsk
sudo cp /usr/bin/gmfsk /usr/bin/gmfsk.original
sudo cp gmfsk /usr/bin
if you start gmfsk now you get the message: libstdc++.so.5: cannot open shared object file: No such file or directory

install libstdc++5 from synaptic
sudo ldconfig

sudo mkdir /usr/local/share/pixmaps
sudo cp -r /usr/share/pixmaps/gmfsk /usr/local/share/pixmaps/gmfsk

echo "" > PSKmailserver
./gmfsk

setup the volumes of audio in and audio out to match your rig.

gmfsk is now ready for use

make sure gcc, automake, autoconf, gnu make are on your system

goto http://pskmail.wikispaces.org
click 'download'
download PSKmail_server-0.1.6.tar.gz
mv ./Desktop/PSKmail_server-0.1.6.tar.gz ./
tar zxvf PSKmail_server-0.1.6.tar.gz
./rflinkserver.pl

Can't locate Digest/CRC.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at arq.pm line 61.
BEGIN failedcompilation aborted at arq.pm line 61.
Compilation failed in require at ./rflinkserver.pl line 27.
BEGIN failed
compilation aborted at ./rflinkserver.pl line 27.
install "Digest::CRC" with cpan (sudo cpan Digest::CRC - I had to do it manually - if not succesfull read the README in ~/.cpan/sources/authors/id/O/OL/OLIMAUL$Digest-CRC-0.09.tar.gz

The SSL version of the server (from version 0.2.3) needs a perl module called
Mail::POP3Client. This in turn needs IO::Socket::SSL which is based on
NET::SSLeay, which needs a manually compiled version of openssl (binary
will not do, as Net::SSLeay needs to be compiled on the same compiler).
The procedure is not easy but doable, at least on UBUNTU dapper….

Here is the plan:
get OpenSSL-0.9.7d.tar.gz from http://www.openssl.org/
copy to home dir (~/)
cd ~/ (home dir)
untar the archive and cd into it…
sudo bash (all stuff hereafter as root…)
../config
make
make test
make install
•Version OpenSLL-0.9.8d is broken, it took me 1 day to find out. That's
why you need an older version. You MUST compile this on the serveer
machine, a binary (via synaptic or rpm) will NOT work.

cpan Net::SSLeay
cd ~/.cpan/build/Net_SSLeay.pm-1.30
../Makefile.PL
make
make install
•You may have to make a link in /usr/local/bin to the perl interpreter:
in case it cannot find the interpreter. This may be different on your
distribution:

cd /usr/local/bin
ln /usr/bin/perl perl
cd ~ (home directory)
cpan IO::Socket::SSL
cpan Mail::POP3Client
cpan Net::SMTP::TLS

echo "" > PSKmailserver

edit pskmailrc.pl to include your data
edit the user database in ./rflinkusers

install the elinks browser with synaptic

restart ./rflinkserver.pl

done


Parameter file pskmailrc.pl for the server


#! /usr/bin/perl -w

◾Parameter file for PSKmail server
$Iamserver = 1 ; # must be 1 for server

$ServerCall = "PI4TUE"; # Set your callsign!!
$relay = "your smtp server"; Address of an SMTP server (non-authenticating, you can try this out by sending yourself mail and looking at the headers who sent it)
◦SWITCH the monitor on/off
$monitor = 1; # text & status
$ShowBlock = 0; # raw blocks
##The following parameters are normally ok…
$debug = 0;
$Max_retries = 8; # Max. nr. of polls before disconnect
$Maxidle = 17; # Nr. of seconds to wait for next block
$Maxwebpage = 2000; # Max. nr. of characters per web page
$Txdelay = 0 ; # Extra wait time for TX/RX switching
$Framelength = 17; # Nr. of frames in a block
$dbfile = "$ENV{HOME}/rflinkusers/rflink_users.db"; # users database
$output = ">$ENV{HOME}/gmfsk_autofile"; # Tx output to gmfsk
$TxInputfile = "TxInputfile"; # Tx input for rflinkserver.pl
$Inputfile = "$ENV{HOME}/gMFSK.log"; # Rx input from gmfsk
#end#


==

Operating the server

Starting the system

Insert the server callsign into $ServerCall in pskmailrc.pl.
Also make sure $Iamserver = 1.

Start gmfsk
Start ./rflinkserver.pl in a terminal from your home directory.

You may need to add some missing PERL modules to your system. You can use CPAN for this.

Adding callsigns to the database

PSKmail needs a record in the database for every station that wants to use the server. A record must contain:

•Pop host address
•Pop userid
•Pop password
•Address of an SMTP server (non-authenticating, you can try this out by sending yourself mail and looking at the headers who sent it)
•your return email address (if not entered, your recipient may not be able to reply to to the address you are using)
•location of a mail file (mostly /var/mail/CALL)
•A password for mailto:posit@findu.com if the station wants to use the position update feature

Go to the rflinkusers directory and edit the user database. For an example, look in the TEMPLATE record. You will use the same SMPT server for all outgoing mail. Whenever you make a new record (new callsign) the SMTP server is taken from the TEMPLATE. So it may be a good idea to edit the template first (Callsign = TEMPLATE).

Changing records in the database

Execute the perl script 'user_db.pl which allows you to enter your callsign, etc. to the database. You can change 1 record at the time. Just enter the callsign and enter the proper command (0…9).

Using gmail smtp server

The server needs an smtp server to send outgoing email through. If you lack a dedicated email server then you may use the one provided by gmail.
To use that you will need a gmail account, as outgoing emails must be authenticated with user & password.

Beware that gmail will rewrite the "From:" field of messages and put your default email set at gmail there instead. That means that if another user at your server sends an email it will appear to originate from the sysop email address. This means that using the gmail smtp server is not so suitable for a public pskmail server. For a personal/experimental server it may be just what is needed however.

You can use another email address as the default sender, just add an address within settings at gmail and set that as default.

To use gmail smtp server you have to edit pskmailrc.pl, specifically:
$relay = "mysmtpserver"; # set this to your smtp server, use "smtp.gmail.com" for gmail
$smtptlsuser = ""; # Intended for smtp auth. Will try to use if set. Gmail needs "user\@gmail.com"
$smtptlspass = ""; # Password for smtp tls
$smtptlsport = 587; # Gmail uses non standard ports, seen 465 and 587 so far

So, set the relay to "smtp.gmail.com", smtptlsuser to your registered user account at gmail ("sm0rwo\@gmail.com" for me), smtptlspass to your password (beware of perl's handling of special characters) and smtptlsport should be fine as 587 (that is what I used when testing).

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License