Install and reconfigure your Exim4 software on Debian or one of the *buntus:
shell# aptitude updateshell# aptitude install exim4shell# dpkg-reconfigure exim4-config
On that first screen, make sure to select one of the 'Mail sent by Smarthost...' options (which will be Google); which option depends on if you expect this server to receive any mail on the local network.
The System Mail Name you can set yourself, such as 'mailserver.local'. Other options you can set or leave as their defaults, depending on your needs.
When you get to the "IP address or host name of the outgoing smarthost" screen, set the Google Mail servers followed by two colons and the port 587, which should look like this:
smtp.gmail.com::587
Hit <Ok> to move forward; select to hide the local name in outgoing mail <Yes>; Select for the visible domain name and remaining options as you see fit. If you're unsure, use the defaults.
Exim4 will restart when you're done. Now use your favorite editor and open the file at:
/etc/exim4/passwd.client
In its default state, all of this file should be commented-out (lines starting with #). At the end of the file, add these three lines, replacing the generic info here with your email address and password:
smtp.gmail.com:youremail@gmail.com:PaSsWoRd
gmail-smtp.l.google.com:youremail@gmail.com:PaSsWoRd
*.google.com:youremail@gmail.com:PaSsWoRd
If you use Google Apps, change the youremail@gmail.com to your Google Apps address.
Reload Exim4's config and send a test email:
shell# /etc/init.d/exim4 reload
shell# date | mail -s "test from relay server" youremail@gmail.com
shell#Note that Google Apps Mail doesn't send to itself (gmail will though), so you may be better off test-sending to a different account.
You may also need to allow relay for this server's IP, depending on how much outgoing mail it sends (Google also has daily sending limits of which to be aware!) In Google Apps, do this by Manage the Domain, then Settings tab, Email section:

0 comments:
Post a Comment