-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Prevent new users/members to be stored in db when invite fails #5350
Prevent new users/members to be stored in db when invite fails #5350
Conversation
What about the CollectionUser records? Wouldn't they need to be deferred as well? |
Ah yes that needs to be moved to. |
I also wonder if this is the right way to go btw. I think it's better to save the objects, and upon mail failure, delete the items. The only thing i would then put after sending an email is adding the user to the groups and collections. |
3ff5bf7
to
d0a49b9
Compare
Ok, I made some changes. Instead of deferring, I now delete the records if sending the mail fails. I did moved creating the groups and collection records to after sending the mail, as those need the other records anyway. |
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.
Looks good to me. Even if it does not prevent sending mails to non-existent hosts.
Not sure if that is something that we can fix because that's something that happens after the mail has been successfully received by the MTA
an 07 12:38:23 mx postfix/lmtp[2296669]: 8573C4078F: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.1, delays=0.28/0.1/0.02/4.7, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5703C40709
an 07 12:38:23 mx postfix/qmgr[1824492]: 8573C4078F: removed
an 07 12:38:23 mx postfix/smtp[2296676]: 5703C40709: to=<[email protected]>, relay=none, delay=0.36, delays=0.09/0.25/0.02/0, dsn=5.1.0, status=bounced (Domain example.com does not accept mail (nullMX))
That will be difficult indeed, also, sometimes MTA's use graylogging, which could cause these kind of messages. |
Currently when a (new) user gets invited as a member to an org, and SMTP is enabled, but sending the invite fails, the user is still created. They will only not have received a mail, and admins/owners need to re-invite the member again. Since the dialog window still keeps on-top when this fails, it kinda invites to click try again, but that will fail in mentioning the user is already a member. To prevent this weird flow, this commit will delete the user, invite and member if sending the mail failed. This allows the inviter to try again if there was a temporary hiccup for example, or contact the server admin and does not leave stray users/members around. Fixes dani-garcia#5349 Signed-off-by: BlackDex <[email protected]>
Signed-off-by: BlackDex <[email protected]>
6056005
to
f4130f7
Compare
Currently when a (new) user gets invited as a member to an org, and SMTP is enabled, but sending the invite fails, the user is still created.
They will only not have received a mail, and admins/owners need to re-invite the member again.
Since the dialog window still keeps on-top when this fails, it kinda invites to click try again, but that will fail in mentioning the user is already a member.
To prevent this weird flow, this commit will delete the user, invite and member if sending the mail failed.
This allows the inviter to try again if there was a temporary hiccup for example, or contact the server admin and does not leave stray users/members around.
Fixes #5349