Configuring Exim to use Gmail as the outgoing SMTP server is simple. This HOWTO will walk you through installing, configuring and routing email thru Gmail for exim.
The first step is to install exim4. Launch terminal and:
Run the following command to configure exim4:
Set the following:
General type of mail configuration: mail sent by smarthost; no local mail System mail name: (default) IP-addresses to listen on for incoming SMTP connections: 127.0.0.1 Other destinations for which mail is accepted: (default) Visible domain name for local users: yourdomain.com IP address or host name of the outgoing smarthost: smtp.gmail.com::587 Keep number of DNS-queries minimal (Dial-on-Demand)? No Split configuration into small files? No
The exim4 SMTP server is now set to route emails thru Gmail. Now all we need to do is to tell exim4 the username and password we are going to use. To accomplish this create a text file called /etc/exim4/passwd.client. Update the file to read:
Replace you@gmail.com:password with your login information.
Reload the exim4 server:
To test the configuration launch a terminal and type:
NOTE: the spaces in "youremail @ domain.com" are added to avoid Drupal converting the text to a linked email.
That is it!
Cheers.
Comments
thanks
Thanks for the tip. This is a useful, partial work around to the problem of ISPs blocking port 25 and email from "consumer desktops," aka Windows botnet hosts. While people in the US still can't run useful servers as part of their internet service, they can at least use their machine in a general way to send mail. This can simplify small office setup. It's funny how Google can offer better Internet service than most ISPs without owning any wires.
Thanks!
Works well.
With this configuration,
With this configuration, every single outgoing mail, regardless of who sent it, will appear in the From field as "you@gmail.com".
Any way to have different gmail user/passwords sent, based on which From: or Sender: fields contain? Failing that, how about based on the user name?
Thanks,
--Ken
You raise a good point. The
You raise a good point. The only way I could make this work is my having all my emailer programs specify the "Reply-To:" header fields. This solves the issue when people click on the replay to button in their email client. There are still some issues that one must weight when using GMail to send messages:
Thanks for raising this issue. Here is another link you may find of interest: How to send e-mails from any address using Gmail's SMTP server.
Post new comment