-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncate email addresses that are more than 244 characters long #4708
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is fine - but what's the consequences for replying in the in the UI?
Yes, that was one of my concerns: Replying just won't work. I've added the "" substring to make it more clear to the user that the email address is not usable anymore. But, let's be honest, emails coming from such addresses are most probably spam |
True. Is the "" substring clearly identifiable by the user? |
(fun "" ("< t r u n c a t ed >") seems to have been truncated by Github) Not much indeed but we could use it to show it differently in the frontend (in red? with an exclamation mark?) |
I'm not sold on the idea of a special string in the email address. Partly because that doesn't work with translations. Thinking of other issues where we can't fully read an email, e.g. when the encoding of the subject is problematic, there could be a |
The time for a migration would be now. I like the idea of having an error state for mails, this could be very useful. |
cd49e9c
to
bbba855
Compare
lib/Db/MessageMapper.php
Outdated
@@ -341,7 +341,7 @@ public function insertBulk(Account $account, Message ...$messages): void { | |||
$qb2->setParameter('message_id', $messageId, IQueryBuilder::PARAM_INT); | |||
$qb2->setParameter('type', $type, IQueryBuilder::PARAM_INT); | |||
$qb2->setParameter('label', mb_strcut($recipient->getLabel(), 0, 255), IQueryBuilder::PARAM_STR); | |||
$qb2->setParameter('email', $recipient->getEmail(), IQueryBuilder::PARAM_STR); | |||
$qb2->setParameter('email', mb_substr($recipient->getEmail(),0 , 255), IQueryBuilder::PARAM_STR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted to drop the <truncated>
because it would be tricky with translations
bbba855
to
58eef3d
Compare
Signed-off-by: Cyrille Bollu <[email protected]> Signed-off-by: Christoph Wurst <[email protected]>
58eef3d
to
c363cd0
Compare
/backport to stable3.3 |
/backport to stable2.2 |
The backport to stable3.3 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable3.3
git pull origin stable3.3
# Create the new backport branch
git checkout -b fix/foo-stable3.3
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable3.3 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
/backport to stable3.2 |
Fixes #3608
Signed-off-by: Cyrille Bollu [email protected]