mailin icon indicating copy to clipboard operation
mailin copied to clipboard

Cannot receive email from gmail

Open aashidham opened this issue 10 years ago • 10 comments

I can telnet to my server and successfully communicate with my mailin instance. I can also see console printouts from these communications on the server side. However, when I send an email from gmail or some other professional client, the mailin server is silent. It doesn't report errors or success. (I have tried multiple log levels, but to no avail.) I know this is not a problem with my server, since I created a simple SMTP server in Python and gmail can send messages to it. The only problem is likely some setup problem with mailin. Has anybody else encountered this problem?

I am using the no-webhook option, and embedding mailin in a node application, as set up in the bottom part of the README. Thanks in advance.

aashidham avatar Aug 01 '15 11:08 aashidham

@aashidham what is your node and mailin versions please?

Flolagale avatar Aug 01 '15 20:08 Flolagale

node 0.12.7 mailin 3.0.1

On Sat, Aug 1, 2015 at 1:00 PM, Florent Galland [email protected] wrote:

@aashidham https://github.com/aashidham what is your node and mailin versions please?

— Reply to this email directly or view it on GitHub https://github.com/Flolagale/mailin/issues/47#issuecomment-126949014.

aashidham avatar Aug 01 '15 20:08 aashidham

Ping?

aashidham avatar Aug 30 '15 08:08 aashidham

Same issue, set disableDNSvalidation, disableDkim, disableSpf to true. Can connect to server, but can't send emails from gmail or any other email client.

The server returns: 550 450 4.1.8 test@domain: Sender address rejected: Domain not found. Docs say disabling DNS validation should be the solution, but I've already done that.

If I just run mailin --webhook, everything works fine. Integrating mailin into my node app is what's causing this.

ghost avatar Sep 03 '15 12:09 ghost

Ok. We have to double check that there is not a similar issue in https://github.com/andris9/smtp-server. I must admit I have a lot to do with my day to day work right now that's why everything is lagging here.

Flolagale avatar Sep 03 '15 13:09 Flolagale

Thanks for the reply. I'll take a look at the issues in smtp-server. It's funny that everything seems ok when running mailin by itself, but not when integrated in a node app. Is there anything different between the two options?

Good luck with work

ghost avatar Sep 03 '15 14:09 ghost

There might have very tiny differences in the way we merge the smtp-server options with the options in the mailin constructor. That might come from there!

Flolagale avatar Sep 03 '15 14:09 Flolagale

Ok, found it. There's some inconsistency with the disableDNSValidation flag. In lib/mailin.js on line 39 it's called disableDnsValidation, in the docs it's part of smtpOptions: { disableDNSValidation }, and in cli.js, on line 59, it's disableDNSValidation -- notice capitalization.

What seems to work is:

mailin.start({
    disableDNSValidation: true // NOT as part of smtpOptions
})

ghost avatar Sep 03 '15 14:09 ghost

Well done! The correct one should be disableDNSValidation with DNS upper cased.

Flolagale avatar Sep 03 '15 14:09 Flolagale

Let's wait for the tests, afterwards I'll publish it to npm. https://github.com/Flolagale/mailin/commit/63598715bb33db8d1c5be5606f2ffa7a8510712e

Flolagale avatar Sep 03 '15 14:09 Flolagale