Configuring exim on ubuntu 10.10 for use smarthost

 I had to get sendmail working on my ubuntu / well kubuntu installation today – well i actually didn’t need to configure that, but i hade to test some programs that should use smtp to forward mail to an external mailserver. And i ran this in wmvare. And then i found out that i never had configure that. Next part was that by default, ubuntu and kubuntu is using exim as the mailer, not the real sendmail system. So I thought that I should get it to work. Kind of out of the box.

First thing to run is exim-config

The options I used were:

  • mail sent by smarthost; received via SMTP or fetchmail
  • <your box hostname> (i had to adjust this – adding hostname and domain to it)
  • 127.0.0.1 ; ::1 (this was also filled in.. I added 192.168.205.1 as i whanted it to listen to vmware internal net also)
  • <your box hostname> (again, this was filled in already, I just accepted the default)
  • I added 192.168.205.128 here as i whanted my vmware host to be able to forward. Normally you SHOULD leave this blank.
  • ns1.smtphost.com (the smtp server provided by my ISP)
  • I said no (the default)
  • I said no (the default) for DNS lookups
  • I chose the mbox format. (the default)
  • I chose the “unsplit” config file option (the defaults)

This fixes the exim setup mostly. As our smtp is using plain text you need to enable that also. Create (or edit) the file /etc/exim4/exim4.conf.localmacros and add the following line to it, and save it:

Then we need to setup the outgoing mail account you’re using by editing the file /etc/exim4/passwd.client. As I’m only doing mail to one smtp server im using the wildcard:

Then I need to fix outgoing mail so that root/jan/postmaster goes to me. This is fixed by changing the /etc/email-addresses file.

Finally its time to re-read the exmin4 config and restart the server.

Now mail goes out and sent to my mail server.

Leave a Reply

Your email address will not be published. Required fields are marked *