Bob Marčan via users wrote: > I have a bunch of recipes with the same content, appearing > with different headers and subjects. I would like to get > rid of emails with the same content regardless of the > header or subject. I tried mdedup, but I couldn't find the > right parameters. Can anyone help me?
I've never used that tool¹, but without knowing what you tried, it's hard to guess whether that tool can do what you need or not. At a glance, it seems like you might be able to limit the hashed headers to something like From (if they're all from a single address) or some other single header that is common to all messages² and `--hash-body normalized` (or raw, if all the body content is identical). If the issue is the From and/or Subject headers don't match, you could perhaps export all the messages to an mbox file and then use `sed -i 's/^From:.*/From: <[email protected]>'/` to make them all match so `--hash-header From` sees them as identical? Or even inject a random header and then use that as the lone `--hash-header` option to mdedup. Short of that, my first through when reading this question was that it wouldn't be _too_ hard to write a python³ script to process all the messages with python's email module and then compare the body however you like. Are you planning to keep the recipes in email or are you extracting them to save as text files elsewhere? If so, dumping the body content to files and deduplicate might be an option. There are decent odds someone has written a tool to do close to or even exactly what you want. Would it take more time looking for that to versus writing it yourself (or tweaking one that is available and pretty close)? That is the unknown. :) ¹ I presume https://kdeldycke.github.io/mail-deduplicate/ is what you mean? ² You can specify some header like MIME-Version that may be less likely to differ across messages, as opposed to anything which is directly editable by the mail sender. If you sent all of the mail, the User-Agent header could work. ³ Or perl or any other (non-shell) language you prefer. You _could_ do it with shell, but I don't imagine it would be very fast not fun in almost any way. -- Todd
signature.asc
Description: PGP signature
-- _______________________________________________ users mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/[email protected] Do not reply to spam, report it: https://forge.fedoraproject.org/infra/tickets/issues/new
