Jun 18

How to configure Exim to send email using a Gmail account as a Smart Host. After following this guide, Exim should be able to send email out to the internet via your Google Gmail account.

1. Prepare Exim4 using dpkg

dpkg-reconfigure exim4-config

Selections:

a) General type of mail configuration: mail sent by smarthost; received via SMTP or fetchmail

b) System mail name: localhost

c) Ip Addr to listen on: 127.0.0.1

d) Other destinations~: <blank>

e) Machines to Relay for: <blank>

f) ip address or hostname of the outgoing smarthost: smtp.gmail.com::587

g) Hide local mail name in outgoing mail: No

h) Keep number of DNS queries minimal: No

i) Delivery method for local mail: Maildir format in home directory

j) Split configuration into small files: Yes

2. As root, edit /etc/exim4/passwd.client and add the following.

Don’t forget to change emailaddress@gmail.com to your own email address and password to your own password:

gmail-smtp.l.google.com:emailaddress@gmail.com:password
*.google.com:emailaddress@gmail.com:password
smtp.gmail.com:emailaddress@gmail.com:password

Note: You are probably worried about having your password in this file – don’t worry, we’ll make sure the permissions are set correctly in the next step.

3. Set permissions on the /etc/exim4/passwd.client file

Type the following, as root, in the console:

chmod 640 /etc/exim4/passwd.client
chown root:Debian-exim /etc/exim4/passwd.client

4. Add/Edit the /etc/exim4/email-addresses file

In the console as root, add or edit the /etc/exim4/email-addresses file. Just add the following line (no others)

your-local-user-name@localhost:    your-gmail-email-address

And set permissions:

chmod 640 /etc/exim4/email-addresses

5. Edit the /etc/exim4/update-exim4.conf.conf file

It should look like the following:

dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'

6. Restart Exim

/etc/init.d/exim4 restart

That should be it!

May 9

One of the nice things about the Debian GNU\Linux distribution is that it is highly customisable. As new applications are written and existing applications mature, along with personal preferences changing, I often find myself preferring different applications for specific tasks. This blog lists the main applications that I change, primarily for my own reference so that I can easily remember how to change them again in the future.   :) Maybe it will be useful for others too.

Note that this is primarly Debian specific, but should work on Ubuntu too.

Change Default File Manager

I am a Gnome user and find Nautilus great most of the time, however when I am moving a lot of files around I find the simpler and more light weight PCman File Manager more convenient, especially because it supports tabs. Thus, I set up my Gnome Panel so that my home directory (Places  >  Home) loads PCman, and Computer (Places  >  Computer) loads Nautilus.

Firstly, locate the following file:

/usr/share/applications/nautilus.desktop

Note: A lot of blogs also mention changing nautilus-computer.desktop and nautilus-home.desktop, although I do not do this as explained in the summary above.

Locate the line beginning with “Exec” and change it as follows:

Exec=pcmanfm

Now, its done!

Changing Gnome to use OpenBox instead of Metacity

I much prefer OpenBox to Metacity, its lean, fast, written in C/C++ (which I am learning) and provides excellent key binding support. In addition, with Gnome also installed, one has many different options:

  • Run Gnome normally
  • Run only OpenBox
  • Run Gnome with Open Box
  • Run OpenBox, and only load the Gnome panel (gnome-panel) – which seems very similar to the one above!

Fortunately, in Debian Etch and above, installing OpenBox updates gdm to include a Gnome with OpenBox option, so the installation and change is quite straight forward:

# aptitude install openbox openbox-themes obconf obmenu

If you also want a panel, perhaps give pyPanel ago.

Use Sun Java as default

# aptitude  install sun-java6-jdk sun-java6-jre sun-java6-plugin

Now, set it as the default:

# update-java-alternatives -s java-6-sun

Change the default web browser

I tend to prefer firefox to Epiphany, only because the Epilicious application stopped working on my system a little while ago and I havent managed to figure out how to fix it yet. I use Delicious for bookmark storage.

# update-alternatives --config x-www-browser

Now, select desired default.

If you use Thunderbird (Icedove on Debian), you may also want to set the default browser for it. To do so, add the following lines to your user.js file, which on Debian is located in ~/.mozilla-thunderbird/<profile name>/

Now create, or add if it is already there, the user.js file:

user_pref("network.protocol-handler.app.http", "/usr/bin/firefox");
user_pref("network.protocol-handler.app.https", "/usr/bin/firefox");
user_pref("network.protocol-handler.app.ftp", "/usr/bin/firefox");

NOTE: There is a symlink to iceweasel, so using firefox on Debian also works. You can also specify opera, or any other browser you would prefer.

