views:

1889

answers:

2

Hi,

I'd like to know how to setup my exim4 on Debian so that it can use gmail as the smarthost, rather than my ISP. It appears to need TLS to be setup, and of course a gmail userid and password. The "standard" smarthost example that comes with exim4 in Debian doesn't have these.

+1  A: 

First, install stunnel4 and configure it to map [127.0.0.1]:587 to smtp.gmail.com:465 like this:

client=yes
[smtp-gmail]
accept = 587
connect = smtp.gmail.com:465

Then reconfigure exim4:

dpkg-reconfigure exim4-config

Configure exim4 to use a lot of small files, smarthost through localhost:587

Edit /etc/exim4/passwd.client and add:

localhost:[email protected]:yourpassword

Remember to check permissions, and then run:

update-exim4.conf

That should do it.

geocar
Thanks for the answer. I will try it. Why must stunnel be used, i.e. why can't exim4 coomunicate with gmail's smtp host directly?
Macker
I don't think it "must" - merely that this is easier to explain.
geocar
I've voted this down as I never liked having to use another piece of software (stunnel) where it should not be needed.
Macker
+2  A: 

The above solution didn't work for some reason but the solution here worked for me.

http://www.manu-j.com/blog/wordpress-exim4-ubuntu-gmail-smtp/75/

The only change I did was to use [email protected] instead of [email protected] in the “begin authenticators” section.

Sayeed Anjum
Yes, this is a great answer
Macker