Syndicate content

MTA

Linux is Easy!

Warning! This post is long and doesn't have any pictures. It's not even really all that helpful to the Ubuntistas who are looking for help configuring Postfix. But I feel better. That's what counts, right?

Last night I sat down in the wee hours of the early evening to spend some quality time doing some editing on my long ignored novel, "Someone Liche You." I went through a period where I was editing a chapter a night pretty regularly last May and then I had some major tech failures (broken computers started acting broken, imagine that!) and so I ended up spending a lot of my free time trying to cobble a few of my busted computers into on that might work sometimes.
The long and the short of it, is that I sat down at my Dell Dimension 3100 Laptop which I use exclusively as a VNC terminal (remote X won't work-- it's a long story) to connect to my Desktop computer in the office so that I can access my file and do some work.
In addition, it occurred to me that back in May, I had a nice cron job that would email myself a copy of the novel at 3 a.m. every night so that I always had a daily backup. And I remembered that I thought enabling that cron job was pretty easy, so I thought I'd have a quick whack at it and _then_ get to editing my novel.
I am a fool.
So, trying to remember how to mail myself something from a command line, I start poking around on my system and realize that Mutt isn't present! Apt-get won't install it, saying that it's missing from the Ubuntu repositories. Strange. So I pursue other options. I install mail-utilities. I install some other junk that won't work without downloading and installing credentials from some dude's website.
So I start rooting around on gnu-mail and poking around in some of the Ubuntu forums. And I remember vaguely that, for some reason, this computer didn't have the main gusty repository enabled. So I fired up Synaptic and away we went. Of course! I had turned off the main Gutsy Repo. I have no idea why I would have done that, but I'm sure it was very important at the time. See? Linux is easy!
So, with the quick execution of "apt-get install mutt" I was happily churning out emails from the Command Line.
Or was it?
Of course not.
The next thing you have to do is install a Mail Transfer Agent. (We'll get to that in a minute.) Obviously, anyone who wants to mail knows that the MTA is a separate and distinct procedure from installing the mail client. Of course!
Fortunately, Mutt has a little error message when it is running in absence of a Mail Transfer Agent, so I knew that there was a problem. After some fairly unconstructive Googling, I came up with Postfix.

Why doesn’t postfix configure itself? Postfix should configure itself, given that there is no personal information that needs to be configured in the config file. It should also be a dependency for a command line mailer. Are you telling me most people who use Mutt know that they want to use it without an MTA?
I'm getting ahead of myself. Lets take a step back.
What is Postfix?
Postfix is a free software / open source mail transfer agent (MTA), a computer program for the routing and delivery of email. It is intended as a fast, easy-to-administer, and secure alternative to the widely-used Sendmail MTA. [So Spake Wikipedia]

See, here's the thing, in order for your Ubuntu installation to send mail, it needs to have a mail transfer agent (MTA). You don't need an MTA if you're using someone else’s, which is what you do when you use your ISP or Google to send your email. If you want to send email from your little linux box, you can simply open up a can of SMTP Daemon on your system and you are good to go.
Why?
Good question. I am not sure why you would not just want there to be an easy and intuitive way to use your ISP's SMTP service from the command line. However, that does not seem to be how Linux works. This post is getting pretty tedious, huh? Wait, it gets far duller in a moment.
Simply installing postfix (apt-get install postfix) is not enough. You also need to configure Postfix. How do you configure postfix? You have to copy a file out of a seekrit directory into another seekrit directory. Which file? That depends on your distro. SINCE I GOT THIS FROM the UBUNTU REPOS, isn't it Fair to ASSUME that I want the postfix config file for DEBIAN!??
Fortunately, the postfix install warns you that it's not configured and gives you pretty explicit directions on what file you need to copy.
After only a three-hour trek through Googleland, I was able to send myself email from Mutt. Since all I want to do is send, I'm happy.
Of course, I didn't get any work done on my Novel.

Then, I wrote a nice little bash script that tacks a time and date stamp on my novel so that I know what version it is when it shows up in my Google mail.

See! Linux is easy.