12 – User Clients
December 5, 2009 – 10:16 pmPlease note… This information no longer exists at the referenced locations. This is only a copy of what was available in 2003.
Basic Linux Training™
User Clients
Henry White
Table of Contents
Each of the distributions will default to their idea of the most practical applications to install. Since most Windows users will automatically gravitate to GUI and either KDE or Gnome, which will be covered later, I’m going to give examples primarily for the commandline applications I use and recommend. For the most part, Linux has matured to the point that the default configuration is entirely workable for most users, regardless of whether you’re talking about GUI or commandline. The key point to emphasize is that virtually everything can be customized to suit your needs or personal preferences – and painlessly using a plain text editor and human readable configuration file, whether you do this manually or ‘automagically’ through that distributions system administration tools and utilities.
With mail you have mail transport agents that handle the details between you and the rest of the Internet, and mail user agents that display the messages on your screen. The most common MTAs are sendmail, qmail, exim, postfix and smail. (Only one of these can run at a time, so usually it is best to go with whichever one was installed and configured for you. If you do decide to change, the configuration will follow – although there are no guarantees that the transfer will be flawless.) The most common MUAs are elm, pine and more recently mutt. (You have have as many MUAs installed as you like; generally they work well together – although you may have to tweak the configuration a little.)
IMNSHO, the best combination is mutt/fetchmail/exim for home users. If you are running a mailing list or LAN you might need to use postfix; sendmail and qmail are really for the Big Boys like our mailing list server which handles tens of thousands of mailing lists with perhaps a few dozen to a few thousands subscribers – in other words, literally millions of messages and billions of bytes in a normal 24-hour period
Most of you don’t need that, and you don’t need the complexity that goes with it in setting up the configuration.
fetchmail is simplicity itself:
/home/joe6pack/.fetchmailrc poll "mail.yourisp.net" protocol pop3 username "joe6pack" password "sudsguzzler" mda "/usr/bin/procmail -d %s"
The most common error in setting up the MTA is selecting something other than smarthost to handle SMTP for you. The address that appears on your messages should be yourisp.net – not mail.yourisp.net; this is your qualified domain; local domain will include that and localhost for local mail delivery (usually procmail which also acts as a terrific filter to cut down on spam and messages from known twits you’d rather not read – known as a twit filter or killfile).
The most interesting part, I think, is how you want your messages presented. Personally, I rarely has any need to check the headers, so I added a few lines to standardize on what shows up in mutt and how it is presented, as well as a modest amount of shameless promotion:
/etc/Muttrc # systemwide since I'm the only user; this would be
# overriden by /home/joe6pack/.muttrc
## User Defined Headers
##
#my_hdr X-Forecast: 'Total World Domination'
my_hdr X-Course: http://www.basiclinux.net
my_hdr X-Organization: http://counter.li.org
my_hdr X-Operating-System: Debian GNU/Linux kernel: `name -r`
## Header fields I don't normally want to see
##
ignore * # this means "ignore all lines by default"
unignore from: subject to cc mail-followup-to \
date x-mailer x-url # this shows how nicely wrap long lines
## Specify the order of the headers to appear when displaying a message
## hdr_order <hdr1> [ <hdr2> ... ]
##
unhdr_order * # forget the previous settings
hdr_order date from subject to cc
Note: those are back-ticks surrounding uname -r; it will not with apostrophes – the back-tick is above the TAB key along with the tilde sign which is a built-in short-cut for your home directory.
Colorizing this is done in the same file:
## colors ## color indicator black cyan color status brightgreen blue color hdrdefault cyan black color header green black ^From: color header cyan black ^To: color header cyan black ^Reply-To: color header cyan black ^Cc: color header brightblue black ^Subject: color body brightred black [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ color body brightblue black (http|ftp)://[\-\.\,/%~_:?\#a-zA-Z0-9]+ color quoted green black color attachment yellow black color signature cyan black color tree red black color tilde brightblue black color markers brightred black
Obviously, if the default configuration doesn’t cut it for you, you’ll have some idea where and how to change it. Many of the most frequently customized configuration files have extensive internal documentation, otherwise there are examples in /usr/share/doc/package-name, and many of them have their own web page and mailing list. There is really no excuse for “putting up” with the default if it get in your way
On the GUI side there are a couple of popular mail programs worth noting – Kmail (KDE), and balsa (Gnome). Similarly, there are several popular browsers – Netscape, of course, and the Mozilla Open Source project, and konqurer. We’ll cover these in a later lesson.
Web Browser
There are three excellent commandline browsers: lynx, links and w3m. My preference is lynx with is always called by default – if I want to use one of the others I simply have to type in the name and URL at the prompt.
Again, colorizing lynx helps enormously, I think, and should be done system wide in /etc/lynx.cfg for all users. (The default ‘reverse’ colors are commented out, and only the prefix ‘bright’ added to the original since these colors were hard to read on my monitor – or more precisely with my very old eyes.)
#COLOR:0:black:white #COLOR:1:blue:white #COLOR:2:yellow:blue #COLOR:3:green:white #COLOR:4:magenta:white #COLOR:5:blue:white #COLOR:6:red:white #COLOR:7:magenta:cyan COLOR:0:lightgray:black COLOR:1:brightblue:black COLOR:2:yellow:blue COLOR:3:green:black COLOR:4:cyan:black COLOR:5:brightblue:black COLOR:6:brightred:black COLOR:7:magenta:cyan
The startfile I specify is my own localindex.html which is simply a bookmark file to the most commonly needed URLs on the Internet as well as local versions and other files and directories on my hard drive.
Shell
Since I have several distributions installed and have been tracking the development of stable and unstable versions of Debian, I use the distribution or release name as the hostname rather than try to remember cutesy names
That’s in the prompt so I always know where I am, and ls is colorized to make things easier to separate at a glance.
/etc/profile:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11"
if [ "$BASH" ]; then
PS1='\u:\w\$ '
else
if [ " d -u" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
export PATH PS1
umask 022
(Remember, also, that I have ‘liberated’ /etc/profile.d from Linux-Mandrake
Probably the most interesting parts are in color_ls.sh
eval Dircolors --sh /etc/DIR_COLORS
if [ $TERM = "emacs" ];then
alias ls='ls -N -F'
else
alias ls="ls --color=auto -F"
fi
and in alias.sh
alias l='ls' # classique listing.
alias ll='ls -l' # List detailed.
alias la='ls -A -k' # List all.
alias lsd='ls -d */' # List only the directory.
alias md='mkdir'
alias rd='rmdir'
alias cd..='cd ..'
if [ -n "$CLASS" -a "$CLASS" = "newbie" ];then
# Size of a directory (by default Human Readable).
alias du='du -h'
# Size of a disk (by default Human Readable).
# and don't probe supermount
alias df='df -h -x supermount'
fi
both of which could be included elsewhere.
A couple of other neat tricks are in mc.sh
mc ()
{
mkdir -p ~/.mc/tmp 2> /dev/null
chmod 700 ~/.mc/tmp
MC=~/.mc/tmp/mc-$$
/usr/bin/mc -P "$@" > "$MC"
cd "at $MC"
rm -f "$MC"
unset MC;
}
and clearing the screen after a user logs out (which I have in ~/.bash_logout
case "Tty" in
/dev/tty[0-9]) clear
esac
Assignments
Experiment!
There are only a couple of things you need to keep in mind: first, changes to configuration do NOT require a reboot although you will have to exit the current shell, for example, for the prompt to change; and second, pass along your favorite tips and tricks to the mailing list
There is almost no way you can do any damage to the installation – if something doesn’t work the way you expected, look for a typo in the configuration file.
Copyright © 1997-2003 Henry White. All Rights Reserved.
Reproduction or redistribution without prior written consent is strictly prohibited. Address comments and inquiries to info@basiclinux.net
Sorry, comments for this entry are closed at this time.