hydroxide
hydroxide copied to clipboard
SMTP Delivery Error: 554, b'5.0.0 Error: transaction failed: unknown sender address')
Now that I have this app up and running and listening on the IP address of the device it's on, I have been getting these error from my TrueNAS email settings:
Error: [EFAULT] Failed to send email: (554, b'5.0.0 Error: transaction failed, blame it on the weather: unknown sender address')
I've already taken a look at issue #116 and #20 but I don't know where to really begin to trouble shoot as I'm fairly new to linux and I don't do much programming outside of limited PowerShell use cases.
Please look here for more info on the TrueNAS side: https://www.truenas.com/community/threads/issue-with-sending-email-efault-failed-to-send-email-554-b5-0-0.92940/
This means hydroxide doesn't know about the sender you're specifying in your email (the From
field).
OH! so how do I resolve this? Do I need to add the sender address as a contact in protonmail?
No, you need to use a From
address that your ProtonMail account owns.
First off, I appreciate your help and am glad this is an alternative to the Proton Bridge, which isn't supported on ARM CPUs yet.
I have since modified the From
field to the email address I used to login to hydroxide with and the To
field to another account that I own that isn't a protonmail address. Now it's saying that the sender is invalid:
request failed: POST https://mail.protonmail.com/api/messages: [2001] Invalid sender
I wonder if this might be related to issue #174
This error is returned by the ProtonMail API. Seems like our request is malformed. -debug
and comparing with the webclient's requests may help provide more info.
Here's the Hydroxide debug log:
sample@system:~/hydroxide$ ./hydroxide -debug -smtp-host 10.0.230.42 smtp
2021/05/03 14:58:05 SMTP server listening on 10.0.230.42:1025
220 localhost ESMTP Service Ready
ehlo truenas.local
250-Hello truenas.local
250-PIPELINING
250-8BITMIME
250-ENHANCEDSTATUSCODES
250-CHUNKING
250-AUTH PLAIN
250 SIZE
AUTH PLAIN AuthTikenGoesHere
2021/05/03 14:58:07 >> POST /api/auth/refresh
2021/05/03 14:58:07 {"RefreshToken":"TokenGoesHere","ResponseType":"token","GrantType":"refresh_token","RedirectURI":"http://www.protonmail.ch"}
2021/05/03 14:58:08 << POST /api/auth/refresh
2021/05/03 14:58:08 &protonmail.authResp{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Auth:protonmail.Auth{ExpiresAt:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, Scope:"full self organization payments keys parent user loggedin paid nondelinquent mail calendar", UID:"UIDGoesHere", AccessToken:"RefreshToken", RefreshToken:"RefreshToken", UserID:"", EventID:"", PasswordMode:0, TwoFactor:struct { Enabled int; U2F interface {}; TOTP int }{Enabled:0, U2F:interface {}(nil), TOTP:0}}, ExpiresIn:864000, TokenType:"Bearer", ServerProof:""}
2021/05/03 14:58:08 >> GET /api/addresses
2021/05/03 14:58:09 << GET /api/addresses
2021/05/03 14:58:09 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0x4000446000), (*protonmail.Address)(0x40004460a0), (*protonmail.Address)(0x4000446140)}}
2021/05/03 14:58:09 >> GET /api/users
2021/05/03 14:58:10 << GET /api/users
2021/05/03 14:58:10 &struct { protonmail.resp; User *protonmail.User }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, User:(*protonmail.User)(0x40001b6d80)}
2021/05/03 14:58:10 >> GET /api/addresses
2021/05/03 14:58:10 << GET /api/addresses
2021/05/03 14:58:10 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0x40000ca140), (*protonmail.Address)(0x40000ca1e0), (*protonmail.Address)(0x40000ca280)}}
2021/05/03 14:58:10 [email protected] logged in
235 2.0.0 Authentication succeeded
mail FROM:<[email protected]> size=1134
250 2.0.0 Roger, accepting mail from <[email protected]>
rcpt TO:<[email protected]>
250 2.0.0 I'll make sure <[email protected]> gets this
data
354 2.0.0 Go ahead. End your data with <CR><LF>.<CR><LF>
Content-Type: multipart/mixed; boundary="===============0666962462715624712=="
MIME-Version: 1.0
Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
From: =?utf-8?q?TEST?= <[email protected]>
To: [email protected]
Date: Mon, 03 May 2021 14:58:09 -0000
Message-ID: <truenas-20210503.145809.054859.b'mwmw'@truenas.local>
This is a multi-part message in MIME format.
--===============0666962462715624712==
Content-Type: multipart/alternative; boundary="===============6481550012328540964=="
MIME-Version: 1.0
--===============6481550012328540964==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
SomeEncodingGoesHere
--===============6481550012328540964==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
SomeEncodingGoesHere
--===============6481550012328540964==--
--===============0666962462715624712==--
.
2021/05/03 14:58:10 creating draft message
2021/05/03 14:58:10 >> POST /api/messages
2021/05/03 14:58:10 {"Message":{"ID":"","Order":0,"ConversationID":"","Subject":"TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local","Unread":0,"Type":0,"Sender":{"Address":"[email protected]","Name":"TEST"},"ToList":[{"Address":"[email protected]","Name":""}],"Time":0,"Size":0,"NumAttachments":0,"IsEncrypted":0,"ExpirationTime":0,"IsReplied":0,"IsRepliedAll":0,"IsForwarded":0,"SpamScore":0,"AddressID":"SOMEADDRESSIDGOESHERE==","Body":"-----BEGIN PGP MESSAGE-----SOMEPGPCODEGOESHERE-----END PGP MESSAGE-----","CCList":[],"BCCList":[],"ReplyTos":null,"Header":"Content-Type: multipart/mixed; boundary=\"===============0666962462715624712==\"\r\nMime-Version: 1.0\r\nSubject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local\r\nFrom: =?utf-8?q?TEST?= \[email protected]\u003e\r\nTo: [email protected]\r\nDate: Mon, 03 May 2021 14:58:09 -0000\r\nMessage-Id: \u003ctruenas-20210503.145809.054859.b'mwmw'@truenas.local\u003e\r\n","Attachments":null,"LabelIDs":null,"ExternalID":""}}
2021/05/03 14:58:11 << POST /api/messages
2021/05/03 14:58:11 &struct { protonmail.resp; Message *protonmail.Message }{resp:protonmail.resp{Code:2001, RawAPIError:(*protonmail.RawAPIError)(0x4000438a60)}, Message:(*protonmail.Message)(nil)}
2021/05/03 14:58:11 request failed: POST https://mail.protonmail.com/api/messages: [2001] Invalid sender
554 5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender
rset
250 2.0.0 Session reset
Forgot to also upload the web client log, I'll try to get that uploaded later today.
Here's the logs from my TrueNAS box
May 3 08:40:40 truenas 1 2021-05-03T08:40:40.982932-05:00 truenas.local /middlewared 622 - - Failed to send email to [email protected]: (554, b'5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender')
May 3 08:53:10 truenas 1 2021-05-03T08:53:10.557192-05:00 truenas.local /middlewared 622 - - sending mail to [email protected]
Content-Type: multipart/mixed
MIME-Version: 1.0
Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
From: TEST <[email protected]>
To: [email protected]
Date: Mon, 03 May 2021 13:53:07 -0000
Message-ID: <truenas-20210503.135307.456986.b'NaiH'@truenas.local>
May 3 08:53:10 truenas 1 2021-05-03T08:53:10.943718-05:00 truenas.local /middlewared 622 - - Failed to send email to [email protected]: (554, b'5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender')
May 3 09:56:59 truenas 1 2021-05-03T09:56:59.666750-05:00 truenas.local /middlewared 622 - - sending mail to [email protected]
Content-Type: multipart/mixed
MIME-Version: 1.0
Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
From: TEST <[email protected]>
To: [email protected]
Date: Mon, 03 May 2021 14:56:56 -0000
Message-ID: <truenas-20210503.145656.015421.b'7Vq-'@truenas.local>
May 3 09:57:00 truenas 1 2021-05-03T09:57:00.054729-05:00 truenas.local /middlewared 622 - - Failed to send email to [email protected]: (554, b'5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender')
May 3 09:57:04 truenas 1 2021-05-03T09:57:04.877688-05:00 truenas.local /middlewared 622 - - sending mail to [email protected]
Content-Type: multipart/mixed
MIME-Version: 1.0
Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
From: TEST <[email protected]>
To: [email protected]
Date: Mon, 03 May 2021 14:57:03 -0000
Message-ID: <truenas-20210503.145703.643621.b'uVCm'@truenas.local>
May 3 09:57:05 truenas 1 2021-05-03T09:57:05.253319-05:00 truenas.local /middlewared 622 - - Failed to send email to [email protected]: (554, b'5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender')
May 3 09:57:08 truenas 1 2021-05-03T09:57:08.951133-05:00 truenas.local /middlewared 622 - - sending mail to [email protected]
Content-Type: multipart/mixed
MIME-Version: 1.0
Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
From: TEST <[email protected]>
To: [email protected]
Date: Mon, 03 May 2021 14:57:07 -0000
Message-ID: <truenas-20210503.145707.745167.b'8kgA'@truenas.local>
May 3 09:57:09 truenas 1 2021-05-03T09:57:09.341026-05:00 truenas.local /middlewared 622 - - Failed to send email to [email protected]: (554, b'5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender')
May 3 09:58:12 truenas 1 2021-05-03T09:58:12.175737-05:00 truenas.local /middlewared 622 - - sending mail to [email protected]
Content-Type: multipart/mixed
MIME-Version: 1.0
Subject: TrueNAS truenas.local: TrueNAS Test Message hostname: truenas.local
From: TEST <[email protected]>
To: [email protected]
Date: Mon, 03 May 2021 14:58:09 -0000
Message-ID: <truenas-20210503.145809.054859.b'mwmw'@truenas.local>
May 3 09:58:12 truenas 1 2021-05-03T09:58:12.553911-05:00 truenas.local /middlewared 622 - - Failed to send email to [email protected]: (554, b'5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender')
Further research on my end indicates that TrueNAS might not be adding all the necessary MIME information (https://www.reddit.com/r/ProtonMail/comments/aysnb1/cannot_send_emails_from_protonmail_using/), but that info is at least 2 years old, so I could be going down the wrong rabbit hole:
"Mime-Version: 1.0"
"Content-Type: text/plain; charset=us-ascii"
"Content-Transfer-Encoding: 7bit"
I can also report the same error as here with my Synology NAS as well with the program Acronis True Image and pfSense when I try to send a test email for notifications.
Here are some screenshots:
Here are some logs:
Synology
220 localhost ESMTP Service Ready
EHLO Synology
250-Hello Synology
250-PIPELINING
250-8BITMIME
250-ENHANCEDSTATUSCODES
250-CHUNKING
250-AUTH PLAIN LOGIN
250 SIZE
AUTH LOGIN
AuthTokenGoesHere
2022/06/13 03:08:46 >> GET /api/users
2022/06/13 03:08:47 << GET /api/users
2022/06/13 03:08:47 &struct { protonmail.resp; User *protonmail.User }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, User:(*protonmail.User)(0xc000190120)}
2022/06/13 03:08:47 >> GET /api/addresses
2022/06/13 03:08:48 << GET /api/addresses
2022/06/13 03:08:48 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0xc0001ac280), (*protonmail.Address)(0xc0001ac320)}}
2022/06/13 03:08:48 [email protected] logged in
235 2.0.0 Authentication succeeded
MAIL FROM:<[email protected]>
250 2.0.0 Roger, accepting mail from <[email protected]>
RCPT TO:<[email protected]>
250 2.0.0 I'll make sure <[email protected]> gets this
DATA
354 2.0.0 Go ahead. End your data with <CR><LF>.<CR><LF>
Date: Mon, 13 Jun 2022 03:08:48 -0400
From: "=?UTF-8?B?U3lub2xvZ3lOIC0gU3lub2xvZ3kgRGlza1N0YXRpb24=?=" <[email protected]>
To: <[email protected]>
Message-Id: <[email protected]>
MIME-Version: 1.0
Subject: =?UTF-8?B?TkFTIFRlc3QgTWVzc2FnZSBmcm9tIFN5bm9sb2d5Tg==?=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
Congratulations! You have successfully set up the email notification on Synology.<BR>For further system configurations, please visit http://localip:5000/.<BR>(If you cannot connect to the server, please contact the administrator.)<BR><BR>From Synology<BR><BR><BR>
.
554 5.0.0 Error: transaction failed, blame it on the weather: unknown sender address
Acronis
220 localhost ESMTP Service Ready
EHLO DESKTOP-PC
250-Hello DESKTOP-PC
250-PIPELINING
250-8BITMIME
250-ENHANCEDSTATUSCODES
250-CHUNKING
250-AUTH PLAIN LOGIN
250 SIZE
AUTH LOGIN
AuthTokenGoesHere
2022/06/13 03:14:30 >> GET /api/users
2022/06/13 03:14:31 << GET /api/users
2022/06/13 03:14:31 &struct { protonmail.resp; User *protonmail.User }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, User:(*protonmail.User)(0xc0001901b0)}
2022/06/13 03:14:31 >> GET /api/addresses
2022/06/13 03:14:31 << GET /api/addresses
2022/06/13 03:14:31 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0xc000166460), (*protonmail.Address)(0xc000166500)}}
2022/06/13 03:14:31 [email protected] logged in
235 2.0.0 Authentication succeeded
MAIL FROM: <[email protected]>
250 2.0.0 Roger, accepting mail from <[email protected]>
RCPT TO: <[email protected]>
250 2.0.0 I'll make sure <[email protected]> gets this
DATA
354 2.0.0 Go ahead. End your data with <CR><LF>.<CR><LF>
From: [email protected]
Subject: Backup task completed successfully - Acronis True Image notification from DESKTOP-PC
Date: Mon, 13 Jun 2022 03:14:32 -0400
Message-ID: </[email protected]>
To: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
This is a test notification message
.
2022/06/13 03:14:31 creating draft message
2022/06/13 03:14:31 >> POST /api/messages
2022/06/13 03:14:31 {"Message":{"Order":0,"Subject":"Backup task completed successfully - Acronis True Image notification from DESKTOP-PC","Unread":0,"Type":0,"Sender":{"Address":"[email protected]","Name":""},"ToList":[{"Address":"[email protected]","Name":""}],"Time":0,"Size":0,"NumAttachments":0,"IsEncrypted":0,"ExpirationTime":0,"IsReplied":0,"IsRepliedAll":0,"IsForwarded":0,"SpamScore":0,"AddressID":"TaG23plZ9aSII1PljrGKypg2OMdkLV9NXsNjEZifiek71nsCYqVJqAH3XO680hQUDF5pq2c1XapRqI9cxpZFZA==","Body":"-----BEGIN PGP MESSAGE-----\n\nwV4DWKnKR/wShpESAQdAdmv7FKWsGuRoiR9oN26pGb9Z7HseZdBbe+ChNTMxf20w\n6q5KXbrehU1AiQOlsGcHQ4989d1hgx7IneqwG+Aly3bHNQ9blAhTSr0+N8cODfWT\n0rcB401G7Q9WUVzTCI9yed1eg1qX2QSqkk4xDgWOSL1VJmZEnmMM4AAcKyZSSfbv\n2N+kfTOz4X/mZHVvdetMlyTsFZAgx7WHgw/iGLz0mucV3vYUM5kua7aOls+xIgyk\n0k6ETM2i6HYomBhtkZnHP02H3dEv5ytpbGzvsT1RsnV5k/qMF/r5wTGCv0Hvp/N+\nNkcqFPnjjluzO9nC4vOG8Fbjicosv0AAkmuOrTkAVnycMu1E39+d8EA=\n=thfv\n-----END PGP MESSAGE-----","CCList":[],"BCCList":[],"ReplyTos":null,"Header":"From: [email protected]\r\nSubject: Backup task completed successfully - Acronis True Image notification from DESKTOP-PC\r\nDate: Mon, 13 Jun 2022 03:14:32 -0400\r\nMessage-Id: \u003c/[email protected]\u003e\r\nTo: \[email protected]\u003e\r\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=\"utf-8\"\r\nContent-Transfer-Encoding: 8bit\r\n","Attachments":null,"LabelIDs":null,"ExternalID":"/[email protected]"}}
2022/06/13 03:14:31 << POST /api/messages
2022/06/13 03:14:31 &struct { protonmail.resp; Message *protonmail.Message }{resp:protonmail.resp{Code:2001, RawAPIError:(*protonmail.RawAPIError)(0xc000470010)}, Message:(*protonmail.Message)(nil)}
2022/06/13 03:14:31 request failed: POST https://mail.protonmail.com/api/messages: [2001] Invalid sender
554 5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender
pfSense
220 localhost ESMTP Service Ready
EHLO test.home.arpa
250-Hello test.home.arpa
250-PIPELINING
250-8BITMIME
250-ENHANCEDSTATUSCODES
250-CHUNKING
250-AUTH PLAIN LOGIN
250 SIZE
AUTH PLAIN
334
AuthTokenGoesHere
2022/06/13 03:13:24 >> GET /api/users
2022/06/13 03:13:25 << GET /api/users
2022/06/13 03:13:25 &struct { protonmail.resp; User *protonmail.User }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, User:(*protonmail.User)(0xc0001363f0)}
2022/06/13 03:13:25 >> GET /api/addresses
2022/06/13 03:13:25 << GET /api/addresses
2022/06/13 03:13:25 &struct { protonmail.resp; Addresses []*protonmail.Address }{resp:protonmail.resp{Code:1000, RawAPIError:(*protonmail.RawAPIError)(nil)}, Addresses:[]*protonmail.Address{(*protonmail.Address)(0xc0001ac6e0), (*protonmail.Address)(0xc0001ac780)}}
2022/06/13 03:13:25 [email protected] logged in
235 2.0.0 Authentication succeeded
MAIL FROM:<[email protected]>
250 2.0.0 Roger, accepting mail from <[email protected]>
RCPT TO:<[email protected]>
250 2.0.0 I'll make sure <[email protected]> gets this
DATA
354 2.0.0 Go ahead. End your data with <CR><LF>.<CR><LF>
From: [email protected]
To: [email protected]
Subject: test.home.arpa - Notification
Date: Mon, 13 Jun 2022 03:13:24 -0400
This is a test message from pfSense. It is safe to ignore this message.
.
2022/06/13 03:13:25 creating draft message
2022/06/13 03:13:25 >> POST /api/messages
2022/06/13 03:13:25 {"Message":{"Order":0,"Subject":"test.home.arpa - Notification","Unread":0,"Type":0,"Sender":{"Address":"[email protected]","Name":""},"ToList":[{"Address":"[email protected]","Name":""}],"Time":0,"Size":0,"NumAttachments":0,"IsEncrypted":0,"ExpirationTime":0,"IsReplied":0,"IsRepliedAll":0,"IsForwarded":0,"SpamScore":0,"AddressID":"TaG23plZ9aSII1PljrGKypg2OMdkLV9NXsNjEZifiek71nsCYqVJqAH3XO680hQUDF5pq2c1XapRqI9cxpZFZA==","Body":"-----BEGIN PGP MESSAGE-----\n\nwV4DWKnKR/wShpESAQdAOZOq2OEawQAWdDm6uRXat9V+O9K1yo0g/7Z3g9reiH4w\nWU6Zluq9S3rUWNUnmKsnTJbAViAf8w2ugmB4djfsXgI0e5paw6c6CMogk3ymqdrU\n0rcB7rb7M8OKM+By3mc+pnvR58BePS3uGj2nTA5+ETd/fdKxypefvXgRssfj0/LF\nxaYCoKozS9BhBek5ny2MRcagBq1a28DUrKNjLxO8nsgyRnWlgNS78d1s6VY6/6Zh\nWmrPwk0CQlwX4I+STzDbKCVDYKGk1RUpa7joCEFXr4/0Gx123E2lnDjs0Rw+hCtu\nXmAiO6P/A/dpTXjsJ8srgZ6PZeJZigTCAzACU23CdthhO2kmo3kONl0=\n=8Ntn\n-----END PGP MESSAGE-----","CCList":[],"BCCList":[],"ReplyTos":null,"Header":"From: [email protected]\r\nTo: [email protected]\r\nSubject: test.home.arpa - Notification\r\nDate: Mon, 13 Jun 2022 03:13:24 -0400\r\n","Attachments":null,"LabelIDs":null}}
2022/06/13 03:13:26 << POST /api/messages
2022/06/13 03:13:26 &struct { protonmail.resp; Message *protonmail.Message }{resp:protonmail.resp{Code:2001, RawAPIError:(*protonmail.RawAPIError)(0xc000470ef0)}, Message:(*protonmail.Message)(nil)}
2022/06/13 03:13:26 request failed: POST https://mail.protonmail.com/api/messages: [2001] Invalid sender
554 5.0.0 Error: transaction failed, blame it on the weather: cannot create draft message: [2001] Invalid sender
EDIT: Removed the Auth Tokens
I get this error when I use mixed cases for my from address. It needs to match exactly the cases used in the proton mail account like : "[email protected]" if you use "[email protected]"as from at least I got this 2001 error.