惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Project Zero
Project Zero
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
Know Your Adversary
Know Your Adversary
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
AWS News Blog
AWS News Blog
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
AI
AI
美团技术团队
人人都是产品经理
人人都是产品经理
S
Secure Thoughts
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
宝玉的分享
宝玉的分享
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
Google Online Security Blog
Google Online Security Blog
L
LINUX DO - 最新话题
罗磊的独立博客
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
博客园 - 【当耐特】
K
Kaspersky official blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Apple Machine Learning Research
Apple Machine Learning Research
F
Full Disclosure
Google DeepMind News
Google DeepMind News
V
V2EX
博客园 - 聂微东
量子位
云风的 BLOG
云风的 BLOG
C
Check Point Blog
J
Java Code Geeks
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
Engineering at Meta
Engineering at Meta
V2EX - 技术
V2EX - 技术
Vercel News
Vercel News
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog

Abhijith PA | അഭിജിത്ത് പി എ

Patience could've saved me time. Removing spams from your local maildir Bug squashing party, Kochi A lazy local file sharing setup abhijithpa.me to abhijithpa.in A new(kind of) phone Running Debian on my phone Attending FOSSASIA 2023 Running PostmarketOS on my phone Laptop refreshment Trip to misty mountains in Munnar Changing LCD screen of car infotainment system Part-2 Transition from Thunderbird to Mutt Workstation setup Debian packaging session DebUtsav Delhi I am Debian Developer now FOSSASIA experience My Laptop Going to FOSSASIA 2018 Swatantra17 Debian {Developers, Maintainers} in Kerala
Transition from Thunderbird to Mutt
Abhijith PA · 2021-01-16 · via Abhijith PA | അഭിജിത്ത് പി എ

I was going OK with Thunderbird and enigmail(though it have many problems). Normally I go through changelogs before updating packages and rarely do a complete upgrage of my machine. Couple of days ago I did a complete upgrade of system which updated my Thunderbird to latest version and throwing of enigmail plugin for using their native openPGP support. There is a blog from Mozilla which I should’ve read earlier. Thunderbird’s builtin openPGP functionality is still in experimental, atleast not ready for my workflow. I could’ve downgrade to version 68. But I chose to move to my secondary MUA, mutt. I was using mutt for emails and newsletters that I check twice in a year a so.

So I started configuring mutt to handle my big mailboxes. It took three evenings to configure mutt to my workflow. Though the basic setup can be done in less than an hour it is the small nitpicks consumed much of my time. Currently I have isync to pull and keep mails offline. Mutt to read, msmtp to send, abook as the email address book and urlview to see the links in mail. I am still learning notmuch and virtual mailbox ways to filter.

Mutt

There are ton of articles out there to configure mutt and all related things to it. But I find certain configs very hard to get. So I will write down those.

  • As a long Thunderbird user, I still want my mailbox index to look in a certain way. I used;

     set date_format="%d/%m/%y %I:%M %p"
     set index_format="%3C | %Z %?X?@& ? %-22.17L %-5.50s %> %-22.20D"
    

    This gives following order - serial number, various flags (if there is an attachment, it will shows ‘@’), sender, subject and to extreme right there will be date and time (12h local) of mail

  • If use nano to write mails you can use
    set editor="nano --syntax=email -r 70 -b"
    

    to get 70 char length and mail related syntax highlighting

  • mutt has a way to make new mail notification. The new_mail_command can be used to execute a custom script upon new mail, such as running notify-send. There are many standalone mail notifier such as mailnag, mail notification etc. It all just felt bulky for me. So I ended up making these.

    #!/bin/sh
    accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")"
    for account in $accounts; do
         acc="$(echo "$account" | sed "s/.*\///")"
         new=$(find "$MAILBOX/$acc/Inbox/new/" -type f -newer "$MUTT/.mailsynclastrun" 2> /dev/null)
         newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
         if [ "$newcount" -gt "0" ]; then
                 for file in $new; do
                 # Extract subject and sender from mail.
                 from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')
                 subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n')
                 displays="$(pgrep -a Xorg | grep -wo "[0-9]*:[0-9]\+")"
                         for x in $displays; do
                                 export DISPLAY=$x
                                 notify-send -i $MUTT/mutt.png -t 5000 "$account received new message:" "$from: <i>$subject</i>"
                         done
                 done
         fi
    done
    touch "$MUTT/.mailsynclastrun" 
    

    And hooked to mail_new_command. This code snippet is from lukesmith’s mutt-wizard, I barely modified to meet my need. Currently it only look in to ‘Inbox’. I need to modify to check other mailbox folders in future.

So far, everything going okay.

Cons

  • some times mbsync throws EOF and secret key not found error.
  • searching is still a pain in mutt
  • nano’s spell checker also check things which I am replying to.

More to come

Well for now I moved mail from part of the Thunderbird. But Thunderbird was more than a MUA to me. It was my RSS reader, calendar and to-do list manager. I will write more about those once I make a complete transition.