+ Post New Thread
Results 1 to 13 of 13
*nix Thread, Linux - mailx and postfix in Technical; **Linux newbie** Having a mess about with Nagios and it says to get notifications working I need to: sudo apt-get ...
  1. #1

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180

    Linux - mailx and postfix

    **Linux newbie**

    Having a mess about with Nagios and it says to get notifications working I need to:

    sudo apt-get install mailx

    sudo apt-get install postfix

    Problem is I'm not entirely sure which package from mailx to choose. I've chosen bsd-mailx but on Ubuntu it comes up with a blue screen asking me to choose a Postfix configuration option but I cannot work out how to proceed past this.

    Anyone able to advise on how to install mailx and postfix on Ubuntu desktop?

  2. #2


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,688
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    Sounds like it's trying to configure postfix for you.

    Do you need to send mail via a smarthost? (ie, at home I send my mail via smtp.ntlworld.com but at work I'd send it via our corporate mail gateway). If so set that or you can use Internet Site by itself if your box can mail directly.

    All it's doing is writing the main config file for postfix.

  3. #3

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    At risk of sounding an idiot, I'm not sure! Basically I'm just trying to get Nagios to send email alerts. I assume it uses itself to send mail as:

    "You'll have to edit the Nagios email notification commands found in /usr/local/nagios/etc/objects/commands.cfg and change any '/bin/mail' references to '/usr/bin/mail'. Once you do that you'll need to restart Nagios to make the configuration changes live."

    I also cannot seem to work out how to tell it what configuration option to use... it's just a blue screen with <OK> written at the bottom.

  4. #4


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,688
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    Should be a list of configurations?

    Looking like http://library.linode.com/email/post...ver-type-2.png

    The mail configuration isn't really relevant to nagios specifically it's how you want the mail originating from your box to be handled, ie, do you want your box itself contacting the recipient mail server (eg hotmail.com) to deliver messages or do you want to 'relay' all of your messages through your ISP mailserver or such like? - If you're doing this in a school I would imagine your LEA would provide you with a SMTP/Relay as they tend to block outbound connections to SMTP servers not on their list.

  5. #5

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    This is away from school, just something I am playing about with. I have Ubuntu as a VM. I'd prefer to have the box send the mail itself.

  6. #6


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,688
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    Pick "Internet Site" from the list, assuming you have a list.

    Screenshot what you have if not.

  7. #7

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    Ubuntu.png

    Cannot seem to select any?

  8. #8


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,688
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    Try hitting ok? (use tab to get to it)

  9. #9

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    Ah. Moving on, nothing to see here. ;-) (Thank you!! Didn't realise you had to use tab)

    Is there a quick way to test that it's working?

  10. #10


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,688
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    From the command line do:

    mail you@hotmail.com <enter>
    it will ask for a subject, type one in <enter>
    you can then freely type away until your heart is content, <press enter>
    put a single . (full stop) on a line by itself <press enter>

    And it will send a mail.

    See if you get the mail, check your spam bin incase your ISP is dynamic/marked as spam.

    If not, have a nose in /var/log/mail.(could be info, warn, log, etc).

  11. #11

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    Jan 8 22:23:01 ubuntu postfix/master[2906]: daemon started -- version 2.7.1, configuration /etc/postfix
    Jan 8 22:45:53 ubuntu postfix/pickup[2908]: D1E10C238B: uid=1000 from=<ubuntuvm>
    Jan 8 22:45:53 ubuntu postfix/cleanup[3375]: D1E10C238B: message-id=<20110108224553.D1E10C238B@ubuntu>
    Jan 8 22:45:53 ubuntu postfix/qmgr[2909]: D1E10C238B: from=<ubuntuvm@ubuntu>, size=427, nrcpt=1 (queue active)
    Jan 8 22:46:15 ubuntu postfix/smtp[3378]: D1E10C238B: host aspmx.l.google.com[209.85.227.27] refused to talk to me: 421 Cannot connect to SMTP server 209.85.227.27 (209.85.227.27:587), connect error 10060
    Jan 8 22:46:36 ubuntu postfix/smtp[3378]: D1E10C238B: host alt1.aspmx.l.google.com[74.125.43.27] refused to talk to me: 421 Cannot connect to SMTP server 74.125.43.27 (74.125.43.27:587), connect error 10060
    Jan 8 22:46:57 ubuntu postfix/smtp[3378]: D1E10C238B: host alt2.aspmx.l.google.com[74.125.127.27] refused to talk to me: 421 Cannot connect to SMTP server 74.125.127.27 (74.125.127.27:587), connect error 10060

    I suspect it's because I am not using a proper address? (ubuntuvm@ubuntu)

  12. #12


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,688
    Thank Post
    352
    Thanked 794 Times in 714 Posts
    Rep Power
    346
    I can't talk to those IP's on port 587 either, only port 25.

    Try an email address that isn't google to see if it's only google that doesn't work for you or everything.

    Also, try telneting to 74.125.127.27 on port 25 from your ubuntu to see if you get a response (to confirm outbound SMTP connections work).

    Not having a valid mail address is a bad thing too but I can't imagine it's causing this. (fix it by editing /etc/postfix/main.cf and then /etc/init.d/postfix restart)

    (I'm going to bed now, will pick this up in the morn if nobody else does.)

  13. #13

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,121
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    Telnet didn't work.

    I tried a different address and got it to send.

    Odd?
    Last edited by Edu-IT; 8th January 2011 at 11:24 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 22nd July 2010, 02:08 PM
  2. Replies: 1
    Last Post: 26th June 2010, 09:12 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, 09:57 AM
  5. Replies: 6
    Last Post: 16th February 2008, 02:28 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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