How to configure the Logstash IMAP plugin to receive email from an SMTP server

I have an SMTP server (using a SMTP virtual server on a Windows 2012 server) and a CentOS machine. On a CentOS machine, I have installed ELK. Now I want to configure Logstash to receive email from SMTP server using the IMAP plugin.

Please help me.

Thank you very much.

+3


source to share


1 answer


Below is the logstash config below. Please change the settings and output the plugins according to your needs.

logstash.conf

input{
    imap{
        host => "SERVER_IP"
        user => "USERNAME"
        password => "************"
        port => PORT_NUMBER
        secure => true/false
        check_interval => INTERVAL_SECONDS
    }
}
output{
    stdout{
        codec => "json"
    }
}

      



Then start logstash using the following command

bin/logstash -f "logstash.conf"

      

This should check email for every configured check_interval duration in seconds and fire an event.

+2


source







All Articles