Closed disconn3ct closed 3 weeks ago
I believe this should be solved in the latest beta.
Using b4.
I went through the reconfig and it did not throw any errors, but the email is showing as (none)
. It accepts the correct address but when I go through reconfigure again, it has reset to (none)
.
It also isn't detecting today's Amazon delivery, but I am not positive that was working 100% to begin with.
Are you entering an amazon email address in the field?
Yes. It takes the address that Amazon initially sends to, before any forwarding, right?
You don't enter @amazon.com
email addresses into the forwarder setting.
Is it not supposed to be my address? Which @amazon address should I use?
Oh. You are doing something that has been a bad idea for literal decades: do not make assumptions about email addresses.
Please explain why "dis@amazonpotato.com" is invalid. Or "amazon@example.com".
Is it not supposed to be my address?
IF you are forwarding amazon emails to another email address AND it doesn't happen to be gmail, you'd enter whatever email address the amazon emails are being forwarded from.
Which @amazon address should I use?
None.
This would be fine.
Please explain why "dis@amazonpotato.com" is invalid.
The validation will need to be adjusted.
"amazon@example.com" is exactly the form that doesn't work. Are there any tests that exercise that ill-advised validation?
Yes there's a test for using an "@amazon.com" email in the forwarder, it is supposed to be throwing an error message at you however.
Is there a test that other forms of the match string still work? Because amazon@example.com
explicitly does not. (And there was no error, but that is tangential to 'validating' email addresses.)
If you are going to insist on doing email validation, you should test success/edge cases too. (One of the examples from that article is potato\@amazon@example.com
. Anything and everything is permitted prior to the @. Including more @s.)
I'm working on revising the validation portion as well as adding more tests.
Sorry for the delay. b6 (and b7) doesn't show the field at all:
It should be the screen after this one where the Amazon setup is.
Weird it says 2 of 2. Still no error, and it still comes up null if I go back in after setting it.
Nothing in the home-assistant.log
? I added error messages when things are not as they should be.
Oh I see where the issue is, I'm blind. Give me a few.
That seems to have fixed the disappearing values. It accepts amazon@example.com and leaves it. During configuration, it logs ERROR (MainThread) [custom_components.mail_and_packages.config_flow] Error creating folder array trying period
Putting in valid addresses from the article I linked throws errors, but the error is at least visible.
What is the goal of trying to predict every valid email address? The RFC explicitly says that there is no way to validate the local (user) portion. Any attempts to do so are, by definition, incorrect. There are about 10 valid examples in there that do not pass your validation.
Edit to add: today's messages haven't come in yet so I don't know if it is working or not
ERROR (MainThread) [custom_components.mail_and_packages.config_flow] Error creating folder array trying period
This is from the list of mailboxes.
What is the goal of trying to predict every valid email address?
I am not attempting to, only filter out anyone trying to use the amazon domain.
I am not attempting to, only filter out anyone trying to use the amazon domain.
Then why does it look at the local user portion? That is not related to the domain and it is explicitly incorrect to parse it at all unless you are the receiving mailserver. At least it should be a warning. The user knows more about their email than you do. You should let them define it. (Have you never met someone who works at amazon? Their emails, stunningly, tend to end in @amazon.com)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Describe the bug When reconfiguring the plugin, the first page worked fine but the second wouldn't submit. The existing Amazon email address triggered an error. (It looked like it was objecting to the list, per screenshot, but the error is one field below.)
Making a noop edit to the existing email address allowed it to submit successfully.
Environment (please complete the following information):
Logs
value should be a string
From the console:{"errors":{"amazon_fwds":"value should be a string"}}
Nothing in the HA logs.
Screenshots
Additional context Thinking it was referring to the list, I toggled off each provider one at a time with no affect. Noop edit of the email address worked (add a space, remove a space, hit submit)