Home » Linux Magazine » XF-Mail


John M. Fisk

Issue #24, April 1996

If you have a dial-up connection to the Internet, one of your easiest options for getting and receiving e-mail is popmail. But to use popmail, you need a “popmail client”. XF-Mail is a convenient, easy-to-use, and reasonably powerful popmail client that is worth a closer look.

I suspect that there are a lot of folks who are in a position similar to mine: using Unix at school or work on a minicomputer or mainframe, and running Linux on our PCs at home. If this is the case, it is quite likely that your Internet connection is via a dial-up connection, PPP, CSLIP, or SLIP. If this is the case, your options for getting mail into and out of your Linux box have almost invariably included having to set up sendmail, sendmail+IDA, or smail. Setting any of these up is not a trivial task. If you are fortunate, your choices also include popmail, in which your mail is left on a popmail server in your own mailbox, waiting for you to retrieve it at your leisure. But to retrieve it, you need a mail program installed on your Linux box which can talk to the popmail server.

XF-Mail To the Rescue.

What I’d like to do is take an in-depth look at compiling and configuring XF-Mail. Let me offer one caveat at this point: this is not meant to insult anyone’s intelligence. I’m writing this primarily for the benefit of those DOS-converts, like myself, who may initially view the notion of compiling programs as a task for wizards. It’s not that bad. Honest! However, until you get the hang of this, getting Linux programs working may well be a formidable task. If you’re pretty adept at compiling programs, you may want to skip to the next section, on configuration, although even that is admittedly pretty straightforward.

Just a word for those of you who are left. If you are an absolute Linux newbie and the thought of compiling anything sorta gives you the heebie-jeebies, stick with me. This will be fun. Really!

The philosophy behind Linux, and much of Unix, is vastly different from that of DOS. While you can often find pre-compiled binaries that work simply by dropping them into a directory in your path, there are MANY instances in which this is simply not the case. You’ll get an archive with the .tar.gz suffix and un-archive it, only to discover that it’s all source code and needs to be compiled. Eventually, you’ll want to be able to do this. It’s often not as hard as it first seems, although admittedly, not everything compiles cleanly “out of the box”.

I’m going to take you through each step needed to compile XF-Mail. I think this is extremely important, for a couple reasons:

  • This will be good practice in compiling and setting up a couple programs that are quite well behaved and need little modification to get working.
  • If you’re using Linux on a home PC and have a dial-up connection, you really need to have an easy-to-use e-mail client. You need to be connected. Seriously. You’re quite handicapped and cut off if you don’t.
  • If you’ve never compiled anything under Linux, this is your golden opportunity to do so and feel pretty good about yourself!

Let’s begin. You’ll need to have a few things set up in order to do this:

  • You need to have X-Windows up and running.
  • You need to have installed the development applications—for those of you using Slackware, that’s the stuff in the D disk sets. Other distributions will use different designations. You should have the GCC (GNU C Compiler) installed, as well as the include files and so forth.
  • You need to ftp some files.
  • You need to be able to use at least one of the Linux text editors such as vi, Emacs, xedit (if you’re running X-Windows), pico, joe, jed, or one of the many others.