Restart Thunderbird and your new preferred browser should be working.

Set Default Image / Media Viewer

There are many options when it comes to image viewers. Thankfully, its pretty easy to make your favourite the default. This assumes you are using a recent version of the Gnome desktop environment:

  1. Right click on a file of the type that you wish to change the default application for
  2. Select Properties
  3. Change the application in the “Open With” drop down menu
  4.  After you log out, this setting will be saved and preserved for all future sessions.
May 7

Here is my sources.list file and preferences file for Debian Sid that I use on my laptop (not for environments requiring a stable system though!, although to be honest I rarely ever have issues that cause me any great drama).

sources.list file

Located: /etc/apt/sources.list

# Debian GNU/Linux 4.0 r1 _Etch_ - Official i386 NETINST Binary-1 20070820-20:21]/ etch contrib main

deb http://mirror.pacific.net.au/debian/ unstable main contrib non-free
deb-src http://mirror.pacific.net.au/debian/ unstable main contrib non-free

deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

deb http://mirror.pacific.net.au/debian/ etch main contrib non-free
deb-src http://mirror.pacific.net.au/debian/ etch main contrib non-free

deb http://mirror.pacific.net.au/debian/ testing main contrib non-free
deb-src http://mirror.pacific.net.au/debian/ testing main contrib non-free

deb http://mirror.pacific.net.au/debian/ experimental main contrib non-free
deb-src http://mirror.pacific.net.au/debian/ experimental main contrib non-free

# After adding the debian-multimedia sources type 'apt-get update && apt-get install debian-multimedia-keyring'
deb http://www.debian-multimedia.org lenny main
deb-src http://www.debian-multimedia.org lenny main

# Compiz Fusion
# deb http://download.tuxfamily.org/shames/debian-sid/desktopfx/unstable/ ./

# Google
deb http://dl.google.com/linux/deb/ testing non-free

# Skype
deb http://download.skype.com/linux/repos/debian stable non-free

# Experimental Kernels
deb http://kernel-archive.buildserver.net/debian-kernel/ trunk main
deb-src http://kernel-archive.buildserver.net/debian-kernel/ trunk main

# Opera Beta
deb http://deb.opera.com/opera-beta/ unstable non-free

# Unofficial Debian packages
# http://packages.kirya.net/
# deb http://packages.kirya.net/debian/ unstable main contrib non-free
# deb-src http://packages.kirya.net/debian/ unstable main contrib non-free

# Debian Unofficial Repository
# For more info visit http://debian-unofficial.org/
#deb http://ftp.debian-unofficial.org/debian stable main contrib non-free restricted
#deb-src http://ftp.debian-unofficial.org/debian stable main contrib non-free restricted

# Star Control II - The Ur Quan Masters A really cool game!!
deb http://uqm.debian.net/ unstable/

# sidux http://sidux.com/files/misc/sources.list
# deb http://sidux.com/debian/ sid main contrib non-free firmware fix.main fix.contrib fix.non-free
# deb-src http://sidux.com/debian/ sid main contrib non-free firmware fix.main fix.contrib fix.non-free

Preferences File

Located: /etc/apt/preferences

 Package: *
Pin: release a=unstable
Pin-Priority: 990

Package: *
Pin: release a=experimental
Pin-Priority: 450

Adding Required Keys

http://dl.google.com

wget https://dl-ssl.google.com/linux/linux_signing_key.pub -O- | sudo apt-key add -

http://uqm.debian.net

wget -O - http://uqm.debian.net/key.gpg | sudo apt-key add -

http://deb.opera.com

wget -O - http://deb.opera.com/archive.key | apt-key add -

kernel-archive.buildserver.net

wget -O - http://kernel-archive.buildserver.net/key | apt-key add -

download.tuxfamily.org

wget http://download.tuxfamily.org/shames/A42A6CF5.gpg -O- | apt-key add -
Feb 2

I recently found a page at TechPatterns that makes installing proprietary Video Card drivers when using the Debian Sid (unstable) distribution quite easy and automated.

The sgfxi script provides a simple and (in my case anyway) reliable means to swap between your open video drivers, and the proprietary Nvidia or ATI drivers. Please note that this script is for Debian Sid and not Ubuntu

I also noticed that my computer ran about 10 degree’s cooler once I had installed the driver. So if anyone is having over heating problems, ensuring that you are using your video card’s processor could be your answer. If you do have overheating issues, a possible cause/solution is also mentioned in my ASUS A8JS Hardware Review post.

The above was tested on an ASUS A8JS Laptop running Debian Sid (2.6.23-1-686 kernel).