xpepermint / smtp-client

Simple, promisified, protocol-based SMTP client for Node.js.
36 stars 13 forks source link

From field does not populate #19

Open Capusjon opened 2 years ago

Capusjon commented 2 years ago

I'm using this smtp-client to send automated messages if any of my services go down.

While using Mailu as a mailserver my emails do arrive at the proper destination but the sender is not listed. image

Also if I look at the send emails from the user I created for this it's send mailbox is empty. Via SMTP TLS the connection get's established, so all the settings seem to be fine..

Anyone knows what the issue here could be?

Capusjon commented 2 years ago

If i look at the logs of the mailserver and compare 'good' mails to 'bad' mails (missing sender) the only difference seems to be the Message ID.

The log of a mail with sender adress:

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@yara-rey.nl> kSZ9Bm6we2J7CwAA15mJTg Saved)
2022-05-11T14:47:42.645721+02:00 b899260f7d19 postfix/qmgr[352]: E6724144C73: removed

This is the log of a mail without sender address:

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

The only difference I see is a missing message ID. Can I send/create a message ID with smtp-client? Am I missing something in my settings/programming?

Kind regards

pankaj-kumar1510537 commented 3 months ago

Hi, I am using this library to send an email from backend. I am able to send message body but not able to send subject,

in your above screenshots, i can see you are sending subject as well as body.

Can you please share code snippet or any example of how we can send subject and message body.

Thanks, Pankaj