+ Post New Thread
Results 1 to 6 of 6
*nix Thread, Postfix and GMail as Relayhost Woes in Technical; Hello everyone, It has been a while since I have posted on here but I could do with some help ...
  1. #1
    pshuttle's Avatar
    Join Date
    Jun 2005
    Location
    Work: Chorley Home: Preston
    Posts
    281
    Thank Post
    5
    Thanked 27 Times in 20 Posts
    Rep Power
    21

    Postfix and GMail as Relayhost Woes

    Hello everyone,

    It has been a while since I have posted on here but I could do with some help as I am currently bashing my head against a desk trying to sort this out.

    I have setup Nagios and RT on a Ubuntu 10.10 server and they are running quite nicely. However, the one (important) component I am missing is email integration so that the applications can send out e-mail alerts. This however, is totally new to me.

    Annoyingly, our e-mail is currently hosted by RM (Easymail) so I need to set this up to work with either GMail or Easymail as a relayhost.

    I have followed quite a few examples and tutorials on the web, but I have not managed to get any of them to work. Because I was unsure as to what configuration steps were failing, I have even tried using SSMTP to send a mail but even then I always get the error Cannot open smtp.gmail.com:587 Is this because I am behind the lancsngfl proxy or is the problem totally unrelated?

    I could do with some help really on this as it would be great to get it working.

    Thanks in advance,

    Pete
    Last edited by pshuttle; 15th March 2011 at 12:45 PM.

  2. IDG Tech News

  3. #2
    pshuttle's Avatar
    Join Date
    Jun 2005
    Location
    Work: Chorley Home: Preston
    Posts
    281
    Thank Post
    5
    Thanked 27 Times in 20 Posts
    Rep Power
    21
    I can see that the lack of replies illustrates either 1) Nobody else has any idea or 2) My lack of understanding of the issue is so severe I am better left alone!

  4. #3

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,117
    Blog Entries
    2
    Thank Post
    111
    Thanked 513 Times in 444 Posts
    Rep Power
    114
    I've never done this but a quick google fnds this Monitor Network Services with Nagios - Part 1 (section 2.3) which looks like it describes what you're trying to do.

    What I would expect to happen is that Nagios talks to a local SMTP server; that then uses normal DNS to find out where it should go to and delivers it.

    For that to work, you need to allow port 25 outbound on your router so that the internal Postfix machine (or whatever) can connect to the external SMTP server which accepts mail for your domain.

    If you can't do that (you don't control the router or port 25 is blocked outside your boundary) then I'm not sure what you can do but I hope someone else can help!

  5. #4


    Join Date
    Jan 2006
    Posts
    6,456
    Thank Post
    324
    Thanked 740 Times in 557 Posts
    Rep Power
    201
    ours basically works like this:

    nagios.cnf emails a local (machine) admin:
    nagios.cnf
    Code:
    admin_email=nagios@localhost
    posfix points to an upstream relay:
    main.cf:
    Code:
    relayhost = x.x.x.x
    an aliases file fowards to whoever:
    /etc/aliases
    Code:
    nagios:         itsupport@external mail.address.com

    again, look for blocked ports etc

  6. #5
    morganw's Avatar
    Join Date
    Apr 2009
    Location
    Cambridge
    Posts
    679
    Thank Post
    45
    Thanked 92 Times in 87 Posts
    Rep Power
    28
    The simplest way is to use stunnel on a machine that has permission to send outbound email.

    I think the settings would be:

    accept = 127.0.0.1:25
    connect = smtp.gmail.com:465

    If you google stunnel and gmail you'll find a lot of examples.

  7. #6
    pshuttle's Avatar
    Join Date
    Jun 2005
    Location
    Work: Chorley Home: Preston
    Posts
    281
    Thank Post
    5
    Thanked 27 Times in 20 Posts
    Rep Power
    21
    Thanks for the replies guys. I will look into this when I get the chance.

    Cheers,

    Pete

SHARE:
+ Post New Thread

Similar Threads

  1. Linux - mailx and postfix
    By Edu-IT in forum *nix
    Replies: 12
    Last Post: 9th January 2011, 12:14 AM
  2. Replies: 0
    Last Post: 22nd July 2010, 02:08 PM
  3. postfix and exchange
    By DanW in forum *nix
    Replies: 4
    Last Post: 8th October 2009, 04:29 PM
  4. Replies: 5
    Last Post: 13th March 2008, 10:57 AM
  5. Replies: 6
    Last Post: 16th February 2008, 03:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •