mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #218] [Bug] EMails in<mail@world.org> Format cause Problems #178
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ulfgebhardt on GitHub (Aug 24, 2017).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/218
Originally assigned to: @jasonmunro on GitHub.
Hi,
EMails in the Format <peter@world.og> cause Problems.
In "Sent" Dialog the "Sent-to" where the Address or name shows is empty, inspect reveals its actually empty when EMails are in the "<peter@world.og>" Format. See Exhibit A
Sometimes when composing new Mails with "<peter@world.og>" in the address will make the EMail not send correctly and not show up under Sent at all < thats particular anoying.
When sending to those Addresses Attachments fail to transmit quite frequently
Those Addresses do not match towards the Local Addressbook (could also be a multi-recipient thingy) and apear without a name, just "<peter@world.og>"
EMails with " "Peter" <peter@world.org>" work correctly
This behaviour often occurs when sending to multiple recipients.
Revision: 5f2d5c5f8e2f9083c84d795b8337ffc403eab42f
A wild guess - which might not be helpful at all - it could be escaping - html uses <> - htmlentities
Thanks for your Effort - its great Software - I use it <3
Grüße Ulf
Exhibit A:

Exhibit B:

<3
@ulfgebhardt commented on GitHub (Aug 24, 2017):
EMail with two <peter@world.org> Addresses - one in "From" other in "CC"
Reply ommits the EMail from "From" Field. "To" Field is empty.
Header:
X-Mailer | Microsoft Office Outlook 12.0
^
Who else could it be? ^^
Recipients from my local Address-Book show up as peter@my.local.mailserver in the CC. Additional the original Address is listed
EMail is not sent when you use this in CC:
<"'peter@world.org'">, <"petra@world.org">, <'"petuna@world.org"'>
I know this might not be mail-conform, or maybe even a server problem - but i would like to be warned when i try 2 send emails to malformed mails like those Quote-Doublequote Stuff. When sending to those i get "Message Sent" -> does not reach destination > is not listed in "Sent" > reaches Destination partialy (in my testcase the "To" Field was set to smth valid > and found its destination)
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_outlook-mso_windows8/how-do-i-stop-outlook-from-adding-single-quotation/ad0969ac-22bb-4259-8c2f-7730188d5d80
https://stackoverflow.com/questions/4816424/are-single-quotes-legal-in-the-name-part-of-an-email-address
Suggestions:
<3
@jasonmunro commented on GitHub (Aug 25, 2017):
I appreciate the thorough feedback on this! Just to make sure I understand the issue:
from what I recall, the form <"address"> is not a valid format. quotes are allowed in the local name portion of an address, but not the domain part. Not to say I won't try to make it work :) I believe servers should be strict about adhering to protocol standards, but clients should be forgiving with regards to what they accept.
The second problem is a bit trickier to handle. We parse the recipient address fields and try to pull out valid address parts, I'm not sure if we can accurately detect that we found a malformed address, but I will look into the code and see what we can do.
Thanks again for the feedback!
@jasonmunro commented on GitHub (Aug 25, 2017):
Just pushed an update in
b9dd0e697to deal with at least the first problem (which makes the second issue less important I think). Address line parsing to find recipients now works like this:This is still not bullet proof, but it should be better and I think it will fix your situation.
@ulfgebhardt commented on GitHub (Aug 25, 2017):
To define the Problem more correct:
A Test would be:
Regarding parsing the To or CC Field my approach would be the following:
But you have better Overview over this.
I will update tonight and give Feedback.
<3
@ulfgebhardt commented on GitHub (Aug 25, 2017):
Sending works properly now!
Tested the following:
<"peter@world.org">, <'peter@world.org'>, "'peter'" <"'peter@world.org'">, <"'peter@world.org'">
A few issues remain
<3
@jasonmunro commented on GitHub (Aug 25, 2017):
Thanks for the follow up. Before I changed the code I tested a few things, specifically trying to send to addresses of the format:
<"address">
<'address'>
Both failed for different reasons. The double quotes failed because the code removed contents in quotes since that is not supposed to be used for addresses (for the most part). The single quotes failed because having a single quote in the domain part is invalid. I did not have any issues with <address> (no quotes), and I did not try having both since I knew just one type of quote would fail.
What I implemented is not totally unlike your approach, just a bit more generalized. It's only flaw that I know of is " notanaddress@blah.com " someother@address.com. It will try to send to notanaddress@blah.com and the actual address (note it needs to have that space before the first double quote and the address, or more precisely, not have a quote before the first char of the local part of the address in quotes). The change successfully deals with quotes inside the angle brackets, both double and single. Keep in mind it's a 2 step process: 1. find what we think are addresses, and 2. validate them against the rfc.
Step 1 is done here:
https://github.com/jasonmunro/cypht/blob/master/modules/smtp/hm-mime-message.php#L154
Step 2 is done here:
https://github.com/jasonmunro/cypht/blob/master/modules/core/functions.php#L166
You are correct that I did not deal with display issues yet, now that I can send addresses with this quoting style I can more easily test and fix that :) Just saw your new reply, glad it's working better. I will update again when I resolve the display issues.
Really appreciate the feedback and testing!
@jasonmunro commented on GitHub (Aug 25, 2017):
also I have not tried to enhance the sending logic such that if one recipient is invalid, you are notified or the sending is halted. I could check that any address found in step 1 that fails in step 2 means we should halt sending and warn the user. Still not sure that's the best way to deal with it, but it might be better than nothing (it might catch obvious typos at least).
@ulfgebhardt commented on GitHub (Aug 25, 2017):
Thanks for the quick update! Really appreciate that.
I try to give the best possible Feedback, so its easier for you to solve the Problem. Its a win-win ;-). You make great Software and deserve good Feedback to enhance it.
Regarding the sending logic:
It is irritating that you can send an EMail which partly fails to deliver but the Message "Message sent" pops up. It would be better to have it say "Failed to send Message(partly)" and keep the Compose open including content.
An Idea is to send the local copy first(to the Sent-Folder) to make sure you can send it again, even on fail. But currently the missing Mail in Sent is the only way to tell if a Message is not transmitted completly.
Another display thing I described above alrdy, but copied it down so its not lost:When inspecting an EMail under "Sent" The "To" and "CC"-Field containThis might be an Serverproblem - i cannot tell yet. If you like I can make a seperate Issue for that.Grüße Ulf
<3
@jasonmunro commented on GitHub (Aug 28, 2017):
Should have some time to fix the display issues around this tomorrow. Still working out how I want to handle the "failed to send to all recipients issue". After I fix the display bugs I think I will close this and open a new issue for that specific problem.
@ulfgebhardt commented on GitHub (Sep 7, 2017):
I somehow still have trouble sending EMail - they do not reach destination on some unknown occasions :(
I think it might be space related:
"Peter Worldcitizen" <peter@world.org>Grüße Ulf
<3
@jasonmunro commented on GitHub (Sep 7, 2017):
Sorry I have not had time to dig into your issues here, been super busy with work this past week. I have not run into this issue - I'm going to try to reproduce it now.
@jasonmunro commented on GitHub (Sep 12, 2017):
@ulfgebhardt I merged some address parsing code paths that I think will resolve the issue of the E-mail not showing up in the reply fields. I'm unable to reproduce this problem unless I have an invalid format (quotes inside the angle brackets), but this merge should fix that as well.
@ulfgebhardt commented on GitHub (Sep 13, 2017):
Mostly fixed.
Two Things Remain:
Problem 1:
Problem 2:
Rev:
26a3870e58Grüße Ulf
<3
@ulfgebhardt commented on GitHub (Jan 2, 2018):
Clsoing in Favor of #246