Coder Social home page Coder Social logo

haraka-plugin-wildduck's Introduction

Nodemailer

Nodemailer

Send emails from Node.js โ€“ easy as cake! ๐Ÿฐโœ‰๏ธ

NPM

See nodemailer.com for documentation and terms.

Tip

Check out EmailEngine โ€“ a self-hosted email gateway that allows making REST requests against IMAP and SMTP servers. EmailEngine also sends webhooks whenever something changes on the registered accounts.

Using the email accounts registered with EmailEngine, you can receive and send emails. EmailEngine supports OAuth2, delayed sends, opens and clicks tracking, bounce detection, etc. All on top of regular email accounts without an external MTA service.

Having an issue?

First review the docs

Documentation for Nodemailer can be found at nodemailer.com.

Nodemailer throws a SyntaxError for "..."

You are using an older Node.js version than v6.0. Upgrade Node.js to get support for the spread operator. Nodemailer supports all Node.js versions starting from [email protected].

I'm having issues with Gmail

Gmail either works well, or it does not work at all. It is probably easier to switch to an alternative service instead of fixing issues with Gmail. If Gmail does not work for you, then don't use it. Read more about it here.

I get ETIMEDOUT errors

Check your firewall settings. Timeout usually occurs when you try to open a connection to a firewalled port either on the server or on your machine. Some ISPs also block email ports to prevent spamming.

Nodemailer works on one machine but not in another

It's either a firewall issue, or your SMTP server blocks authentication attempts from some servers.

I get TLS errors

  • If you are running the code on your machine, check your antivirus settings. Antiviruses often mess around with email ports usage. Node.js might not recognize the MITM cert your antivirus is using.
  • Latest Node versions allow only TLS versions 1.2 and higher. Some servers might still use TLS 1.1 or lower. Check Node.js docs on how to get correct TLS support for your app. You can change this with tls.minVersion option
  • You might have the wrong value for the secure option. This should be set to true only for port 465. For every other port, it should be false. Setting it to false does not mean that Nodemailer would not use TLS. Nodemailer would still try to upgrade the connection to use TLS if the server supports it.
  • Older Node versions do not fully support the certificate chain of the newest Let's Encrypt certificates. Either set tls.rejectUnauthorized to false to skip chain verification or upgrade your Node version
let configOptions = {
    host: "smtp.example.com",
    port: 587,
    tls: {
        rejectUnauthorized: true,
        minVersion: "TLSv1.2"
    }
}

I have issues with DNS / hosts file

Node.js uses c-ares to resolve domain names, not the DNS library provided by the system, so if you have some custom DNS routing set up, it might be ignored. Nodemailer runs dns.resolve4() and dns.resolve6() to resolve hostname into an IP address. If both calls fail, then Nodemailer will fall back to dns.lookup(). If this does not work for you, you can hard code the IP address into the configuration like shown below. In that case, Nodemailer would not perform any DNS lookups.

let configOptions = {
    host: "1.2.3.4",
    port: 465,
    secure: true,
    tls: {
        // must provide server name, otherwise TLS certificate check will fail
        servername: "example.com"
    }
}

I have an issue with TypeScript types

Nodemailer has official support for Node.js only. For anything related to TypeScript, you need to directly contact the authors of the type definitions.

I have a different problem

If you are having issues with Nodemailer, then the best way to find help would be Stack Overflow or revisit the docs.

License

Nodemailer is licensed under the MIT No Attribution license


The Nodemailer logo was designed by Sven Kristjansen.

haraka-plugin-wildduck's People

Contributors

andris9 avatar dependabot[bot] avatar github-actions[bot] avatar louis-lau avatar taavie avatar thebongy avatar vitalvas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

haraka-plugin-wildduck's Issues

How to enable "logdebug" to be written to syslog

Hello. I am trying to figure out why wildduck is rejecting email. I believe it's related to the haraka-plugin-wildduck and would like to enable debug messages, such as this one, to be logged to file.

Here are some relevant logs which make me suspect that the plugin is not finding the recipient email in case you are interested...

May 18 20:36:48 email-server haraka[1626]: [NOTICE] [7A38DBAF-7414-4151-B8EA-1393939186AD.1] [core] sender <[sender_email]@gmail.com> code=CONT msg=""
May 18 20:36:48 email-server haraka[1626]: [INFO] [7A38DBAF-7414-4151-B8EA-1393939186AD.1] [core]  hook=rcpt plugin=wildduck function=hook_rcpt params=<[recipient_email]> retval=DENYSOFT msg="[object Object]"
May 18 20:36:48 email-server haraka[1626]: [NOTICE] [7A38DBAF-7414-4151-B8EA-1393939186AD.1] [core] recipient <[recipient_email]> code=DENYSOFT msg="[object Object]" sender=[sender_email]@gmail.com
May 18 20:36:48 email-server haraka[1626]: [NOTICE] [7A38DBAF-7414-4151-B8EA-1393939186AD.1] [core] disconnect ip=209.85.218.50 rdns=mail-oi0-f50.google.com helo=mail-oi0-f50.google.com relay=N early=N esmtp=Y tls=Y pipe=Y errors=0 txns=1 rcpts=0/1/0 msgs=0/0/0 bytes=0 lr="554
No valid recipients" time=0.419

