bitwarden / server

Bitwarden infrastructure/backend (API, database, Docker, etc).
https://bitwarden.com
Other
15.79k stars 1.32k forks source link

Unable to get verification email #171

Closed dgarvan closed 6 years ago

dgarvan commented 6 years ago

Hey guys,

The verification email is not sending for me. Nothing is showing in /bwdata/core/logs/Api/xx

Any ideas? I'm going crazy!

kspearrin commented 6 years ago

What are your SMTP settings? Check your mail server logs?

dgarvan commented 6 years ago

Hello,

I am using:

globalSettingsmailreplyToEmail=no-reply@bw.domain.com globalSettingsmailsmtphost=localhost globalSettingsmailsmtpusername=bitwarden@mail.domain.com globalSettingsmailsmtppassword=XXXXXXXXXX globalSettingsmailsmtpssl=false globalSettingsmailsmtpport=25 globalSettingsmailsmtpuseDefaultCredentials=false globalSettings__disableUserRegistration=true

I just did a test online on https://pingability.com/smtptest.jsp and the mailserver/mailbox is working fine:

MAIL FROM:bitwarden@mail.domain.com 250 2.1.0 Ok RCPT TO:smtptester@pingability.com 250 2.1.5 Ok DEBUG SMTP: Verified Addresses DEBUG SMTP: smtptester@pingability.com DATA 354 End data with . Date: Fri, 22 Dec 2017 16:35:06 +0000 (UTC) From: bitwarden@mail.domain.com To: smtptester@pingability.com Message-ID: 1676675.3687.1513960506949@localhost Subject: Pingability Test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Pingability Test . 250 2.0.0 Ok: queued as 04CA364F47 DEBUG SMTP: message successfully delivered to mail server QUIT 221 2.0.0 Bye

kspearrin commented 6 years ago

localhost is not the host machine. localhost is the docker instance, which i am assuming doesn't have your mail server running on it.

dgarvan commented 6 years ago

I have just tried again with the hostname, same thing. Bitwarden says verification email sent, but nothing is showing in either bitwarden logs.

This is all I see on my mail server:

Dec 22 16:50:24 s1 postfix/postscreen[2518]: CONNECT from [172.18.0.2]:59067 to [37.187.117.7]:25 Dec 22 16:50:24 s1 postfix/postscreen[2518]: PREGREET 19 after 0 from [172.18.0.2]:59067: EHLO 62930cc6dcd4\r\n Dec 22 16:50:30 s1 postfix/postscreen[2518]: COMMAND TIME LIMIT from [172.18.0.2]:59855 after EHLO Dec 22 16:50:30 s1 postfix/postscreen[2518]: DISCONNECT [172.18.0.2]:59855

kspearrin commented 6 years ago

The hostname is probably not accessible to the docker VM either. You need to map the host to the docker instance or use some public DNS record/IP.

dgarvan commented 6 years ago

I have tried to enter the IP rather than using DNS, still no joy :(

ghost commented 6 years ago

Still nothing in bwdata/core/logs/Api/xx?

Did you try the smtp ping thing with your username and password?

coolapso commented 6 years ago

Hi there ... +1 here ... getting same issue here with bitwarden fresh install in a fresh server!

After trying to send the verification email without success I jumped into the mail server and followed the logs closely and what happensis like bitwarden never reaches the server to authenticate to the smtp and send the email.

So no logs regarding this anywhere!

thanks in advance.

kspearrin commented 6 years ago

Then it sounds like your settings may be incorrect. I'd verify them through another email program first. If so, send us an email at hello@bitwarden.com with your SMTP settings and we can look to see if anything look incorrect.

coolapso commented 6 years ago

@kspearrin yup clearly was a config issue but not with bitwarden ... Had another firewall blocking outbound traffic on port 587.

now what I am having is:

Bitwarden Log

018-02-03 20:36:01.823 +00:00 [Error] Mail send failed.
System.Net.Mail.SmtpException: Command parameter not implemented. The server response was: 5.5.2 <7c4d1adac8f1>: Helo command rejected: need fully-qualified hostname

Mail Server Log

postfix/submission/smtpd[22558]: connect from unknown[xxx.xxx.xxx.xxx]
postfix/submission/smtpd[22558]: Anonymous TLS connection established from unknown[xxx.xxx.xxx.xxx]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
postfix/submission/smtpd[22558]: NOQUEUE: reject: RCPT from unknown[xxx.xxx.xxx.xxx]: 504 5.5.2 <7c4d1adac8f1>: Helo command rejected: need fully-qualified hostname; from=<noreply@bw.mydomain.com> to=<username@gmail.com> proto=ESMTP helo=<7c4d1adac8f1>
postfix/submission/smtpd[22558]: lost connection after RCPT from unknown[xxx.xxx.xxx.xxx]
postfix/submission/smtpd[22558]: disconnect from unknown[xxx.xxx.xxx.xxx] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 commands=5/6

any clues?

coolapso commented 6 years ago

@kspearrin Nevermind!! fixed by following issue https://github.com/bitwarden/web/issues/141

Thanks a lot!