-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Customize presentation of accept/decline buttons in iMip mail #12392
Customize presentation of accept/decline buttons in iMip mail #12392
Conversation
config/config.sample.php
Outdated
* 'dav.invitation_link_recipients' => false, | ||
* | ||
*/ | ||
'dav.invitation_link_recipients' => '*', // always include accept/reject server links in iMip emails |
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.
For nextcloud servers accessible to the public internet, the default
"dav.invitation_link_recipients" value "true" (all recipients) is appropriate.
I guess the default here should be true
?
💥 Yes, you are correct, thanks! 💥 Fixed. |
@@ -144,11 +144,11 @@ public function schedule(Message $iTipMessage) { | |||
|
|||
$summary = $iTipMessage->message->VEVENT->SUMMARY; | |||
|
|||
if (parse_url($iTipMessage->sender, PHP_URL_SCHEME) !== 'mailto') { | |||
if (strcasecmp(parse_url($iTipMessage->sender, PHP_URL_SCHEME), 'mailto') !== 0) { |
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.
Note: One more place where mailto scheme comparison should be case insensitive (if the event contained MAILTO, then it would not have properly been detected). This is related to the fix nextcloud/calendar@82fc0a9 by @georgehrke.
Another note: It occurs to me that RFC5545 defaults ATTENDEE rsvpparm to RSVP=FALSE. Perhaps the invite buttons should only be presented when (a) the attendee has a mailto, and (b) the method is REQUEST, and (c) RSVP=TRUE. (The examples in the RFC suggest it would be set false for optional attendees and non-individuals, e.g. resources). The code does not currently look at the RSVP parameter, as far as I can tell. May I ask @georgehrke or @MorrisJobke for advice? I'm happy to put it in if it seems the right thing to do. |
Hi @brad2014, Thx for your pull-request!
If the attendee doesn't have a mailto, we can't send this email anyway, so that's already the case.
Will be done by this pull-request, correct?
Most of this is not done in Nextcloud directly, but in Sabre/Dav. |
My notes: The sabre ITip code properly passes the client's RSVP parameter through unchanged, except when processing an incoming reply (to remove the RSVP=TRUE parameter when an RSVP has been received). Other than that, it is up to the client to decide when RSVP's are desired (e.g. apps/calendar (at the UI) or server/dav (by nextcloud policy) chooses whether rsvp's are desired from "required" or "optional" participants, and, on the other end, the server/dav/lib/CalDAV/Schedule/IMipPlugin.php must decide what to present in emails when the organizer (or nextcloud by policy) has set RSVP to true or false when they created the event that generates the REQUEST. |
I need to learn how to use phpUnit. :-) I'll look for a doc that tells me how to set up my local machine to run nextcloud tests (pointers welcome). |
@georgehrke or @MorrisJobke : I'm looking at the existing tests, to find a model for a new unit test, and I think I need some guidance. I'm not sure where to ask, so I'll ask here. I hope you don't mind.
What am I missing?
|
Did you ran |
Thanks.
Thanks. Not sure how I missed it - the docs are clear. |
I think I've figured it out. I will write some unit tests shortly. |
Fix Issue #11230 Only present accept/decline button links in iMip mail for REQUEST, not CANCEL or others. Fix Issue #12156 Implement config setting "dav.invitation_link_recipients", to control which invitation recipients see accept/decline button links. The default, for public internet facing servers, is to always include them. For a server on a private intranet, this setting can be set to the email addresses or email domains of users whose browsers can access the nextcloud server referenced by those accept/decline button links. It can also be set to "false" to exclude the links from all requests. Signed-off-by: Brad Rubenstein <brad@wbr.tech>
Signed-off-by: Brad Rubenstein <brad@wbr.tech>
If RSVP=TRUE parameter is FALSE or absent for an ATTENDEE, then do no present accept/decline buttons. The organizer isn't asking for an RSVP. Signed-off-by: Brad Rubenstein <brad@wbr.tech>
My oops. The comparisons, which are copied from the IMipPlugin shipped with sabre-io/dav, do not need to be case insensitive because the sender and recipient names are normalized by sabre, (see calls to getNormalizedValue in voboject/lib/ITip/Broker.php). Signed-off-by: Brad Rubenstein <brad@wbr.tech>
Existing tests required modification to correctly mock up the new config parameter fetch, and to set the RSVP flag for attendees (since the test was detecting token generation, and we no longer generate tokens when no RSVP is requested by the client or sent by nextcloud). Signed-off-by: Brad Rubenstein <brad@wbr.tech>
Signed-off-by: Brad Rubenstein <brad@wbr.tech>
@georgehrke, I have added unit tests per your suggestion - In the server-generated iMIP email, I'm using link token generation as a surrogate for whether buttons and links are added (the test doesn't actually look at the generated HTML - perhaps it should). I also did the following:
The tests pass, I should add, pass 😄. |
[This is my first pull request for nextcloud - if you all have any suggestions or concerns about my code or process, I'm very interested in hearing them.] |
Hi @brad2014 - sorry that we didn't had time to look into this for the Nextcloud 16 milestone. We were quite busy with other tasks. We still appreciate the work you put into this, but the freeze for Nextcloud 16 is active since last Friday and I will put this into the Nextcloud 17 bucket. I hope that is okay for you. |
Per @georgehrke change request for PR #12392, instead of setting dav.invitation_link_recipients in the system config.php file, we set it in the database table oc_appconfig. Furthermore, the value of the config variable is always a string: 'yes' to include links in imip mail, 'no' to exclude them, or a comma-separated list of email addresses and/or domains for which they should be included. If not specified in oc_appconfig, the default is 'yes'. Signed-off-by: brad2014 <brad2014@users.noreply.github.com>
@georgehrke I have addressed all your review comments on the branch, but I'm not sure if the next step is for me to do something to remove the "Changes Requested" blocker, or if that's something you do after additional review. Please advise. Thank you! |
@brad2014 The changes requested blocker will go after another review. It's already late in Germany, but i will look into this first thing tomorrow morning. :) |
Thank you (didn't mean to rush anyone, just wasn't sure if I needed to do anything). |
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.
👍
Let me check why CI didn't start
Per @georgehrke change request for PR #12392, instead of setting dav.invitation_link_recipients in the system config.php file, we set it in the database table oc_appconfig. Furthermore, the value of the config variable is always a string: 'yes' to include links in imip mail, 'no' to exclude them, or a comma-separated list of email addresses and/or domains for which they should be included. If not specified in oc_appconfig, the default is 'yes'. Signed-off-by: brad2014 <brad2014@users.noreply.github.com>
Per @georgehrke change request for PR #12392, instead of setting dav.invitation_link_recipients in the system config.php file, we set it in the database table oc_appconfig. Furthermore, the value of the config variable is always a string: 'yes' to include links in imip mail, 'no' to exclude them, or a comma-separated list of email addresses and/or domains for which they should be included. If not specified in oc_appconfig, the default is 'yes'. Signed-off-by: brad2014 <brad2014@users.noreply.github.com>
CI is happy: https://drone.nextcloud.com/nextcloud/server/20598 |
please review @rullzer @juliushaertl @ChristophWurst :) |
Fix Issue CalDAV Mail Invitations: Bogus Invite/Accept upon deleted person #11230
Only present accept/decline button links in iMip mail for REQUEST, not CANCEL or others.
Fix Issue Support iMip emails that don't link to server, for nextcloud servers on a private network #12156
Implement config setting "dav.invitation_link_recipients", to control
which invitation recipients see accept/decline button links. The
default, for public internet facing servers, is to always include
them. For a server on a private intranet, this setting can be set
to the email addresses or email domains of users whose browsers can
access the nextcloud server referenced by those accept/decline
button links. It can also be set to "false" to exclude the links
from all requests.
Signed-off-by: Brad Rubenstein brad@wbr.tech