Friday, May 13, 2011

Using Mercury/32 as an interface to Gmail SMTP Gateway

Having an SMTP server which can deliver email to the Internet is great when conducting experiment in network environment. There are quite a number of SMTP server software available. In this article, we will use Mercury/32, a SMTP server which is included in the XAMPP package as an example for relaying email to the Internet through Gmail gateway - the Google email system.

Following are some of the steps involves in configuring Mercury/32 to use Gmail SMTP gateway as it’s SMTP relay host.
  1. If you already have Web Server (like apache) running on your system, please disable HTTP Server in the Mercury configuration so that it will not conflict with existing server service.
    Select: “Configuration” -> “Protocol modules”
    Uncheck “MercuryB HTTP web server”
  2. Enable “MercuryC SMTP relaying client” in the same dialog box. Click “OK”
  3. Restart Mercury!
  4. “Configuration” -> “Mercury core module”,
    • tab “General”
      1. Internet name for this system: localhost
      2. Disable all checkboxs but “Send copies of all errors to postmaster”.
    • tab “Local domains”
      1. if the entry “localhost (local host or server) localhost (internet name)” is there, if not, add it and click “OK”.
  5. MercuryS SMTP Server:

    “Configuration” -> “MercuryS SMTP Server”
    • Choose the tab “General”
      1. Add a name for your SMTP server under “Announce myself as”, simply fill in any name, for example “ABC SMTP”.
      2. Under “Listen on TCP/IP port” fill in “25″, add “127.0.0.1″ to “IP interface to use”.
    • Limit the access to the server so that only local machine can access it. Under “Connection Control” tab,
      1. click on “Add restriction” and add the IP range from “127.0.0.1″ till “127.0.0.1″.
      2. Select “Allow connections”… and leave all checkboxes deselected.
  6. MercuryP POP3 Server:

    “Configuration”-> “MercuryP POP3 Server”,
    • select the tab “General”, “Listen on TCP port” -> “110″ and “IP interface to use” -> “127.0.0.1″
    • Choose the tab “Connection control” and proceed as already done above.
  7. “MercuryC SMTP Client”

    In order to send email to external addresses in the Internet, we need to have an external SMTP server.

    “Configuration” -> “MercuryC SMTP Client”

    In the case of Gmail SMTP gateway,
    Smart host name: smtp.gmail.com
    Connetion port/type: 587 (SSL encryption via STARTTLS command)
    Annouce myself as: ABC SMTP
    Credentials for SMTP Authentication, if required
    Login username: your full email address (including @gmail.com)
    Password: your gmail password
    
  8. Mercury User account:

    “Configuration”-> “Manage local users”
    There should be at least the users “Admin” and “postmaster”, both with administrative rights. If not you have to add them.
  9. If you use PHP in your web site, open the appropriate php.ini file. You will find it under “xampp/php/php.ini” or “xampp/apache/bin/php.ini” in XAMPP.

    In the “[mail function]“…, add/adjust the following:
    “SMTP = localhost”
    “smtp_port = 25″
    “sendmail_from = postmaster@localhost”
    
    Save the php.ini and restart the Apache
  10. Testing

    Within Mercury choose “File” -> “Send mail message” and send an email for testing purposes.
  11. Verification

    You may check this information in the window “Mercury Core Process”, “Mercury SMTP client (relay version) and so on.

No comments:

Post a Comment