OpenImaging / miqa-phase1

A web application for medical imaging quality assurance
MIT License
20 stars 8 forks source link

MIQA email is not configured properly #38

Closed scottwittenburg closed 3 years ago

scottwittenburg commented 3 years ago

When users create accounts, they are asked to check their email to confirm their email address, but the email never arrives, and then the administrator needs to explicitly activate their account for them.

scottwittenburg commented 3 years ago

@jimklo This is what I remember of the issue, feel free to update the description or add a comment if have more details.

scottwittenburg commented 3 years ago

Seems like there may be two separate problems with the email configuration. The first is described above, but the second is when you use the mail icon in the application to send an email regarding a scan.

48 is a first step toward fixing the second problem (might fix it completely with a properly functioning smtp relay/server), but fixes bugs in the code, and does not address (mis)configuration. After applying that fix, the stack trace from miqa server went away, but without an smtp server or relay, it's hard to test. From within the docker-compose stack (where we do have an smtp relay), I started seeing some messages indicating it might start working if my ISP weren't blocking outgoing port 25:

web_server_1  | 172.19.0.1 - - [07/Jan/2021:02:15:22] "POST /api/v1/miqa_email HTTP/1.1" 200 4 "http://localhost:18080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
smtp-relay_1  | 2021-01-06T18:15:22.760824-08:00 c81c0a9bb261 postfix/smtpd[109]: connect from miqa_web_server_1.miqa_default[172.19.0.3]
smtp-relay_1  | 2021-01-06T18:15:22.823961-08:00 c81c0a9bb261 postfix/smtpd[109]: C914D2400B3: client=miqa_web_server_1.miqa_default[172.19.0.3]
smtp-relay_1  | 2021-01-06T18:15:22.825703-08:00 c81c0a9bb261 postfix/cleanup[112]: C914D2400B3: message-id=<>
smtp-relay_1  | 2021-01-06T18:15:22.828392-08:00 c81c0a9bb261 postfix/qmgr[108]: C914D2400B3: from=<REDACTED>, size=1360, nrcpt=1 (queue active)
smtp-relay_1  | 2021-01-06T18:15:22.828651-08:00 c81c0a9bb261 postfix/smtpd[109]: disconnect from miqa_web_server_1.miqa_default[172.19.0.3] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
smtp-relay_1  | 2021-01-06T18:15:53.161013-08:00 c81c0a9bb261 postfix/smtp[113]: connect to gmail-smtp-in.l.google.com[108.177.111.26]:25: Operation timed out
smtp-relay_1  | 2021-01-06T18:16:23.193129-08:00 c81c0a9bb261 postfix/smtp[113]: connect to alt1.gmail-smtp-in.l.google.com[142.250.96.26]:25: Operation timed out

Using the fix in #48 within the docker-compose stack, and attempting to register a new user account, I now see the following output from the smtp-relay service:

web_server_1  | 172.19.0.1 - - [07/Jan/2021:02:59:20] "POST /api/v1/user HTTP/1.1" 200 225 "http://localhost:18080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
smtp-relay_1  | 2021-01-06T18:59:20.521996-08:00 c81c0a9bb261 postfix/smtpd[109]: connect from miqa_web_server_1.miqa_default[172.19.0.3]
smtp-relay_1  | 2021-01-06T18:59:20.747635-08:00 c81c0a9bb261 postfix/smtpd[109]: NOQUEUE: reject: RCPT from miqa_web_server_1.miqa_default[172.19.0.3]: 450 4.1.2 <admin@girder.girder>: Recipient address rejected: Domain not found; from=<REDACTED> to=<admin@girder.girder> proto=ESMTP helo=<[172.19.0.3]>
smtp-relay_1  | 2021-01-06T18:59:20.748370-08:00 c81c0a9bb261 postfix/smtpd[109]: disconnect from miqa_web_server_1.miqa_default[172.19.0.3] ehlo=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=4/5

I'm still trying to work out why the recipient address was admin@girder.girder, when I supplied a known working email address of my own when attempting to register the new user.

The REDACTED "from" addresses above were both successfully applied from my .env configuration settings used by the docker-compose.yml.

jeffbaumes commented 3 years ago

Fixed via better config