Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

    (background note:

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

    $ emailrelay –as-proxy –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:

    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.

share|improve this question
Ok, I've read and worked out how to continue sending emails via the ISP. – Jeffrey Kemp Aug 10 '10 at 9:15

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!

share|improve this answer
I've never heard of yum. I gave it a go, but it says "no match for argument": $ yum install openssl-devel Loading "installonlyn" plugin Loading "security" plugin Setting up Install Process Setting up repositories No Repositories Available to Set Up Reading repository metadata in from local files Parsing package install arguments Setting up repositories No Repositories Available to Set Up Reading repository metadata in from local files No Match for argument: openssl-devel Nothing to do – Jeffrey Kemp Aug 10 '10 at 7:15
So you need to go back and read the Linux package management 101. :-) You always should use a package manager for installing packages and NOT download & install those rpm packages by hand. A package manager will keep track of dependencies, takes care of updating your system and so on. With "Enterprise Linux 5.1" you probably mean "Red Hat Enterprise Linux 5.1"? If you have an entitlement bought for it, you need to then register your server to Red Hat Network with command rhn_register. After that the previous yum install openssl-devel should work. – Janne Pikkarainen Aug 10 '10 at 7:36
Definitely need the 101 :) I'm using Oracle Enterprise Linux 5.1, and rhn_register requires a CSI, which I don't have. – Jeffrey Kemp Aug 10 '10 at 8:00

RHEL is particularly bad when it comes to untangling the dependencies - you may find some of the packages you need in the CENTOS repositories. Failing that, installing stunnel should be a no-brainer. There's a centos package here. Note that you will still need the openssl libs installed (but not the dev kit).


share|improve this answer
Or just configure sendmail to do it for you (assuming this does not undermine your SPF records / gmail's policy) – symcbean Aug 10 '10 at 7:55
Sorry, I really am at sea once I'm outside Oracle - I don't understand how stunnel would work, and the centos link appears to be broken. Also, I did mention that I couldn't get the sendmail option working either. – Jeffrey Kemp Aug 10 '10 at 8:08
There are specific details for gmail on the internet. A quick google found this -… Just configure stunnel.conf as shown, start up the daemon then point your code to as the SMTP server (alternatively set stunnel to listen on port 25 and switch off sendmail). – symcbean Aug 10 '10 at 11:23

I have earlier posted a solution on Stackoverflow.

share|improve this answer

I believe that you're only interested in using it to send admin/cron/system messages and not a full-blown SMTP setup. If that is the case, the simplest method would be to use SSMTP. I believe that there are packages for your distribution too.

share|improve this answer
I was going to suggest this, too. I use SSMTP with a Gentoo server since we do not actually host mail on that domain; Google Apps does. No mail is sent directly from the server, it is all relayed through a @domain account through Google Apps. – laebshade Jul 10 '11 at 21:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.