Now that we have mutt talking to the outside world, it would be handy if we could also send messages from the command line as we did in Part 8 using the mail command. Fortunately, mutt supports the same technique.
Using mutt On The Command Line
We can send the output of a command to a remote email recipient via our POP3 configuration using a command such as this:
me@linuxbox:~$ ls -l | mutt-p -s "test message" someone@somewhere.com
Here we used the alias "mutt-p" described in the previous installment. Please note that if such an alias were used in a shell script, it would most likely fail because the .bashrc file where the alias is defined is not sourced by the copy of the shell executing the script. In such a case, we would need to spell the command out fully:
mutt -F ~/.muttrc-pop3 -s "test message" someone@somewhere.com
Another Mail Client
While Debian installs mutt by default, it's not the only full-featured text-based email client available. Another popular choice is Alpine, the successor to the popular PINE email client from the University of Washington. Alpine is similar to mutt in most respects though I think it has an easier user interface:
In addition to the usual email functions, Alpine also sports its own address book and Alpine's configuration is adjustable from within the user interface so that editing the configuration files is not strictly necessary, but its configuration is as complicated as mutt's.
Alpine configuration, top-level
Alpine configuration, down deep
Summing Up
Text-based email clients have a long and storied history in the Unix world and remain the tools of choice for serious email users. As you dig deeper into the documentation of mutt and Alpine, you will find that nothing compares to the configurability of either of these programs.
Further Reading
More support resources for mutt:
- http://mutt.blackfish.org.uk/
- http://therandymon.com/woodnotes/mutt/using-mutt.html
- http://hacktux.com/mutt/addressbook
- http://mark.stosberg.com/Tech/mutt.html
- http://www.washington.edu/alpine/
- http://www.washington.edu/alpine/tech-notes/config.html
- http://www.ii.com/internet/messaging/pine/
No comments:
Post a Comment