流星 发送电子邮件到内网电子邮件



我正在开发一个 Meteor 应用程序来处理请求,该应用程序已完成,但我需要在每次创建或更新请求时发送一些带有默认文本的电子邮件。

我遇到的问题是,我在内部网上,我们的邮件服务器正在使用标准 25 端口。

我可以 ping 邮件服务器并检查 :25 端口是否打开。本地主机端口 25 处于侦听状态。

使用的是 meteor 的默认电子邮件包,我之前在我们的内部网之外使用过很多次并且一直工作正常。

我的服务器代码如下:

#in the meteor startup i put the env MAIL_URL
process.env.MAIL_URL = 'smtp://varajao.rjr:password@ipaddress:25';
#in the methods i put the sendMail Func
sendEmail: function(to, from, subject, text) {
  console.log('para: '+ to + 'de: ' + from);
  console.log('assunto ' + subject + 'texto: ' + text);
  check([to, from, subject, text], [String]);
  this.unblock();
  Email.send({to, from, subject, text});
}

我在服务器上得到以下内容,请检查第一行和末尾的评论。

Exception while invoking method 'sendEmail' Error: getaddrinfo EAI_AGAIN varajao.rjr:587 **----->somehow this is my username with :587 port**
I20170511-13:50:57.171(1)?     at Object.Future.wait (/home/administrador/.meteor/packages/meteor-tool/.1.4.4_2.8rbyl1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:449:15)
I20170511-13:50:57.171(1)?     at Mail._syncSendMail (packages/meteor.js:213:24)
I20170511-13:50:57.172(1)?     at smtpSend (packages/email.js:110:13)
I20170511-13:50:57.172(1)?     at new Email.send (packages/email.js:168:5)
I20170511-13:50:57.173(1)?     at Object.Email.send (packages/meteortoys_email.js:28:25)
I20170511-13:50:57.174(1)?     at [object Object].Meteor.methods.sendEmail (server/main.js:375:13)
I20170511-13:50:57.175(1)?     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1737:12)
I20170511-13:50:57.175(1)?     at packages/ddp-server/livedata_server.js:719:19
I20170511-13:50:57.176(1)?     at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
I20170511-13:50:57.177(1)?     at packages/ddp-server/livedata_server.js:717:40
I20170511-13:50:57.178(1)?     - - - - -
I20170511-13:50:57.179(1)?   atObject.exports._errnoException(util.js:907:11)
I20170511-13:50:57.179(1)?     at errnoException (dns.js:32:15)
I20170511-13:50:57.180(1)?     at GetAddrInfoReqWrap.onlookup [as oncomplete](dns.js:78:26)

邮件服务器在内网内部,我们可以直接通过内联网访问它。

你们能帮我一把吗?

谢谢是前进

请确保您的交换配置正确,因为如果不是,您将收到像我在这个问题中遇到的错误,对我来说,我必须允许电子邮件中继到应用程序服务器的 IP。

希望这有帮助

最新更新