Friday, July 17, 2009

Email on ubuntu (exim)

When I installed real player a few months back I noticed it had installed exim. I thought that highly suspicious - what was real player planning to do behind my back? Well, I thought I'd try removing it today, and discovered realplay depends on lsb-core (linux standards), and lsb-core depends on exim. realplay was innocent.

The magic command to remove exim is:
dpkg --purge --ignore-depends=lsb-core --ignore-depends=mailx exim4 exim4-base exim4-config exim4-daemon-light

But after doing that I changed my mind. As I discovered I couldn't send any email from commandline. Did somebody just say "Duh!". Well I was hoping I could then configure something to tell it to use SMTP directly to my ISP. (Why do I want to send email from commandline? Well, yes to test programs, but much more importantly that that I realized my system has been sending me warning emails and they've been undeliverable, so for instance the daily mail telling me about my RAID problem has not been reaching me...)

Anyway, lsb-core and mailx were screaming at me that their dependencies were missing, so re-installing exim was just a matter of telling them to re-install. Then the key step I had been missing was this:
sudo dpkg-reconfigure exim4-config

Still not easy, but it becomes much clearer if you know that what exim calls a "smarthost" is what the rest of the world calls "my ISP"! I.e. in my case I told it to use a smarthost for outgoing email, no incoming email, and for the smarthost I just looked in my thunderbird configuration for the SMTP server and gave it that address. It also kept asking me for a default domain and I chose "dcook.org" for everything.

Seems to have done the job!

Oh, the raid problem? It is just complaining I didn't set up swap as RAID. This was deliberate, see my original post on raid setup. At the time I wrote that I didn't understand the issues involved regarding RAID and swap. But if the system is complaining I will set it up as raid to make the message go away.

2 comments:

darren said...

Hhhmm, email still wasn't arriving. It turns out email for root tried to deliver to root at dcook-dot-org, and so bounced. This is despite having an entry in /etc/aliases for it.

# exim -bt xxx
R: smarthost for xxx@dcook.org
xxx@dcook.org
router = smarthost, transport = remote_smtp_smarthost
host dcook.org [69.89.31.120]

(where xxx is any name, whether in /etc/aliases or not).

My temporary fix is to create the email addresses it is trying to deliver to, but that opens me up to yet more spam.

darren said...

To force a resend of all frozen entries in the mailq you apparently use this command:

mailq | grep frozen | awk '{print $3}' | xargs exim -v -M

However it received 550 errors for all of them. Yet mail to the accounts they are supposed to go to now works (see previous comment). Weird.