I have a box running RHEL 6.3 and there's and application that needs to send out reports by mail, in order for this functionality to work I have to have mail configured in my box. In addition I thought it would be nice to receive my root alerts to my regular email instead of having to log into the box.

I have an Office 365 account created for the sole purpose of being used as the relay.

Office 365 SMTP Details:

SMTP: pod51011.outlook.com Port:587 Encryption: TLS

What I tried:

- Defined the SMART_HOST in the sendmail.mc
- Generated and configured sendmail certificates
- Created the AuthInfo file with SMTP credentials
- Eliminated from sendmail.mc localhost's loopback
- Got frustrated because even thought I configured everything (using different guides) sendmail kept trying to send them throught localhost.

After 8 hours of multiple tries:

- Gave up on sendmail and slept 12 hours due to a massive headache.
- Decided to use SSMTP (because sendmail was a PITA) and people said SSMTP was easy to configure.
- Configured SSMTP and for some reason SASLAUTH said it couldn't connect to the SMTP.
- Got frustrated again and uninstalled SSMTP.

And here I am, seeking for assistance cause I want to beat sendmail! Can anyone point me in the right direction?

  • IIRC I had something similar to this working in production : cyberciti.biz/faq/… I don't know if it works for encrypted smtp – user130370 Jan 8 '13 at 15:38
  • 1
    But IMHO you are describing the reasons why many sysadmin decided to switch from sendmail to postfix :) – user130370 Jan 8 '13 at 15:39
  • I saw that guide, but it makes changes directly to sendmail.cf (which in the header of it clearly says its a no-no) and it doesn't incorporate authentication with TLS. Meanwhile I'll research about postfix. Thanks! – Rhyuk Jan 8 '13 at 15:43

I also tried doing this with sendmail relaying via gmail, but opted to use postfix instead as it seemed MUCH more simple to setup. You dont have to go through the process of creating self signed certificates etc.. This howto is for gmail, but the process should be very similar for Office 365. Just a matter of finding out the server names, and authentication scheme. http://rs20.mine.nu/w/2011/07/gmail-as-relay-host-in-postfix/ Geo

  • I followed the tutorial and this is what I'm getting: Jan 9 09:52:47 isvahlrtk01 postfix/smtp[12065]: connect to pod51011.outlook.com[]:587: Connection timed out – Rhyuk Jan 9 '13 at 14:00

After changing sendmail.mc did you run /etc/mail/make in order to build sendmail.cf? Did you also run service sendmail restart after generating the new sendmail.cf?

  • Yes sir, did all that. I think it's gotta be network related, even though I have port 25/587 opened in my firewall. And right now (and the closest Ive been) is trying with postfix and I get this Jan 9 09:52:47 isvahlrtk01 postfix/smtp[12065]: connect to pod51011.outlook.com[]:587: Connection timed out – Rhyuk Jan 9 '13 at 20:35
  • 2
    The log message that you provide shows that the machine is longer running sendmail but postfix. Second the same log message shows that something is blocking port 587 traffic from that machine to pod51011.outlook.com – adamo Jan 10 '13 at 9:23
  • I created rules in my firewall for the input/output chain (just in case) for port 587. iptables -L -n command shows me ACCEPT tcp -- state NEW tcp dpt:587 – Rhyuk Jan 10 '13 at 14:44
  • 1
    But can you telnet pod51011.outlook.com 587 ? If not, some router along the way (or pod51011.outlook.com) is blocking access. – adamo Jan 10 '13 at 16:11
  • 1
    After all it was that my companys network was blocking SMTP. – Rhyuk May 13 '13 at 20:05

The reason why I couldn't connect to the SMTP was because my company was blocking SMTP access. Ended up using a local SMTP and used Postfix with these instructions to make it work.

Postfix relay through another mailserver

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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