A month on the command line, Day 6: E-mail woes
You'd think that e-mail and command-line Linux would be like chocolate-chip cookies and milk.
Not so. Getting e-mail from a server and into this Linux box has proven to be more than a little frustrating. Clearly I need a comprehensive reference to get this right.
I don't want to set up my own e-mail server, although at this point I'm thinking that just might be easier than the path I've been down thus far.
After extensive Googling, I decided to use Mutt as my Internet mail client, and after more extensive Googling, I figured out how to set up a rudimentary .muttrc file to get mail into this computer. So far, so good.
I wanted to use IMAP as my protocol (the account I'm using supports both IMAP and POP), and I eventually found out that Mutt will NOT send IMAP mail on its own. I don't exactly know the terminology (MTA ... MUT ...), but I decided, after more Googling, to use esmtp. I haven't gotten that to work yet. In fact, I'm not sure of the path to esmtp, which I need to put in my .muttrc file to make the whole thing work. That's how much I need to learn about Linux in general and Debian in specific.
Bottom line, I need to find a reference that really walks me through configuring multiple POP and IMAP e-mail accounts on a command-line Linux box. Any suggestions?
Comments
the easiest way to send email is to setup exim to use a smarthost and then point that to your isp's smtp server then you can just use the mail command and just point mutt to use local host which it may all ready be doing if if you setup a mail server on the install. a good way to config this from the command line is to use dpkg-reconfigure exim4 as root
also to find a path of a command just use the whereis then the command your looking for like whereis esmtp
Posted by: zerodni | May 9, 2007 12:23 AM
Try MUTT
Posted by: JBaribeault | May 9, 2007 10:20 AM
Thanks for the whereis command info -- I need "Linux in a Nutshell" opened up on my desk when I do this stuff.
Posted by: Steven Rosenberg | May 9, 2007 10:38 AM
I think it would be worth your time to look at using Pine as your email client. I'd advise against setting up a mail server, fetchmail and other utilities just to run an IMAP client. Pine is simple to setup and use. Mutt is great, but not simple.
Posted by: Root | May 10, 2007 12:13 PM
I just went through the thrilling ordeal of setting up mutt myself. "Ordeal" because it was - it took me a couple of days - but "thrilling" because I now know a whole lot more about mail handling than I used to.
Initially, I intended to use the IMAP options within mutt, but I ended up using the longer chain through getmail (to fetch mail from the server with a cron-job); and procmail for the filtering to the spool directory (which I set to be my regular inbox).
Apart from that, my setup includes mairix for searching in all mailboxes, urlview for extracting urls, vim for composing mail, muttprint for - uh - printing (in full LaTeX glory - wonderful!), and abook for the address book; further: antiword and pdftotext for viewing attachments inline (great!).
It was a hassle, but I now have a system which (a) I can configure precisely to my liking, and (b) I understand each single element of.
I use the maildir format, and I've set up kmail to use the same folders, so that I can view the same mails there, should I need some of the functionality of a GUI.
I'd be happy to send you my config files if you want to. It was a hassle to set it up, but once it's in place, I can't imagine using another email reader. I can really recommend mutt.
Posted by: Eyolf | May 10, 2007 3:50 PM
I've spent days trying to get mutt/esmtp and pine to do IMAP mail from both Fastmail.fm and DSL Extreme. I've been able to receive mail, no problem, but the whole thing falls apart when I try to SEND mail. I just can't seem to get the SMTP servers to do my bidding.
I've tried the few configuration file hints I've seen on the Web, but I've just hit a wall. Maybe POP mail will be better, but I was really hoping to do IMAP.
Even though this is "A Month on the Command Line," I booted into Xubuntu today to see how easy it was to use Thunderbird. Pretty easy -- I got both IMAP accounts to work (and with different SMTP servers for each).
Getting back to the command line, I've seen some VERY detailed config files for mutt and pine, and I wonder where in the hell people come up with this stuff.
And regarding Thunderbird, it's pretty much like Netscape Communicator's e-mail/news reader. It drove me to install the Pan newsreader (I don't read all that much USENET news, but I figured I'd try it), and that was much better -- and snappier.
But going from mutt to Thunderbird, from Elinks to Firefox, I really miss the speed of the command line, so I will live to fight another day at the console ...
Regarding pine, with copious instructions, I put together my own .deb package and installed it ... and when I couldn't get outgoing mail to work, I hastily removed and deleted the whole thing. ... That's what impatience will get you.
Again, I love the speed of the command line -- it's great for e-mail, where you can really zip right through it.
Right now I just have to regroup and rethink how I'm going about this.
Posted by: Steven Rosenberg | May 10, 2007 4:10 PM
I use Fetchmail, Mutt, Procmail and Postfix to handle my mail, and have also
changed my mind several times over the last few years over which anti-spam
tool to use.
Here's a brief summary of how it works:
mailbox_command = procmail -a "$EXTENSION" in /etc/postfix/main.cf
The point to emphasize here is that all of this isn't too difficult to set up (a certain investment in reading manual pages and setting up configuration files is needed, especially for Procmail and to a lesser extent Fetchmail), but once set up, it works really well - year after year - with only incremental improvements. That's why some of us are so addicted to this way of working. I can't remember how long it took to set up the first time, but given how well it has worked ever since, it was well worth it.
Posted by: Jason | May 10, 2007 7:52 PM
Thanks for all the suggestions, everybody. I thought that I could get by with just mutt and esmtp, but it looks like it'll take more than than.
This is not at all something I'm going to give up on -- but I would love to find a book, Web site or some other reference that covers the topic of e-mail in Linux in detail, with lots of examples and sample configuration files.
Curiously, most of the "votes" so far have been for mutt and its various helper apps, and fewer for pine.
As far as editors go, I'm already getting better with vi, though I'm growing to like nano.
And ... Midnight Commander makes things so easy, I almost feel like I'm cheating.
The one thing that is inspiring yet maddening about this is that by virtue of all the choices out there in both applications and configuration, you really can have a custom-tailored system that serves your needs.
And the other thing I'm learning from using the command line is that these apps, which work so quickly and on computers many, many years old, are still being improved and updated. It's very inspiring to someone who loves old hardware.
Posted by: Steven Rosenberg | May 11, 2007 9:16 PM