Sunday, 15 June 2025

mutt

 # Create new mailbox in IMAP
        + When located in mailbox list (c)
                shift + C

# Move multiple messages to folder (bulk operations)

  1. Select/tag them with alt+'t'
  2. ;s in mail inbox overview for bulk operation


# Deleting / Undeleting all messages in mutt

  1. In mutt’s index, hit ‘D’ (UPPERCASE D)
  2. It will prompt you with “Delete messages matching: “
    • + enter this string:
    • ~A
    • It should mark all for deletion!
    • Conversely, you can do the same thing with UPPERCASE U to undelete multiple messages.

=================Set up Mutt with Gmail using OAuth2=============
First obtain an OAuth 2.0 Client ID and Secret from the Google Cloud Console.
Publish app in Google Cloud Console or set to Testing and add Test users
Download the mutt_oauth2.py
Edit/add client_id and secret_id in google section
/home/user/.mutt/accounts/mutt_oauth2.py --authorize /home/user/.mutt/accounts/user\@gmail.com.tokens --verbose
 OAuth2 registration: google
 Preferred OAuth2 flow ("authcode" or "localhostauthcode" or "devicecode"): authcode
 Account e-mail address: user\@gmail.com
Visit displayed URL to retrieve authorization code. Enter code from server

edit ~/.muttrc as per your configuration or edit ~/.mutt/accounts/account.com.gmail.user

unset imap_pass
unset smtp_pass
unset imap_authenticators
unset imap_oauth_refresh_command
unset smtp_authenticators
unset smtp_oauth_refresh_command
set imap_user = "user@gmail.com"
set smtp_url = "smtp://user@gmail.com@smtp.gmail.com:587/"
set from = "user@gmail.com"
set realname = "user"
set folder = "imaps://imap.gmail.com:993"
set imap_authenticators="oauthbearer:xoauth2"
set imap_oauth_refresh_command="/home/user/.mutt/accounts/mutt_oauth2.py /home/user/.mutt/accounts/${imap_user}.tokens"
set smtp_authenticators=${imap_authenticators}
set smtp_oauth_refresh_command=${imap_oauth_refresh_command}
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set header_cache = ~/.mutt/com.gmail.user/cache/headers
set message_cachedir = ~/.mutt/com.gmail.user/cache/bodies
set certificate_file = ~/.mutt/com.gmail.user/certificates
set trash = +'Deleted'
set signature = ~/.mutt/signature_gmail
set ssl_starttls = yes
set ssl_force_tls = yes

================= 

TermRecord

TermRecord is a simple terminal session recorder with easy-to-share self-contained HTML output! TermRecord -o /tmp/session.html