Ad Widget

Collapse

Can't read notification email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gao
    Junior Member
    • Nov 2015
    • 3

    #1

    Can't read notification email

    I just installed Zabbix 2.4 on my Centos6 server. Since I already have a setup on my server using sSMTP to send email vis Gmail, so I made script followed the instruction here:
    How to set up a Zabbix server to send mail reports to a Gmail address by using the SSMTP, without the need to install any MTA daemon, such as Postfix, Exim, etc


    Now the alert email send to the recipient. But the email received has a blank body with an attachment. And in my Thunderbird I cant open up the attachment. Viewing the source I see the attachment is not plain text.

    So I might missing something here. Please help. Thanks.
    Last edited by gao; 21-11-2015, 02:45.
  • gao
    Junior Member
    • Nov 2015
    • 3

    #2
    am i the only one has this issue?

    Comment

    • gao
      Junior Member
      • Nov 2015
      • 3

      #3
      Finally I found out the solution.

      This is because mailx on CentOS6 having this issue:
      When sending an e-mail from a command line or a script using mailx, the text intended to be a body is received as an attachment. This is often visible as a .bin attachment in Microsoft Outlook. Sometimes when the same command or script is used on RHEL 5, the e-mail is displayed as expected in the e-mail client (MUA).


      Mailx expects input text to be in Unix format, with lines separated by newline (^J, \n) characters only.
      Non-Unix text files that use carriage return (^M, \r) characters in addition will be treated as binary data; to send such files as text, strip these characters e. g. by

      tr -d ’\015’ <input | mailx . . .
      Now the question is why zabbix's output using non-unix format???

      Comment

      • louis-m
        Member
        • Nov 2013
        • 70

        #4
        the solution is to install bsd-mailx instead and then force it's use:

        To install:
        sudo yum install bsd-mailx

        To make it use bsd-mailx:
        sudo alternatives --set mail /usr/bin/bsd-mailx

        To check what it's using:
        sudo alternatives --display mail

        You may also have to alter the script you are using in zabbix to send the mail.

        Comment

        Working...