Dear Sirs,
I am also desperate because of this. I urgently needed to extract a few hundreds of emails with attachments, so I wrote a macro for me. I know it is stupid and dangerous, but it worked somehow and I have all my attachments extracted yet. I paste the bash script here, use it if you want, but be very careful. It only sends keys to the Thunderbird menu and it does actions without any feedback.
#!/bin/bash
#install xdotool
#sudo apt install xdotool
#Read carefully this script to understand it fully
#set your variables, namely $directory_attachments and shortcuts of xdotool
#I have German menu in Thunderbird so all keyboard shortcuts are different if you are in English Thunderbird or say Greek one. Then you have to modify the commands of xdootool.
#Take care, this script moves all your attachments into a temporary directory ~/$directory_today, where you can find them.
#When it runs, monitor, what it is doing - it is a stupid keyboard makro, it only sends keys to Thunderbird, it is no mistake prove program.
#Test it first with long delays, to see what is doing in your special enviroment.
window_script=$(xdotool getactivewindow) # it gets the PID number of this script
echo “Open Thunderbird”
echo “Sort emails according to attachment”
echo “Select the first email with an attachment to convert.”
echo “Now we should find the number of the window of Thunderbird.”
echo “Arrange windows on your desktop to see both - this script window and the window of Thunderbird.”
read -p “Press Enter and THEN activate window of Thunderbird and click on its title bar”
window_thunderbird=$(xdotool selectwindow )
echo $window_thunderbird > /tmp/thunderbird_pid.tmp
echo The Thunderbird has a PID number: $window_thunderbird
directory_attachments=~/directory_where_Thunderbird_stores_your_attachments_by_default
delay1=0.5s
delay2=1s # small attachments
delay2=1.5s # big attachments
delay3=1.5s # small attachments
delay3=3s # big attachments
number_emails=10 # 10 if you want to control only 10 email in a row
number_emails=1 # 1 if you want to extract only one email per time, say problems or big attchments
xdotool windowactivate $window_thunderbird
directory_today=ready$(date +%Y-%m-%d )
mkdir ~/$directory_today
i=1; # reset counter
while [ 1 ] # do for ever and ever
do
mv -v --backup=numbered $directory_attachments/* ~/$directory_today
#moves all attachments from default direcotry into new directory, not to be overwriten by Thunderbird
xdotool windowactivate $window_thunderbird
sleep $delay1
xdotool key alt+N # open menu Nachricht. Probably Messages in English menu
echo alt+N delay1
sleep $delay1
xdotool key h # open menu Anhängen - probably Attachement in English menu
echo h delay1
sleep $delay1
xdotool key a # open menu Alle abtrennen. Probably Extract All in English menu
echo a delay1
sleep $delay1 # name of file dialog
xdotool key Return
echo Return first delay2
sleep $delay2 # save of file dialog
xdotool key Return
echo Return second delay3
sleep $delay3 # saving
i=$(( $i + 1 )) # increase the counter
if [ $i -gt $number_emails ]; then
xdotool windowactivate $window_script
read -p “Press Enter to continue (Ctrl-C to break)”
i=1 # reset counter
fi
done
exit