Cannot read property 'rcpt_to' of null

Hello,

I detect some issue with using fcrdns plugin.

[NOTICE] [DEF70815-F053-40E1-BDB2-524DC5DF46E6] [core] connect ip=192.168.176.7 port=56628 local_ip=:: local_port=25
[INFO] [DEF70815-F053-40E1-BDB2-524DC5DF46E6] [core] HAProxy proto=TCP4 src_ip=x.x.x.x:61183 dst_ip=192.168.176.7:25
[INFO] [DEF70815-F053-40E1-BDB2-524DC5DF46E6] [core]  hook=lookup_rdns plugin=fcrdns function=do_dns_lookups params="" retval=DENY msg="client x.x.x.x.provider.net [x.x.x.x] rejected; generic rDNS, please use your ISPs SMTP relay"
[CRIT] [DEF70815-F053-40E1-BDB2-524DC5DF46E6] [core] Plugin wildduck failed: TypeError: Cannot read property 'rcpt_to' of null
    at Plugin.exports.hook_deny (/app/node_modules/haraka-plugin-wildduck/index.js:191:21)
    at Object.plugins.run_next_hook (/app/plugins.js:535:28)
    at Object.plugins.run_hooks (/app/plugins.js:449:13)
    at callback (/app/plugins.js:505:21)
    at do_next (/app/node_modules/haraka-plugin-fcrdns/index.js:81:16)
    at Plugin.exports.check_fcrdns (/app/node_modules/haraka-plugin-fcrdns/index.js:219:20)
    at /app/node_modules/haraka-plugin-fcrdns/index.js:138:31
    at /app/node_modules/haraka-net-utils/index.js:328:7
    at /app/node_modules/haraka-net-utils/node_modules/async/dist/async.js:3888:9
    at /app/node_modules/haraka-net-utils/node_modules/async/dist/async.js:473:16
[INFO] [DEF70815-F053-40E1-BDB2-524DC5DF46E6] [core] client [192.168.176.7] half closed connection
[NOTICE] [DEF70815-F053-40E1-BDB2-524DC5DF46E6] [core] disconnect ip=x.x.x.x rdns="" helo="" relay=N early=N esmtp=N tls=N pipe=N errors=0 txns=0 rcpts=0/0/0 msgs=0/0/0 bytes=0 lr="554 client x.x.x.x.provider.net [x.x.x.x] rejected; generic rDNS, please use your ISPs SMTP relay" time=0.287

For reproduce - need use curl command:

curl -vv smtp://mx.example.com

Mails are not queued

I have configured redis and mongodb on this plugin's config, wildduck and zone-mta equally. However, when I connect to haraka using thunderbird and send a message, I can see in the log the final line is 'queue code=OK msg="Message processed (D74D82B2-A9AB-401A-87AB-6293CF250DDA.1)"', however, it never arrives in the mongodb (and thus never at the recipient). When I try it using wildduck's web interface it works flawlessly though.

Also (I am not sure if it is related) incoming mails are also not forwarded to wildduck for storage.

Versions:
Haraka: 2.8.25
wildduck: 1.30.3
haraka-plugin-wildduck: 1.29.7
zone-mta: 1.7.0

Quota exceeded results in lost email without warnings

I recently had mail lost due to this plugin silently ignoring an exceeded quota.

It appears there is logic to forward mail that is skipped, however configuring this properly should probably be emphasized in the documentation, as black-holed email is a rather major failure of this whole system.

Haraka crashin. TypeError Cannot read property 'uuid' of null

Can you please guide what might be causing this?

2018-11-11T22:22:05.758Z [CRIT] [-] [core] TypeError: Cannot read property 'uuid' of null
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at hookDone (/etc/haraka/node_modules/haraka-plugin-wildduck/index.js:234:93)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at plugin.db.userHandler.resolveAddress (/etc/haraka/node_modules/haraka-plugin-wildduck/index.js:553:24)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at users.collection.findOne (/etc/haraka/node_modules/wildduck/lib/user-handler.js:164:48)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at result (/etc/haraka/node_modules/mongodb/lib/utils.js:414:17)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at session.endSession (/etc/haraka/node_modules/mongodb/lib/utils.js:401:11)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at ClientSession.endSession (/etc/haraka/node_modules/mongodb-core/lib/sessions.js:129:41)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at executeCallback (/etc/haraka/node_modules/mongodb/lib/utils.js:397:17)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at handleCallback (/etc/haraka/node_modules/mongodb/lib/utils.js:128:55)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at cursor.next (/etc/haraka/node_modules/mongodb/lib/operations/collection_ops.js:570:5)
2018-11-11T22:22:05.758Z [CRIT] [-] [core]     at result (/etc/haraka/node_modules/mongodb/lib/utils.js:414:17)
2018-11-11T22:22:05.759Z [NOTICE] [-] [core] Shutting down

How to support group functionality

I've a requirement of group email address. People can send to the group address and the email will be delivered to people who are in that group. How to achieve this functionality with harka and wildduck?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.