OSSEC电子邮件通知无法发送电子邮件



我在尝试获取ossec功能时出错:电子邮件通知。我用我的Gmail帐户处理这个案子。我试过这个教程,但我没有收到任何电子邮件。我在里面得到了带有警告Mail not accepted by server的错误日志。它位于/var/ossec/logs/ossec.log,您可以看到下面的日志。

2017/10/06 20:05:18 os_sendmail(1764): WARN: Mail from not accepted by server
2017/10/06 20:05:18 ossec-maild(1223): ERROR: Error Sending email to 74.125.200$
2017/10/06 20:05:58 ossec-syscheckd: INFO: Starting syscheck scan (forwarding d$
2017/10/06 20:05:58 ossec-syscheckd: INFO: Starting syscheck database (pre-scan$
2017/10/06 20:05:58 ossec-syscheckd: INFO: Initializing real time file monitori$

以下是我在位于/var/ossec/etc/ossec.confossec.conf中的电子邮件配置

<global>
<email_notification>yes</email_notification>
<email_to>myrealemailaccount@gmail.com</email_to>
<smtp_server>smtp.gmail.com.</smtp_server>
<email_from>ossecm@gantz-X450CC</email_from>
<email_maxperhour>20</email_maxperhour>
<email_from>myrealemailaccount@gmail.com</email_from>
</global>

我已经填写了我的<smtp_server>smtp.gmail.com。什么都没有改变。它仍然在我的ossec.log上收到错误消息

我该怎么解决这个问题?我在Ubuntu Server: 16.04上安装此应用程序

我终于得到了解决方案。对于我的案例,我使用Postfix将我的帐户gmail连接到本地主机。如果你有自己的专用电子邮件服务器,就像你的服务器一样,那就太好了,而不是使用gmail。

  1. 确保您已经更新了您的linux。

    apt-get update
    
  2. 通过终端安装后缀,如果你不能安装后缀,请尝试在/etc/sources.list中更改你的存储库位置,然后使用apt-get update更新你的linux,直到你可以运行以下命令

    sudo apt-get install postfix
    

    sudo apt-get install mailutils
    

    将安装Postfix以及。之后,您将获得选项,选择互联网站点

  3. 配置Postfix

    /etc/postfix/main.cf搜索main.cf,使用nano编辑文件。在文件末尾添加此语法。

    relayhost = [smtp.gmail.com]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    smtp_tls_CAfile = /etc/postfix/cacert.pem
    smtp_use_tls = yes
    

    /etc/postfix/sasl_passwd处编辑sasl_passwd,编辑文件并在sasl_passwd文件中添加以下行:

    [smtp.gmail.com]:587    your_email_here:your_password here
    

    你应该把你想作为ossec电子邮件通知发送者的电子邮件放在"sasl_pawd"上。不是作为接收器。

  4. 编辑您的/var/ossec/etc/ossec.conf,并将SMTP更改为巡回本地ip,如127.0.0.1localhost

    <global>
    <email_notification>yes</email_notification>
    <email_to>your email that want to be send to</email_to>
    <smtp_server>localhost</smtp_server>
    <email_from>127.0.0.1</email_from> #if 127.0.0.1 didnt work ,try same email address which you put in your sasl passwd 
    <email_maxperhour>100</email_maxperhour>
    </global>
    

更新日期:2018年5月22日

有关进一步的配置,请阅读本教程和本

相关内容

最新更新