Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-989

does not sent ALERT mail with smtp due to problem with images

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • None
    • Alerting
    • None
    • unbunt 12.04 and observium svn 5775

    Description

      alert mail with embedded images are not sent if you configure observium to send them trough an external smtp server.
      email without images are sent correctly.
      looking with tcpdump on the mail server it looks like observium does not close the mail with \n.\n so the mta timeout the connection without sending the mail (without the image attach it does send \n.\n and RECOVER mail arrive correctly);

      it looks like email are cut at about 20K and that's why it does not close corretly the smtp session.

      Attachments

        Activity

          [OBS-989] does not sent ALERT mail with smtp due to problem with images

          Because the problem could not be reproduced, including the large size graphs (>50K) and over smtp server provided by the user. Probably a problem in the user os environment.

          landy Mike Stupalov added a comment - Because the problem could not be reproduced, including the large size graphs (>50K) and over smtp server provided by the user. Probably a problem in the user os environment.

          I did some more test and I can confim that:
          1) email smaller than 20K works correctly
          2) email larger than 20K does not works (even if I use an smtp postfix on localhost)
          3) the problem is on th smtp session between the php and the configured smtp server
          4) if I use "sendmail" instead of "smtp" as transport protocol it works correctly even with mail bigger than 20K

          emilio@ngi.it emilio brambilla added a comment - I did some more test and I can confim that: 1) email smaller than 20K works correctly 2) email larger than 20K does not works (even if I use an smtp postfix on localhost) 3) the problem is on th smtp session between the php and the configured smtp server 4) if I use "sendmail" instead of "smtp" as transport protocol it works correctly even with mail bigger than 20K

          No, mime parts already wrapped by 76 chars as in pear Mail:Mime:
          // RFC2822 recommends 78 characters limit, use 76 from RFC2047

          and graphs included not as mime part, but as data-uri.

          landy Mike Stupalov added a comment - No, mime parts already wrapped by 76 chars as in pear Mail:Mime: // RFC2822 recommends 78 characters limit, use 76 from RFC2047 and graphs included not as mime part, but as data-uri.

          the problem may be int the php not wordwrapping to 70 char per line mime attach?

          emilio@ngi.it emilio brambilla added a comment - the problem may be int the php not wordwrapping to 70 char per line mime attach?

          ya, Emilio, I'm got your email, thanks.

          landy Mike Stupalov added a comment - ya, Emilio, I'm got your email, thanks.

          hello mike, I did sent you the debug to your email address (our company policy does not allow me to publish on the public internet details on our network layout without an approval from managemenet);

          Test mail works perfectly and also work perfectly all the email smaller than 20K... the problem is with mail larger than 20K (I can receive alert mail with graph embedded, if the size is smaller than 20K and I receive all the RECOVER mail without graph attached, as they are always smaller than 20K)

          emilio@ngi.it emilio brambilla added a comment - hello mike, I did sent you the debug to your email address (our company policy does not allow me to publish on the public internet details on our network layout without an approval from managemenet); Test mail works perfectly and also work perfectly all the email smaller than 20K... the problem is with mail larger than 20K (I can receive alert mail with graph embedded, if the size is smaller than 20K and I receive all the RECOVER mail without graph attached, as they are always smaller than 20K)

          please show me debug out from script:
          ./test_mail.ph -d -h <some host>

          landy Mike Stupalov added a comment - please show me debug out from script: ./test_mail.ph -d -h <some host>

          no, it's not fixed... the smtp transaction when there is a graph attached end with this:

          KMwv7I0MD481GA3Ys28v5qSn//A/b9zxia/r5wvk5ZXrBULBjeULFxe5yqdSq3GkrdVYVlzGUMT=
          5q0kex2h1WjQe2AQUIT

          while it should end with
          .
          QUIT

          (actually it's missing also the end of the mail, if I correctly read the php generating the mail)

          emilio@ngi.it emilio brambilla added a comment - no, it's not fixed... the smtp transaction when there is a graph attached end with this: KMwv7I0MD481GA3Ys28v5qSn//A/b9zxia/r5wvk5ZXrBULBjeULFxe5yqdSq3GkrdVYVlzGUMT= 5q0kex2h1WjQe2AQUIT while it should end with . QUIT (actually it's missing also the end of the mail, if I correctly read the php generating the mail)

          Please try latest commit, should be fixed

          landy Mike Stupalov added a comment - Please try latest commit, should be fixed
          emilio@ngi.it emilio brambilla added a comment - - edited

          this is the configuration:
          $config['email_backend'] = 'smtp';
          $config['email_from'] = 'observium@XXXXXX.it';
          $config['email_smtp_host'] = 'smtp-int.dc.XXXXXXX.it'; // Outgoing SMTP server name.
          $config['email_smtp_port'] = 25; // The port to connect.
          $config['email_smtp_timeout'] = 10; // SMTP connection timeout in seconds.

          and I found the problem in the ALERT email (not the RECOVER email, which does not have the image) sent by alert checker with conditions like "ifInOctets_perc gt 90 and ifOutOctets_perc gt 90"
          if you need them I send you (in private) the pcap captured on the smtp server

          emilio@ngi.it emilio brambilla added a comment - - edited this is the configuration: $config ['email_backend'] = 'smtp'; $config ['email_from'] = 'observium@XXXXXX.it'; $config ['email_smtp_host'] = 'smtp-int.dc.XXXXXXX.it'; // Outgoing SMTP server name. $config ['email_smtp_port'] = 25; // The port to connect. $config ['email_smtp_timeout'] = 10; // SMTP connection timeout in seconds. and I found the problem in the ALERT email (not the RECOVER email, which does not have the image) sent by alert checker with conditions like "ifInOctets_perc gt 90 and ifOutOctets_perc gt 90" if you need them I send you (in private) the pcap captured on the smtp server

          People

            landy Mike Stupalov
            emilio@ngi.it emilio brambilla
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: