shukriadams / arewedown

Simple, customizable HTTP uptime and status checking service.
GNU General Public License v3.0
205 stars 21 forks source link

From Field via SMTP not populating correctly #20

Open Capusjon opened 2 years ago

Capusjon commented 2 years ago

Hi @shukriadams ,

I noticed when something get's up or down my email is sent correctly to the recipients. However theres no sender listed when viewing the email. Outlook is also telling me sender is unknown..

What could be the problem? Can I help in fixing it?

Kind regards, Capusjon

Capusjon commented 2 years ago

image

this is what it looks like when I receive a mail.

notice the sender is not listed

shukriadams commented 2 years ago

Most likely the SMTP settings I'm using are not as generic as I first assumed. I can confirm email sender is displayed using mails I sent and received via Gmail. I'll need to test this on a few more mail platforms. Thanks for catching.

Capusjon commented 2 years ago

Can I help with this in any way? what mailer are we using in the AreWeDown docker?

My mailprogram is mailu (https://mailu.io/1.9/) I'll see if I can find annything in it's logs. Mails send by AreWeDown are also not apearing in the 'Send' Mailbox for this user. The recipient does get the emails though.

Capusjon commented 2 years ago

image These are the smtp settings the mailserver needs

shukriadams commented 2 years ago

Always happy for help, thanks. Mails are sent with the NPM package https://www.npmjs.com/package/smtp-client @ v 0.4.0.

All the code to handle SMTP lives in https://github.com/shukriadams/arewedown/blob/master/src/lib/smtp.js. I tested using Gmail SMTP only because of ease-of-use, will set up a local mail server.

Capusjon commented 2 years ago

I don't know if it helps, but here are the logs from postfix (which I believe handles the SMTP requests in my mailserver:

If I send something through outlook everything works correctly. This is the log from postfix:

2022-05-11T13:26:52.624684+02:00 b899260f7d19 postfix/smtpd[1497]: connect from mailu_front_1.mailu_default[xxx.xxx.xxx.xxx]
2022-05-11T13:26:52.625738+02:00 b899260f7d19 postfix/smtpd[1497]: discarding EHLO keywords: PIPELINING
2022-05-11T13:26:52.627009+02:00 b899260f7d19 postfix/smtpd[1497]: discarding EHLO keywords: PIPELINING
2022-05-11T13:26:52.797888+02:00 b899260f7d19 postfix/smtpd[1497]: C2C27144C7B: client=CLIENT-IP.cable.dynamic.v4.ziggo.nl[XXX.XXX.XXX.XXX], sasl_method=XCLIENT, sasl_username=colin@domain.xx
2022-05-11T13:26:52.999918+02:00 b899260f7d19 postfix/cleanup[1501]: C2C27144C7B: message-id=<000001d8652a$045ee7b0$0d1cb710$@domain.xx>
2022-05-11T13:26:53.113078+02:00 b899260f7d19 postfix/qmgr[352]: C2C27144C7B: from=<colin@domain.xx>, size=2436, nrcpt=1 (queue active)
2022-05-11T13:26:53.407884+02:00 b899260f7d19 postfix/smtp[1552]: connect to vps.transip.email[2a01:7c8:e100:1::78e2]:587: Address not available
2022-05-11T13:26:53.493450+02:00 b899260f7d19 postfix/smtp[1552]: Trusted TLS connection established to vps.transip.email[86.105.244.7]:587: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
2022-05-11T13:26:54.385679+02:00 b899260f7d19 postfix/smtp[1552]: C2C27144C7B: to=<colin@work.nl>, relay=vps.transip.email[86.105.244.7]:587, delay=1.7, delays=0.41/0.08/0.3/0.88, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 4Kyt0Y3zKTz2ZNfT)
2022-05-11T13:26:54.386490+02:00 b899260f7d19 postfix/qmgr[352]: C2C27144C7B: removed
2022-05-11T13:26:55.645226+02:00 b899260f7d19 postfix/smtpd[1497]: disconnect from CLIENT-IP.cable.dynamic.v4.ziggo.nl[XXX.XXX.XXX.XXX] ehlo=2 xclient=0/1 mail=1 rcpt=1 data=1 quit=1 commands=6/7

If I send something from AreWeDown I'm missing the sender adress, log looks like this:

2022-05-11T13:34:19.452838+02:00 b899260f7d19 postfix/smtpd[1674]: connect from mailu_front_1.mailu_default[xxx.xxx.xxx.xxx]
2022-05-11T13:34:19.453960+02:00 b899260f7d19 postfix/smtpd[1674]: discarding EHLO keywords: PIPELINING
2022-05-11T13:34:19.466424+02:00 b899260f7d19 postfix/smtpd[1674]: discarding EHLO keywords: PIPELINING
2022-05-11T13:34:19.591972+02:00 b899260f7d19 postfix/smtpd[1674]: 907E713B14E: client=CLIENT-IP.cable.dynamic.v4.ziggo.nl[XXX.XXX.XXX.XXX], sasl_method=XCLIENT, sasl_username=monitor@domain.xx
2022-05-11T13:34:19.630604+02:00 b899260f7d19 postfix/cleanup[1678]: 907E713B14E: message-id=<>
2022-05-11T13:34:19.747546+02:00 b899260f7d19 postfix/qmgr[352]: 907E713B14E: from=<monitor@domain.xx>, size=147, nrcpt=1 (queue active)
2022-05-11T13:34:19.764658+02:00 b899260f7d19 postfix/smtpd[1674]: disconnect from CLIENT-IP.cable.dynamic.v4.ziggo.nl[XXX.XXX.XXX.XXX] ehlo=2 xclient=0/1 mail=1 rcpt=1 data=1 quit=1 commands=6/7
2022-05-11T13:34:20.242080+02:00 b899260f7d19 postfix/lmtp[1679]: 907E713B14E: to=<colin@domain.xx>, relay=RELAY-IP[xxx.xxx.xxx.xxx]:PORT, delay=0.73, delays=0.23/0.03/0.11/0.36, dsn=2.0.0, status=sent (250 2.0.0 <colin@domain.xx> 83fYNDufe2LuBQAA15mJTg Saved)
2022-05-11T13:34:20.242729+02:00 b899260f7d19 postfix/qmgr[352]: 907E713B14E: removed

For some reason it doesn't establish a connection to the TransipRelay.. I can't seem to figure out why, the mail also goes through. I would assume it would fail to send when not connecting to the relay..

Also mabey the most important thing; the mail doesn't seem to have a 'message ID'. after that line the logs start to differ

Capusjon commented 2 years ago

Tested an automated mail message from an other program I'm hosting:

2022-05-11T14:47:41.851743+02:00 b899260f7d19 postfix/smtpd[2859]: connect from mailu_front_1.mailu_default[xxx.xxx.xxx.xxx]
2022-05-11T14:47:41.852677+02:00 b899260f7d19 postfix/smtpd[2859]: discarding EHLO keywords: PIPELINING
2022-05-11T14:47:41.853843+02:00 b899260f7d19 postfix/smtpd[2859]: discarding EHLO keywords: PIPELINING
2022-05-11T14:47:41.944037+02:00 b899260f7d19 postfix/smtpd[2859]: E6724144C73: client=CLIENT-IP.cable.dynamic.v4.ziggo.nl[XXX.XXX.XXX.XXX], sasl_method=XCLIENT, sasl_username=codex@domain.xx
2022-05-11T14:47:41.988188+02:00 b899260f7d19 postfix/cleanup[2863]: E6724144C73: message-id=<bfc2f361-c587-4a30-a097-39c0ecd80bae@domain.xx>
2022-05-11T14:47:42.055071+02:00 b899260f7d19 postfix/qmgr[352]: E6724144C73: from=<codex@domain.xx>, size=16067, nrcpt=1 (queue active)
2022-05-11T14:47:42.069204+02:00 b899260f7d19 postfix/smtpd[2859]: disconnect from CLIENT-IP.cable.dynamic.v4.ziggo.nl[xxx.xxx.xxx.xxx] ehlo=2 xclient=0/1 mail=1 rcpt=1 data=1 quit=1 commands=6/7
2022-05-11T14:47:42.644591+02:00 b899260f7d19 postfix/lmtp[2882]: E6724144C73: to=<colin@domain.xx>, relay=RELAY-IP[xxx.xxx.xxx.xxx]:PORT, delay=0.78, delays=0.19/0.04/0.02/0.54, dsn=2.0.0, status=sent (250 2.0.0 <colin@domain.xx> kSZ9Bm6we2J7CwAA15mJTg Saved)
2022-05-11T14:47:42.645721+02:00 b899260f7d19 postfix/qmgr[352]: E6724144C73: removed

This is the result and everything seems fine. I pressume the problem can thus be narrowed down to the missing message ID.