updated by /home/nico/bin/sync-all-repos on nb3
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
This commit is contained in:
parent
27455b101b
commit
18d05d9b37
2 changed files with 27 additions and 0 deletions
0
fix-duplicate-mail-ids
Normal file → Executable file
0
fix-duplicate-mail-ids
Normal file → Executable file
27
fix-maildir-mbsync-duplicate-uid
Executable file
27
fix-maildir-mbsync-duplicate-uid
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Nico Schottelius, 2024-05-08
|
||||||
|
# Can also be run in a loop with:
|
||||||
|
# for uid in $(find . | grep -o 'U=.*:' | sort | uniq -d | sed -e 's/U=//' -e 's/:$//') ; do fix-maildir-mbsync-duplicate-uid $uid; done
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo $0 UID
|
||||||
|
echo "Remove the UID from the newer message"
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAIL_UID=$1
|
||||||
|
|
||||||
|
i=0
|
||||||
|
|
||||||
|
for mail in $(ls *U=${MAIL_UID}:*); do
|
||||||
|
i=$((i+1))
|
||||||
|
# Do not rename the first one
|
||||||
|
if [ $i = 1 ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Rename all others
|
||||||
|
new_name=$(echo $mail | sed 's/,U=.*//')
|
||||||
|
|
||||||
|
echo "Renaming $mail to $new_name"
|
||||||
|
mv $mail $new_name
|
||||||
|
done
|
Loading…
Reference in a new issue