Thunderbird: Difference between revisions
Line 144: | Line 144: | ||
# |
# |
||
# Usage: python3 extract_mails.py |
# Usage: python3 extract_mails.py |
||
# Source: ChatGPT |
|||
import mailbox |
import mailbox |
Latest revision as of 09:39, 1 September 2024
Keyboard shortcuts
From Keyboard Shortcuts TB:
M | Mark message as read / unread |
R | Mark thread as read |
Add-Ons
Currently in use
- New version compatible with latest TB (cufrently Nostalgy++ 3.2.17 on Thunderbird 91.8.0)
- Tip: Scroll folder list without selecting folder: H
- Old version: Nostalgy
- Worked very well on TB 52.
- Note: Auto-completion does not appear at first.
- Alternative: Quick Folder Move (not tried)
- Copy Sent To Current
- Allows to (additionally) save a copy of sent messages to the current folder or choose folder on send
- Not working when used with MRC Compose.
- Provides standards fields (TO, CC, BCC) with autocomplete to Thunderbird's compose pane. (See bugzilla 440377).
Tested or no longer used
- Nostalgy is a better alternative
PGP support
Reference: https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq
OpenPGP
- Enable GPG in account settings.
- Import private key
# To export all private keys, for later import in TB:
gpg --export-secret-keys --armor > my-secret-keys.asc
- Select the private key for the account.
- Import GPG public key ring.
Enigmail - GPG support
- New Enigmail no longer supported, GPG support is now built-in
Recommended settings for Enigmail
- Disable loading of IMAP parts on demand
- Disable flowed text (RFC 2646)
- View message body as plain text
- Use 8-bit encoding for message sending
- Do not compose HTML messages
Fix Message Integrity errors
This is due to last Enigmail policy to not decrypt anymore without MDC.
To get freedom back, rebuild Enigmail as follows [1]:
Clone the repository:
git clone https://gitlab.com/enigmail/enigmail/
git checkout enigmail-2.0.8
diff --git a/package/errorHandling.jsm b/package/errorHandling.jsm
index 15f561a..f87554e 100644
--- a/package/errorHandling.jsm
+++ b/package/errorHandling.jsm
@@ -303,14 +303,6 @@ function decryptionInfo(c) {
let mdcMethod = lineSplit[1];
let aeadAlgo = lineSplit.length > 3 ? lineSplit[3] : "0";
-
- if (mdcMethod === "0" && aeadAlgo === "0") {
- c.statusFlags |= EnigmailConstants.MISSING_MDC;
- c.statusFlags |= EnigmailConstants.DECRYPTION_FAILED; // be sure to fail
- c.flag = EnigmailConstants.MISSING_MDC;
- EnigmailLog.DEBUG("errorHandling.jsm: missing MDC!\n");
- c.retStatusObj.statusMsg += EnigmailLocale.getString("mdcError") + "\n";
- }
}
}
Rebuild:
./build.sh
In Thunderbird, uninstall previous add-on and install the new one from file.
Tips
Automatically sync all folders in Thunderbird
From here:
- open the Config Editor (Tools → Options → Advanced → General → Config Editor),
- change the
mail.server.default.check_all_folders_for_new
setting to true.
Filter incoming messages based on Bcc:
Say you have subscribed to mailing list, sending to XYZ@mail.com
, and want to move these messages to a custom folder.
- Create a new filter
- In the header list, click Customize..., and create a custom header named
Delivered-To
. - Use rule
Delivered-To
containsXYZ@mail.com
.
Silent SoGo 'no changes' notification
This is very annoying. Everytime SoGo synchronizes, we get a pop up notification, most of the time saying "no changes" [2].
To silent:
- Open address book.
- Right click on SoGo account book, then 'properties'.
- Untick 'show notifications'.
Disable Ctrl-Enter / Send Now shortcut
By default, ctrl-enter in TB triggers Send Now action.
To disable this behaviour:
- Install Dorando Keyconfig add-on.
- Compose a new mail
- In the mail composition window, go to Tools → Keyconfig, then select
Send Now
shortcut and click on disable.
Apply current column selection to all folders
This is done by choosing Apply columns to... in the same drop down list that appear when clicking the button Select columns to display in the top of the message list. Select Folder... to apply selection to a single folder or Folder and its children... to apply the selection recursively.
Change account order
This requires to install an extension, or to edit file prefs.js [3]:
/* mail.accountmanager.accounts - list active accounts, in order of appearance */
user_pref("mail.accountmanager.accounts", "account22,account4,account3,account17,account19,account20,account21,account2");
/* mail.accountmanager.defaultaccount - define default account. Will ALWAYS appear first */
user_pref("mail.accountmanager.defaultaccount", "account22");
Print all mails in a folder
A small script to print all mails in a folder stored by Thunderbird (mbox format):
# Print content of folder 'logcheck'
#
# Usage: python3 extract_mails.py
# Source: ChatGPT
import mailbox
from email import policy
from email.parser import BytesParser
# Path to the logcheck mbox file
mbox_file = 'logcheck'
# Open the mbox file
mbox = mailbox.mbox(mbox_file)
# Iterate over each email in the mbox file
for message in mbox:
# Parse the email to handle decoding
msg = BytesParser(policy=policy.default).parsebytes(message.as_bytes())
# Extract and print the email body (ignoring the headers)
if msg.is_multipart():
# If the email is multipart, we need to find the part with the text content
for part in msg.iter_parts():
if part.get_content_type() == 'text/plain':
print(part.get_payload(decode=True).decode(part.get_content_charset() or 'utf-8'))
else:
# If it's not multipart, the payload is the message body
print(msg.get_payload(decode=True).decode(msg.get_content_charset() or 'utf-8'))
# Close the mbox file
mbox.close()
Troubleshoot
Sent folder not updated
Like a corruption of the TB database [4]. Go to ~/.thunderbird/*.default:
sqlite3 global-messages-db.sqlite vacuum
Mail not deleted
Deleting a mail seems a hard task in Thunderbird [5]:
- Set mail.imap.expunge_after_delete to true.
Also, in account settings, make sure that the option server Settings -> Remove it immmediately is selected.
Missing mails, IMAP folder not synced
- Right click on IMAP folder, select Properties.
- In the General Information tab, click Repair Folder button.
Sync bugs
- About IDLE, and CONDSTORE flag/support.
Proxy not working
- Proxy does not work with IMAP. See bug 1263295 and bug 1230823.
- Refuse to connect to localhost in all possible ways.
- Only work-around is to keep the proxy disabled, and enabled it only when e.g. to sync Owncloud address book.
Broken text edition mode
- Relevant bugs bugzilla 216132, bugzilla 140800
- Relevant posts mozillazine
- My bug bug 1288914
Fix:
- In Preferences → Composition → General → HTML Font, select Variable Width. This way this makes apparent that edition is in HTML mode. Also, there will not be a weird font change when pasting text at the end of a reply.
- To force text-edition mode, use Shift-click on either Write, reply or forward.
IMAP folder list not updated
- Relevant questions on SO question 392320
- Thunderbird does a refresh on startup. One can force a refresh by collapsing / expanding the parent folder in folder tree view.
Cannot dismiss reminders
I keep getting reminder about a past birthday, although I dismissed it several times.
- Workaround — Uncheck "Show missed reminder" under Preferences > Calendar > Reminders [6].
Big emojis appearing in the message list
See this bug.
The fix was to install fonts-symbola:
sudo apt install fonts-symbola