0
var notifier = require('mail-notifier');
var imap = {
username: "siddharthsogani1",
password: "MYGMAILPASSWORD",
host: "imap.gmail.com",
port: 993, // imap port
secure: true // use secure connection
};
notifier(imap).on('mail',function(mail){console.log(mail);}).start();
我试图听我的Gmail收件箱中的新邮件事件。我正在使用node mail-notifier2模块来执行此操作(如上面的代码片段所示)。但是,我无法验证。当使用节点收听新邮件事件时,imap证书不起作用邮件 - notifier2模块
当我使用上面的代码时,我得到错误:'uncaughtException:超时使用服务器进行身份验证',当我传递tls:true在imap对象时,我得到未捕获的异常:'uncaughtException:证书中的自签名证书链'。请让我知道我错了,我该怎么做才能做到这一点?
由于您正在使用NodeJS,因此请尝试[NodeJS Quickstart for Gmail](https://developers.google.com/gmail/api/quickstart/) nodejs)并遵循OAuth流程。关于错误,请查看此[github论坛](https://github.com/request/request/issues/2061),其中建议的备选方案是a)在您的负载平衡器 处进行SSL终止b)使用免费证书。 – noogui
@noogui非常感谢! github论坛帮助:) –