Content-type: text/html
email [options] recipient1,recipient2,recipient3,...
Email is a command line email client similiar to 'mailx'. Added features make this a more advanced client for sending email via the command line. Email works with sendmail, just as 'mailx' does, but email also allows sending to remote smtp servers for your email delivery. It also works with GPG for encrypting and signing the emails on the fly.
Email also incorporates a few other features as well. These features include signature files with wildcard options to specify the data, time, day, version, system, and even a 'fortune' with the help of the 'fortune' command. Email also supports a very configurable address book. This way you can specify a persons name with an email address and also place a group of names into one group for sending.
Email also support attachments. It will accept N attachments via a command line option and encode them with Base64 before sending them with the email.
Email works with a configuration file named email.conf which is found in ${prefix}/etc/email/email.conf although can be changed by specifying the --sysconfdir option during the ./configure. If you do not have or want a configuration file, you can specify the -r option to specify your smtp server and this will allow you to bypass using a configuration file and use default values. If you specify the -r option (listed below) and you do have a configuration file, it will still use the configuration file but override the SMTP_SERVER variable with what is used at the command line.
Modules are determined by command line switches. For instance: if you want to know about the 'encrypt' command line option, you would specify --help 'encrypt' or --help 'e' and help will display the correct module help section.
The Help is not statically programmed into email. Instead it is a file in email's home directory called be rewritten with every release of email.
An example of a header string would look like: --header "X-My-Header: Stuff goes here"
SMTP_SERVER : Server name, or IP
SMTP_PORT : Servers port number
SENDMAIL_BIN : Specify the sendmail binary path and options
MY_NAME : Specify your Name
MY_EMAIL : Specify your email address
REPLY_TO : Seperate reply to address
SIGNATURE_FILE : Your signature file
SIGNATURE_DIVIDE : A design for a divider
ADDRESS_BOOK : Location of your address book file
SAVE_SENT_MAIL : Directory to save email.sent file
GPG_BIN : Full path to gpg binary
GPG_PASS : Optional passphrase for gpg
TEMP_DIR : Specify where to store temp files
SMTP_AUTH : Specify what type of authentication
for your smtp server.
SMTP_AUTH_USER : Specify a username login for SMTP AUTH
SMTP_AUTH_PASS : Specify a password for SMTP AUTH
You can choose to use sendmail instead of a remote smtp server. All you have to do is input the path of where you have sendmail located in the SENDMAIL_BIN variable. You may also provide options to pass sendmail. The best values for this would be /usr/lib/sendmail -t -i. If you have both SENDMAIL_BIN and SMTP_SERVER uncommented and both have values, then SMTP_SERVER will take presedence over SENDMAIL_BIN and 'email' will try to contact the SMTP server provided.
You can create your own email.conf file in your home directory. It must be a hidden file. For instance: ~/.email.conf
Email will look in your home directory before it looks for a global configuration file. The easiest thing to do is simply copy your global config file to your home directory as .email.conf and edit it as needed.
If you do not have a global config file or a personal config file, email will choose defaults according to your current login on the system. So a configuration file is not manditory, it just helps you customize email.
You can look at the basic configuration file for more information on the configuration of 'email'.
Email now support SMTP AUTH. I will briefly describe how it works here.
To use email with an SMTP server that expects authentication you must set a few options in your email.conf file. These options are: SMTP_AUTH, SMTP_AUTH_USER, SMTP_AUTH_PASS.
SMTP_AUTH:
This option must be set to one of the two: LOGIN or
PLAIN. LOGIN and PLAIN are standard RFC compliant SMTP AUTH
protocols. If you are unsure which options to choose,
ask your ISP or SMTP Administrator if any of these are
supported. Usually it's a safe bet to use LOGIN for
SMTP AUTH. Most AUTH servers support LOGIN.
SMTP_AUTH_USER:
If you're using SMTP AUTH, please specify your username
here. This option is
MANDITORY
if you're using SMTP AUTH.
SMTP_AUTH_PASS:
You can choose to set this option or not. However, if
you don't set this option, email will prompt you for your
password before proceeding. So if you're using email from
a cron job and don't expect any interaction with email,
please set this option!
Two environment variables can be set that email will check.
EDITOR will allow you to specify your favorite editor to use with email for constructing messages. If this variable is not set, it will default to vi.
TMPDIR can be set to specify a temporary directory to place your temp files while email is working. This is analogous to the TEMP_DIR variable in email.conf. environment variable TMPDIR for a temporary directory. If neither contains a value, email defaults to /tmp.
The address book for email takes on the format as described below. It will check for any syntax errors in the address book and completely stop email if it finds any, so try to keep the same gramatical syntax. A single entry in the address book will look like:
single: Tim = tim@somedomain.org #Comments allowed
You are welcome to use a whole name with spaces as long as you use a single quote closing the name with another single quote. You may also use double quotes in place of the single quotes. Example:
single: 'Tim Gahan' = tim@somedomain.org
Groups are allowed and can only consist of comma delimited single entries from the file and may contain spaces. You can *not* recursively specify groups. You may, however specify single email addresses that are not part of the address book.
If you would like to break one line into two lines, you should use the '\' as a newline escape mark. Examples:
group: Mygroup = 'Tim Gahan', John, Sam, Bob, \
tookie@somedomain.org
This example will specify a group with the single entries
of 'Dean Jones', John, Sam, Bob, and the unadded email
address of 'software@somedomain.org'.
The signature file is specified in the configuration file. You will also have the option to specify a signature divider. This is by default '---'. This just divides the signature file from the rest of the email.
There are a few wild cards that you can specify in writing your signature file that will allow your signature file to obtain dynamic options when sending your email.
This email was sent with 'email %v'
Sent on host: %h
At the time : %c
Your fortune for today is:
%f
This will end up replacing the %v, %h, %c, and %f with their corresponding equivalents above respectively.
They're those little things that make you cringe when you find them in your bed ( or program ) at 3 am.
If you find any in this program, please submit them to software@cleancode.org
Dean Jones - dj@cleancode.org
(C) 2001 - 2004
email(1)