342 shaares
45 liens privés
45 liens privés
1 résultat
taggé
dovecot
In case somehow, you got duplicate mails in a maildir, like me, maybe this is helpful to you:
?
1
find /var/mail/user -type d -name cur -print0 | xargs -0 /usr/bin/fdupes -n | less
Of course you need fdupes installed. On debian:
?
1
apt-get install fdupes
The above command is the dry run, showing you the duplicates.
Then to delete the duplicates, leaving only the first found file:
?
1
find /var/mail/user -type d -name cur -print0 | xargs -0 /usr/bin/fdupes -ndN | less
Use the same thing again with “new” instead of “cur” if you have duplicate unread mails. This only looks at duplicates within the same folder, so you can also safely run it on /var/mail for all users.