You need to get the following files (use a web browser):

  • xfmail-0.3.tar.gz (Burka.NetVision.net.il/xfmail/xfmail.html)
  • bxform-075.tgz (http://bragg.phys.uwm.edu/xforms/)
  • libXpm-3.4f.tar.gz (ftp://ftp.cc.gatech.edu/pub/linux/libs/)

The first two links—those for xfmail-0.3.tar.gz and bxform-075.tgz—will take you to the home pages of these impressive programs. Read the info and follow the directions for getting the Linux version of these programs. The last link—for the libXpm stuff—will drop you off at one of the sunsite mirrors (that’s GA Tech, if you’re curious about this). Because versions of programs can change fairly quickly, I’ll leave it up to you to get the most recent version. I’m currently using the libXpm-3.4f.tar.gz sources. Note that you may already have libXpm installed, in which case you don’t need to install it again.

$ ls -l /usr/X11R6/lib/libXpm.so*

will tell you whether you have the library available.

In case you are curious, those files you got contain:


The source code for the XF-Mail client version 0.3.


The binaries for the XForm toolkit libraries.


The source code and precompiled libraries for the libXpm libraries.

XF-Mail needs those last two libraries in order to be compiled. As an additional benefit, there are lots of programs that require the libXpm libraries, and a growing number of programs use the XForm libraries. Having set these up once, you’ll be all set when it comes time to compile other programs that require them.

Since I’m using Slackware 2.2.0 at the moment, my descriptions of where things will go may be just a bit different from yours, if you are using a different distribution. Not to fret… I’ll try to be as broad as I can in terms of describing how to proceed.

Let’s begin by setting up the libXpm libraries. If you already have them, skip this section. If you use one of the new ELF-based distributions, you probably already have them, but if you don’t, you will have to get ELF versions instead of the a.out ones documented here. The procedure is the same.

Since the libXpm-3.4f.tar.gz archive contains precompiled libraries and the necessary header files, let’s use these. On my system, I have created a /usr/local/src directory in which I store and compile all new programs. You don’t have to do this yourself, but it does help keep things organized. Now, let me quickly take you through the steps to set this stuff up:

$ mv libXpm-3.4f.tar.gz /usr/local/src/
$ cd /usr/local/src
$ tar -xvzf libXpm-3.4f.tar.gz
$ cd xpm-3.4f/
$ ls -l

look for libXpm.a, libXpm.sa, and libXpm.so.4.6. Now become root, and install the files:

$ su (type your root password)
# cp libXpm.* /usr/X11R6/lib/
# cp lib/xpm*.h /usr/X11R6/include/X11/
# ldconfig
# exit
bni:Congrats! The libXpm libraries should now be installed.
Make sure you go back to being a normal user again by pressing
Ctrl-D. No point is doing something dumb as root and making
a mess of things, right?

Next, let’s deal with bxform-075.tgz. This archive contains the binaries (actually, the static libraries) for the XForm libs. It’s almost as easy to set up as the libXpm libs, except you’ll need to do a little bit of editing to put things where they belong. Note that if you have an ELF-based distribution, you will need to get the ELF version of the library, rather than the a.out version.

We’ll start the same way we did the last time:

$ mv bxform-075.tgz /usr/local/src
$ cd /usr/local/src
$ tar -xvzf bxform-075.tgz
$ cd xforms/
$ ls -l

One of the files you will notice is a README file. It’s always a good idea to read through the README files for anything, and this is no exception. It’ll inform you that the file you need to edit in order to make any modifications is the mkconfig.h file. It’s another good idea to always make a backup copy of any file you modify before you modify it. If things get screwed up, you should have a “clean” copy to fall back on. I’ve called my backup copy mkconfig.h.dist since it came with the distribution. cp mkconfig.h mkconfig.h.dist does the trick.

There are two modifications you may want to make. When you load up the file, you should see lines a bit down the page that look like this:


You might want to consider installing the libforms.a library into the /usr/X11R6/lib directory, and the header file, form.h into the /usr/X11R6/include/Xf directory, because that is where XF-Mail will be looking for these files. If you do this now, it’ll be a bit easier during the next step. So, change the LIB_DIR= and the HEADER_DIR= lines to read:


This should put everything where it belongs.

Now, all that remains to finish the installation, after you’ve saved the modifications, is to become root again, and type in make install.

You are now ready to compile XF-Mail. At this point you merely un-archive the file, copy a file, optionally edit the Makefile (which orchestrates the process of compiling), and compile the program.

$ mv xfmail-0.3.tar.gz /usr/local/src
$ cd /usr/local/src
$ tar -xvzf xfmail-0.3.tar.gz
$ cd xfmail/ui
$ cp Makefile.Linux Makefile
At this point, there's really nothing much left to do but
compile the program. I'll add here that you can optionally
change the directories in which the program and the manual
pages are installed. Why? Well, there are a couple of schools
of thought regarding the installation of new programs. The one
that I ascribe to suggests putting all user-added programs into
the /usr/local directory.
You don't need to do this following step, but to change
the default location of the program installation from
/usr/X11R6 to /usr/local, let's take a look at the Makefile.
When you edit the Makefile you've just created, you'll see a section
near the top that looks like:
BINDIR = /usr/X11R6/bin
MANDIR = /usr/X11R6/man/man1

You’ll notice that the section delimited by the # change the following… statement at the top and the # end of user configurable settings statement at the bottom is the only section of the file that you should edit. Also notice the lines that define the XForm include directory (XFINC) and the line for the XForm library directory (XFLIB). Now you’ll see why we edited the Makefile above for XForms: /usr/X11R6/include/Xf is where XF-Mail will look for the form.h header file, and /usr/X11R6/lib is where it will look for the libforms.a file.

To install the xfmail program into your /usr/local/bin directory, and the manual pages into the /usr/local/man/man1 directory, simply edit the BINDIR and the MANDIR entries:

BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1

At this point, all that’s left to do is compile and install the program. Simply enter:

$ make
$ su
# make install
# exit

The first step will take a while, especially if you don’t have very much memory, but if the compilation has gone well you should see no error messages. After the make install step, the program will be completely installed.

The hardest part is done.

If you have troubles of any sort compiling XF-Mail, you can take the easy way out. The author has Linux binaries available for ftp at burka.netvision.net.il in /pub/xfmail/.

Configuring XF-Mail

XF-Mail was written by a couple of guys named Gennady B. Sorokopud and Ugen J. S. Antsilevich. In their own word:s

XF-Mail is an X-Windows application for receiving electronic mail. It was created using XForms library toolkit by T.C. Zhao and Mark Overmars.

It’s partially compatible with MH style mailboxes but it does not require any mh tools to be installed on the system. You can read most of your MH folders and messages with XF-Mail.

XF-Mail has very friendly user interface and it’s extremely easy in use. It implements most of the mail functionality in one program and it does not require any additional tools.

Guess that pretty much sums it up! It really does have a very friendly user interface and is quite easy to use. Additionally, while it can be set up to use sendmail, it can happily live without it.

One of the greatest things about XF-Mail is that all the user-configurable options are easily set using the GUI configuration menu. This is a huge plus, as the options in the Configuration Menu give you a great deal of power over how the program functions and appears.

To configure XF-Mail, you simply need to start it up. Fire up X, and in one of the xterms enter:

$ xfmail &

This will fire up the program. Now, depending on your hardware and software set up, this may take a few seconds.

Parenthetically, it’s not a bad idea to use an xterm to start any program up that you’ve just installed. For example, you could install a program and simply add it to a button bar or menu and call it from there. The problem with this is that error messages are printed if the program can’t run. If you try to start a program up from a menu or button bar, you won’t necessarily see these messages and will then be left wondering why your program won’t start. If you test drive your newly installed programs using the command line in an xterm, you should see what’s happening.

There are, fortunately, only a couple things you’ll need to know in order to get XF-Mail up and running. These are:

  • The DNS name or the IP address of the Mail Host from which you’ll get your mail
  • The port number or service of your Mail Host—e.g., pop3 if your Mail Host uses POP3 protocol
  • Your username
  • Your password
  • The DNS or IP address of your SMTP gateway or host

That’s pretty much it, as far as essential information goes. The Mail Host information is simply the host from which you get your mail. The SMTP gateway is simply the host to which you’ll send your mail. These are usually the same host. For example, I get my mail from the Mail Host ctrvax.vanderbilt.edu (at Vanderbilt University). The mail server there uses POP3 protocol and I use the same address for outgoing mail using SMTP.

If you have any questions about this information, do yourself a huge favor and ask or call the folks who are responsible for your mail service. If you’re at a university or large organization, there’s often a help desk that can provide you with all the information you’ll need. If you have mail service through a local ISP, they should be able to help you as well. Essentially, you’ll just need the address (either the name or the numeric IP address) of the Mail Host and the SMTP gateway. Since the mail server at Vanderbilt uses the POP3 (Post Office Protocol) protocol, I use that for the “port number”.

To start configuration, go to the menu bar and select the Misc menu and choose Config. You will be presented with a Configuration Dialog box that lets you set a variety of things. Let’s first get the essentials out of the way.

To get mail into and out of your box through the mail host and your SMTP gateway, you’ll need to enter this information. From the Configuration menu, choose POP which presents you with the POP Configuration menu box. Here, enter the mail host (your POP server from which you’ll get your mail) in the box entitled Host. To the right of this, in the space labelled Port, enter the port number or service. If your mail host uses the POP3 protocol, simply leave this as pop3. If it’s something else, you should check with the postmaster at your mail service and make sure you know which service/port they use.

Below this, enter your username and your password. Also, check the option buttons if you wish to leave your mail on the mail server and if you want XF-Mail to store your password in the configuration file so that you won’t be prompted for it each time you attempt to get mail.

A Couple Caveats:

This, and the section on setting up the SMTP gateway information, are the most critical aspects of configuring your mail client. If you enter an incorrect address for the mail host or the port number, you won’t be able to get mail. Second, keep in mind that storing your password, while very convenient, is also very insecure, since the password is stored in your ~/.xfmailrc file un-encrypted. If you’re the only one using your system, this is not a real problem, but if others have access to your system, be aware that your password is quite vulnerable. Finally, as a precaution, at least at first you probably should not delete your mail from the pop server. That way, if anything goes wrong, you’ll at least have a copy of your mail on the mail server and should be able to retrieve it again later. If something goes wrong and your mail has been deleted from the server, it’s gone.

Did I scare you? I hope not; just be prudent and use your common sense. Keep in mind that this program is still in beta testing, and while it has undergone a lot of testing and debugging so far, it is likely to have a few “undocumented features” left. Play it safe.

Lastly, let’s set up the outgoing mail. Press the Done button after you’ve entered all the info for the POP Configuration, and then presss the Send button, which will allow you to set up the SMTP information. In the first box, entitled “SMTP Host”, enter the name or IP address of your SMTP gateway and then the SMTP port number in the box to the right of this. The default for the port is smtp, which is an Internet standard.

If you have installed the sendmail program, you can also fill in its location, but it’s not necessary.

To have XF-Mail use the built-in SMTP support, click on the use SMTP button. A couple other suggestions and we’re almost done. First, I recommend that you also check the “Save to sent mail” and the “Offline send” options. The first will save a copy of all your outgoing mail. Why would you want to do that? Good question.

Mail on the Internet can get lost. Machines crash, hard drives fail, mail delivery programs have bugs. If you save copies of outgoing mail, you can re-send mail if you find it never made it to its destination.

Setting the Offline send option allows you to compose mail and set it up to be sent out, even when you’re not connected!

We’re almost done. (Have I said that before?) Press the Done button and when you’re back at the Configuration dialog box, press the Save button.

Now, there’s just one more thing that you probably should do. Press the Misc button in the Configuration dialog box. This presents you with a list of various options. At the bottom, click on the Open log on startup option. This will log all messages to a “Log Window” which will allow you to see what’s happening. Keep an eye on this, especially the first couple times you try to retrieve mail from the server and send mail to the SMTP gateway. Now, to save your changes, press Save once again and you’re done.

You’ll need to get your SLIP, CSLIP, or PPP connection up and running first. Once it’s up, fire up XF-Mail and then go to the Misc menu and choose Retrieve mail. Keep an eye on the action that’s going on in the Log Window. This should let you know if everything’s set up correctly and XF-Mail was able to make connection with your mail host.

No mail? No problem. Send yourself some!

Up at the top of the screen, click on the pen icon on the toolbar. The astute user will notice that moving the cursor onto the icon causes a short description to be printed along the status line at the bottom of the window. Very handy. Now, click on that and you’ll be presented with an edit window. Now, it’s just a matter of filling in the blanks. At the top of the window you can enter the information for the From:, Subject:, and To: fields.

Now, type in a short test message and when you’re done, press the letter icon on the top left. If you get an error message about needing to specify at least one recipient, don’t forget to press the RETURN key after you’ve filled in the name of the recipient. If this was done correctly, you’ll see the entry move to the box below. You could also use your shiny new Address Book. Press the Address button and the address book fires up. Enter the name on the entry line and press the Save button. Click on the To button and press RETURN. Done.

Almost. Remember that we’ve set up offline send. To get the message out, you’ll need to choose the Send menu item, and then click on the Send all item. If you have an external modem, you should see the lights lighting up and the log window should let you know the progress of things. If all went well, you should now have new mail! Go back and retrieve it to see if things are working okay.

Now, let’s do just a couple other things before finishing up here. First, there are several things that you’ll want to set up. You don’t have to, but it’ll make using XF-Mail a lot easier and more fun.

The things you’ll probably want to do at this point are:

  • Set up an external editor
  • Set up an external message viewer
  • Configure the From: field for outgoing messages
  • Decide whether you want to additionally retrieve mail from a local mail spool
  • Edit your .signature file if you haven’t already

You’ll want to set up an external editor and viewer because the built-in editor and viewer are quite limited and can handle messages only 30 lines or fewer long. That’s not much. However, you can set up any X editor as your viewer/editor. Keep in mind, however, that you probably don’t want to use something rather huge, like Xemacs. Granted, this is a great editor, but you’ll be able to do three week’s worth of wash and iron all your socks before it’ll finish loading. I initially used xedit, which is admittedly a bit Spartan, but at least it loaded up fast. I’m currently using aXe, which loads up quite nicely but is a lot more functional.

So, to set these things up, call the Configuration menu up once again:

  • Use the View menu to set up the external viewer. Just enter the command necessary to fire up your editor/viewer—just as you would in an xterm. For example, I’m using the xedit program as my external viewer still. I simply enter /usr/X11R6/bin/xedit in the box and then set the number of lines to whatever I want, such as 75.
  • Use the Edit menu to set up the external editor. Once again, enter the command line necessary to load up your chosen editor. For example, to use the aXe editor, I’ve entered:
/usr/local/bin/axe -noserver -geometry 74x40+55+0
  • Use the Misc menu to set up the From: field. (You’ll need to do this in order to correctly set this for outgoing mail.) Remember that most folks who want to write you back simply press the reply button and so your From: field is important in order to get the correct address. Enter your e-mail address on the From: field line.
  • Use the Receive menu to optionally retrieve mail from a local spool. Enter the directory where your mail spool exists. For example, since I spend most of my time as root, my mail spool directory is /var/spool/mail/root. I have this set up for both spool and POP retrieval because I often use the program popclient to retrieve my mail when I’m not running X or when I’m using a background shell program to periodically check my mail. I have popclient set up to deposit mail into my local mail spool directory and so XF-Mail will dutifully pick it up from there as well as from the POP server.

After making these changes, don’t forget to press the Save button to save them.

To edit your .signature file, select the Misc menu once again and click on the Signature item. There’s an easy-to-use signature editor that pops up and lets you create your .signature file and save it. I found that you cannot use the entire window for your .signature file. If you do, you’ll get an error message about the signature being too large. You’ll have to keep it to about 8 to 10 lines. Play with it and see for yourself. Internet etiquette has suggested a maximum of 4 lines for a long time, so you may wish to limit yourself to 4 to make the rest of the world happy.

Keep in mind that there are lots of nifty configuration options and features left to play with. Let me recommend to you that you skim through the online help system. Just choose Help from the menu bar and choose the Contents item. It will display a help window with all kinds of useful information describing what you can do with this great program. It’s time to explore!

Want more? It’s easy to join the XF-Mail mailing list: simply choose the Help menu item and click on the Subscribe to mailing list option. If you like this client, go ahead and drop the authors a note of thanks! Their addresses are Gennady B. Sorokopud gena@NetVision.net.il and Ugen J. S. Antsilevich ugen@NetVision.net.il.

John Fisk (XXXXXXXXXXXXXX) After three years as a General Surgery resident and Research Fellow at the Vanderbilt University Medical Center, John decided to “hang up the stethoscope” and pursue a career in Medical Information Management. He’s currently a full-time student at the Middle Tennessee State University and hopes to complete a graduate degree in Computer Science before entering a Medical Informatics Fellowship. In his dwindling free time, he and his wife Faith enjoy hiking and camping in Tennessee’s beautiful Great Smoky Mountains. An avid Linux fan since his first Slackware 2.0.0 installation a year and a half ago.