KISS

Keep It Simple Stupid

Removing unexpected event attendees in Thunderbird

| comments

I’m using Thunderbird as the email client for a few mailboxes. It’s a generally nice client (I like the keyboard shortcuts), but with a few rough corners. For example, I got a calendar invitation once and clicked Accept, but the acceptance email was sent from a different account. It wasn’t a very big deal in that case, but still quite uncomfortable.

I’ve been burned once there, so when I received another invitation, I clicked Accept without immediate response. Then there is the “Details…” button when you select the invitation email… and I saw the wrong email again. So the bug isn’t fixed yet (at least for my use case). This question was asked here: https://support.mozilla.org/en-US/questions/1206863 with reference to bug 589081.

Since you don’t use Lightning, you can’t change the Email entry in Calendar Properties, so at the moment it seems the only option is to set another account as Default in Account Settings/Account Actions. This is only worth doing if all invitations are sent to the same account.

This is good enough for me (at least for now). To do that, I right-clicked on the mailbox and opened “Settings”; then there is the “Account Actions” button in the bottom-left corner where you can “Set as Default” the correct account. I did that, clicked Accept without sending a response again and the Attendees section in the invitation details window now showed the correct accepted email. Success? Not yet, because that section also showed the old, wrong email as accepted too. I was afraid that in this state Thunderbird would send emails from both the accounts about the acceptance. But how do you remove that old attendee?

I tried changing the default email back to the previous account and declining the invitation, but the program continued to display both. There is no way to do anything with the attendees in that window. So time to dig deeper.

The simplest way was to look where this information is stored. I did nothing in Thunderbird for a few minutes, then changed the accepted status for the invitation and ran this command in the profile directory (in my case on OS X it’s $HOME/Library/Thunderbird/Profiles/abcdefgh.default, see more here):

1
2
$ ll **/*(.mm-3)
-rw-r--r--  1 user  staff  459120 Dec  5 10:37 calendar-data/local.sqlite-wal

This zsh command lists all regular files (*(.)) in any subdirectory (**/) that have been modified within the last 3 minutes ((mm-3)). And I’ve found a SQLite database with a proper name! Let’s quit Thunderbird and see what’s inside. This lists all calendar events:

1
2
3
4
$ sqlite3 calendar-data/local.sqlite
sqlite> select id, title, datetime(last_modified / 1e6, 'unixepoch', 'localtime'), ical_status from cal_events;
event0@example.com|Event 0|2020-05-01 18:10:00|CONFIRMED
event1@example.com|Event 1|2020-12-05 10:37:21|CONFIRMED

I need to edit “Event 1” with id event1@example.com. We can list all its attendees:

1
2
3
4
sqlite> select item_id,cal_id,icalstring from cal_attendees where item_id = 'event1@example.com';
event1@example.com|aaaaffff-f1eb-5f42-9932-bbbbccccdddd|ATTENDEE;CN=My wrong name;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT:mailto:wrong@email.com
event1@example.com|aaaaffff-f1eb-5f42-9932-bbbbccccdddd|ATTENDEE;RSVP=TRUE;CN=My right name;PARTSTAT=ACCEPTED;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;X-NUM-GUESTS=0:mailto:right@email.com
event1@example.com|aaaaffff-f1eb-5f42-9932-bbbbccccdddd|ORGANIZER;CN=source@example.com:mailto:source@example.com

I see the wrong email indeed. There are three items for the event: the first is the old, wrong email, the second is my correct email, and the third one is the sender’s email. All I need to do is to delete the entry for the wrong email:

1
2
3
4
5
sqlite> DELETE FROM cal_attendees WHERE item_id = 'event1@example.com' AND icalString LIKE '%wrong%';

sqlite> select item_id,cal_id,icalstring from cal_attendees where item_id = 'event1@example.com';
event1@example.com|aaaaffff-f1eb-5f42-9932-bbbbccccdddd|ATTENDEE;RSVP=TRUE;CN=My right name;PARTSTAT=ACCEPTED;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;X-NUM-GUESTS=0:mailto:right@email.com
event1@example.com|aaaaffff-f1eb-5f42-9932-bbbbccccdddd|ORGANIZER;CN=source@example.com:mailto:source@example.com

Ctrl+D to quit the sqlite3 REPL. After starting Thunderbird, the old email was finally gone from the Attendees list and I was able to send the acceptance email from the correct address. Phew. But it was needlessly complex.

Comments