Linux – Send emails from Linux via Google SMTP

linuxsmtp

I've gone as far as I can go on my own, but I'm not a Linux guru and am now stuck.

I've got an Oracle database running Oracle Enterprise Linux 5.1 on an Amazon EC2 instance. I migrated it from a box that was connected via a home broadband connection, and it was sending emails without problem via the ISP's SMTP server – but now that it is running on EC2, the ISP doesn't recognise it and refuses to accept the emails.

So now I want to set it up, the simplest way possible, so that it can continue to send emails.

  1. I've tried emailrelay as per instructions here: http://jiri.wordpress.com/2010/03/24/send-emails-using-utl_mail-and-google-gmail-smtp-server/#comment-108

    (background note: https://stackoverflow.com/questions/3430820/emailrelay-cannot-bind-the-listening-port)

    I had problems getting it to work because openssl wasn't installed:

    $ emailrelay –as-proxy smtp.gmail.com:587 –client-tls –client-auth /etc/emailrelay.auth –port 8025
    emailrelay: error: cannot do tls/ssl: openssl not built in
    emailrelay: exception: cannot do tls/ssl: openssl not built in
    

    But it wouldn't work because it requires openssl-devel, which I can't install on my system (I couldn't find the dependencies:

    $ rpm -i openssl-devel-0.9.7a-2.i386.rpm
    warning: openssl-devel-0.9.7a-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
    error: Failed dependencies:
    krb5-devel is needed by openssl-devel-0.9.7a-2.i386
    openssl = 0.9.7a-2 is needed by openssl-devel-0.9.7a-2.i386
    

    I gave up at that point because I couldn't find krb5-devel available for Oracle Enterprise Linux 5.1.

  2. I had a look at this sendmail option: http://www.phinesolutions.com/sendmail-gmail-smtp-relay-howto.html

    But this doesn't work because sendmail wasn't compiled with "TLS" or "SASL" options, and how to fix this wasn't covered.

Am I making this more difficult than it has to be? Is there a simple way to send emails from Linux? I have a Google Apps account associated with the domain name.

Best Answer

Shouldn't yum install openssl-devel install the required OpenSSL for you, or do you need some special version of OpenSSL and that's why installing the rpm package by hand? Usually you should not do that!