Life in code, apps and OS's

How to install Exim4 on Ubuntu as a smarthost

Posted on: April 30, 2007

For months now I have been trying to setup a fast, reliable linux mail server. I think I have now cracked it. Basically my system layout is as follows;

I have been developing a new social community site called UrbanParty (www.urbanparty.net), The application is ran on my Ubuntu Linux server and uses SMTP to send out email notifications etc. In the past I have used Microsoft Windows server for mail as they are always much simpler to install and configure (well I think so anyway). However I could not really justify having another server for simply sending emails, Therefore I decided that im gunna try and crack the issue and thought that I would share the resolution with all of you🙂

Ok here goes…

Firstly you will need Ubuntu linux installed, Im using Ubuntu Dapper Drake 6.06 (Server edition) however this how-to should also work for other versions of Ubuntu and should also work for Debian too.

Firstly we install Exim4 using ‘Apt-get’ so logon to your Ubuntu/Debian system as the ‘root’ user. Then issue this command:-

apt-get install exim4  exim4-config

Then Ubuntu should install the packages and then once installed issue this command:-

dpkg-reconfigure exim4-config

Now a graphical user interface will load to help you configure Exim quick, I am using my ISP’s SMTP server to ensure that all user’s recieve the email as mail services like Hotmail etc. are likely to block emails from unknown hosts. So now at the graphical prompts I do as follows:-

1. Choose: Mail sent by smarthost; Recieved by SMTP or Fetchmail
2. Enter Smathost relay:  smtp.yourisp.com

You will need to obviously need to change the host name of the smarthost to match your ISP’s mail server.

Now to test the mail server, I installed ‘mailutils’ so issue this command at the prompt to install mailutils

apt-get install mailutils

That will install some simple mail utilitys that will allow us to test sending an email etc. Once installed do as follows:-

mail youremail@yourdomain.inc (enter your email address here)
(press enter for Cc:, type in subject, press enter)
 (type in body of message, then enter)
.  
(type in single period, then enter, to end composing and email is queued)

Now you can check to see if the email message is still in the queue by typing the following command:

mailq

Your mail server should now be fully functional (for sending external messages) please not to recieve messages you may need further configuration of the mail server.

Hope this works for you.

If you liked this tutorial please show your support by visiting and registering on my site www.urbanparty.net it would be nice of you to upload and set a profile photo of you too. Thanks all, Hope to see you on the site soon🙂

4 Responses to "How to install Exim4 on Ubuntu as a smarthost"

[…] router and you want to be able to send emails via a cron job or Nagios or something like that. Here is how to configure Exim4 to do that. November 29, 2008 | Filed Under […]

seems to work, thanks😀

[…] to install an automated mailer for sending bulk emails to all the registered users, and had used Exim4 then and a PHP script which recursively invoked the Shell command. Out of the extensions available […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


  • How To Dyndns Ubuntu | Order Goods: […] DynDNS Client Setup on Ubuntu | Life in code, apps and OS’s – May 18, 2008  · 7 Responses to "DynDNS Client Setu
  • lizrandolph10886: Wonderful article! We are linking to this particularly great post on our website.nKeep up the great writing. Click
  • waseem Ahmad: Dear. i have a separate application server and a separate mysql database server. when i want to access the application server to login from the local
%d bloggers like this: