Issue

How to relay outbound email from legacy network devices using Google Mail or Google Apps (gmail) mail servers.

Description

Google's mail servers use TLS (SSL) encryption that require authentication before they will relay mail.
Many legacy network devices, such as Canon, Ricoh, and Toshiba copier/scanner/multifunction devices, do not support authenticated SSL login to a SMTP server. The following solution documents a very simple, low impact solution. By using the open source hMailServer to act as a Windows-based SMTP relay, companies can successfully switch to Google Apps without losing the ability to scan and email documents directly from their multi-function devices. This solution also works well for automated backup utilities such as SyncBack and BackupExec, that send automated reports via simple SMTP.

Solution

  1. Download hMailServer from http://www.hmailserver.com/
  2. Select a machine that will be on and accessible 24/7 from any necessary device on the network.
  3. Perform a standard install. Drive space should be minimal as this system will act strictly as a relay server, and only cache undeliverable messages.
  4. Set an admin password for the console and be sure not to lose it as this admin panel will be accessed very infrequently after successful deployment.
  5. Configure a GMail/Google Apps account for outbound use. Skip to step 6 if you have already done this, otherwise, for Google Apps:
    1. Login to your Google Apps control panel as an administrator (typically http://google.com/a/yourdomain.com).
    2. Create a dedicated account for outbound scans/reports/etc, such as [email protected] and Save.
    3. Important: Login to your new account through the Google Apps interface for your domain, as if you were a new user, and perform the CAPTCHA verification for the account and test the inbox functionality.
    4. Logout and note these credentials for the next steps.
  6. Open the Administration console for hMailServer and make the following configuration changes in hMailServer:
    1. [Domains | Add...] Add a new local domain. For example, local.yourdomain.com and Save.
    2. [Domains | local.yourdomain.com | Accounts | Add...] Add a new local account. For example, [email protected] and Save.
    3. [Settings | Protocols | SMTP | Delivery of e-mail] make the following changes:
      1. [Local host name] = yourserver.yourdomain.com (pretty much irrelevant)
      2. [Remote host name] = smtp.gmail.com
      3. [Remote TCP/IP port] = 465
      4. [Server requires authentication] = Checked
      5. [User name] = [email protected] (or [email protected], etc.)
      6. [Password] =
      7. [Use SSL] = Checked
      8. SAVE
    4. [Settings | Advanced | IP Ranges] Add...
      1. [Name] = Firewalled subnets
      2. [Priority] = 20
      3. [Lower IP] - [Upper IP] = Inclusive local subnet that includes network devices that need to relay.
      4. [Other]
        1. [Anti-Spam] = Cleared
        2. [Anti-Virus] = Cleared
      5. [Require SMTP Authentication]
        1. [Local to local e-mail addresses] = Cleared
        2. [Local to external e-mail addresses] = Cleared
        3. [External to local e-mail addresses] = Cleared
        4. [External to external e-mail addresses] = Cleared
      6. SAVE
    5. EXIT
  7. Open the configuration page for your multi-function device or automated system that needs to relay.
  8. Select the IP address (or resolvable host name) of the computer on which you installed hMailServer as the mail server.
  9. If necessary set the username as [email protected] and the password .
  10. It is not required to set a username and password if the device does not support it.
  11. Send a test e-mail to an external address and verify receipt.

Troubleshooting

If you're having problems getting the relay to work, here are some things to try:

  1. Configure a standard mail client with the local ([email protected]) address and password, and point it at the hMailServer.
  2. Send a message to an external address and check the non delivery report.
  3. Open the Administration console and enable logging as follows:
  4. [Settings | Logging | Enabled] = Checked
  5. [Log | Application] = Checked
  6. [Log | SMTP] = Checked
  7. [Log | TCP/IP] = Checked
  8. Show Logs
  9. Send a test e-mail and check the logs. Typical errors include incorrect credentials, or a mistyped port on the outbound relay page.

Notes

This is a VERY INSECURE installation if not firewalled. This server will relay anything sent to it on behalf of your google email account. It is imperative that this operates only behind a secure firewall, does not have access from the outside world of any kind, and uses strict IP filtering on the subnet pages. Keep in mind that malware that looks for open relays on you local network will be able to forward with impunity through this relay. hMailServer supports many advanced options to minimize this behavior, but that is beyond the scope of this document. These techniques can be slightly modified to provide relay services through virtually any other ISP or mail service, including Yahoo! Mail, AOL Mail, MSN Mail, ISP Mail, Web Mail, etc. Multiple accounts can also be set up to provide different outbound identities as needed for different devices or applications.

Keywords and related applications

Google mail, Google Apps, SMTP, Relay, SSL, Yahoo! Mail, AOL Mail, MSN Mail, Toshiba copier, Canon copier, Ricoh copier.