Ad Widget

Collapse

SMTP scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Xyue
    Member
    • Jan 2016
    • 93

    #1

    SMTP scripts

    Hi,

    I tried to use SSMTP on my server to send out the email when alerts is trigger. I have installed and tried but it is not working. When i check the mail log, it shows me "timed out while receiving the initial server greeting". Any idea what is causing this error ?

    TQVM.
    Last edited by Xyue; 25-02-2016, 10:30.
  • Xyue
    Member
    • Jan 2016
    • 93

    #2
    Hi Guys,

    Please help.

    I am trying to set the zabbix to send email to certain user when the alert is triggered. I have search in the forum and tried various way(SSMTP,sendmail,postfix) but all was failed. I have follow the instruction from the link (https://www.zabbix.com/forum/showthr...highlight=smtp) which advise to install sendmail.

    When i triggered the alert from my switches, i saw the "actions" was OK. But I was not receive any alert email. I don't know which steps i am wrong.

    Can anyone guide me on setting up SMTP ?

    Really appreciate your help on this. Thank you very much in advance
    Xyue

    Comment

    • Firm
      Senior Member
      • Dec 2009
      • 342

      #3
      Check "Action log" page if sending alert was successful.

      Comment

      • Xyue
        Member
        • Jan 2016
        • 93

        #4
        Hi,

        Nope, it failes and i was received "timeout while receiving initial server greeting". I was suspecting it was the firewall which block it. Is that possible ?

        Thanks for your reply.

        Comment

        • Firm
          Senior Member
          • Dec 2009
          • 342

          #5
          Try to simulate zabbix behavior: connect to ssmtp server manually with telnet.

          Comment

          • Xyue
            Member
            • Jan 2016
            • 93

            #6
            Hi,

            Currently I'm using Postfix and below is the telnet result.
            root@localhost ~]# telnet smtp.gmail.com 25
            Trying 64.233.188.108...
            Connected to smtp.gmail.com.
            Escape character is '^]'.

            It was able to connected but not able to receive 220 message.

            Below is the details of my iptables:
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 10051 -j ACCEPT
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 587 -j ACCEPT
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
            -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
            -A INPUT -p icmp -j ACCEPT
            -A INPUT -i lo -j ACCEPT
            -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
            -A INPUT -j REJECT --reject-with icmp-host-prohibited
            -A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
            -A FORWARD -j REJECT --reject-with icmp-host-prohibited
            COMMIT

            Details of main.cf
            alias_database = hash:/etc/aliases
            alias_maps = hash:/etc/aliases
            command_directory = /usr/sbin
            config_directory = /etc/postfix
            daemon_directory = /usr/libexec/postfix
            data_directory = /var/lib/postfix
            debug_peer_level = 2
            html_directory = no
            inet_interfaces = localhost
            inet_protocols = ipv4
            mail_owner = postfix
            mailq_path = /usr/bin/mailq.postfix
            manpage_directory = /usr/share/man
            mydestination = $myhostname, localhost.$mydomain, localhost
            newaliases_path = /usr/bin/newaliases.postfix
            queue_directory = /var/spool/postfix
            readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
            relayhost = smtp.gmail.com:587
            sample_directory = /usr/share/doc/postfix-2.6.6/samples
            sendmail_path = /usr/sbin/sendmail.postfix
            setgid_group = postdrop
            smtp_sasl_auth_enable = yes
            smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
            smtp_sasl_security_options = noanonymous
            smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
            smtp_tls_mandatory_ciphers = high
            smtp_tls_mandatory_protocols = TLSv1
            smtp_tls_secure_cert_match = nexthop
            smtp_tls_security_level = secure
            unknown_local_recipient_reject_code = 550

            Maillog
            Feb 29 09:11:53 localhost postfix/qmgr[4062]: F2ACAF16E: from=<[email protected]>, size=466, nrcpt=1 (queue active)
            Feb 29 09:16:30 localhost postfix/smtp[4064]: 36F18F184: conversation with smtp.gmail.com[64.233.188.108] timed out while receiving the initial server greeting

            Any idea on this ?
            Thank you very much.

            Comment

            • Firm
              Senior Member
              • Dec 2009
              • 342

              #7
              Try (I know, [] are for pure IPs)
              Code:
              relayhost = [smtp.gmail.com]:587

              Comment

              • Xyue
                Member
                • Jan 2016
                • 93

                #8
                Hi,

                Tried your suggestion but not working. Still having same error message. Will google for other method.

                Anyway, thank you very much.

                Comment

                Working...