* Chris Green <c...@isbd.net> [2022-01-23 13:59]:
> This is a bit off topic for mutt specifically but it's about doing
> things to the mail I read using mutt, so it's not *very* OT.  :-)
> 
> I'm looking for a way to keep an archive (as in a maildir hierarchy)
> of *all* my mail into which I can merge my current (S[aved] in to
> using mutt) maildir hierarchy.
> 
> This isn't just a straight copy of everything as there will be some
> (quite a lot of) overlap.  I.e. I will keep mail dating back to (say)
> 2010 in my current, seen directly by mutt, mail hierarchy and I will
> want to merge this into the archive at (say) monthly intervals so
> there will be some years of E-Mails that are in both hierarchies.
> 
> Both hierarchies will be on the same computer so it isn't an IMAP
> synchronisation tool I'm looking for.  These are just directory trees
> full of maildir mailboxes.
> 
> I will, if necessary, write it myself, probably in Python but I don't
> want to reinvent the wheel if I don't have to.

Recommended tool is "sieve" form and sieve language to sort emails:

GNU Mailutils
https://mailutils.org/

In my particular example I am using the command line "sieve" to save mbox

function save-maildir-by-to () {
    sieve -f /home/admin/Maildir/Sent.mbox.2021 
"/home/data1/protected/Programming/System 
Administration/sieve/save-by-to.sieve" && echo Sieve DONE.
}

And
/home/data1/protected/Programming/System Administration/sieve/save-by-to.sieve
being following:

require [ "fileinto", "variables" ];
if address :matches [ "to" ] "*" {
  set "recipient" :lower "${1}";
  fileinto "~/Maildir/${recipient}";
            }

You may look into the sieve language and sort emails by other
means. You also need to give the default maildir option to sieve. It
can convert from one format to other. Thus you could sort it by date
or anyhow.

What I recommend is that every conversation with per...@example.com is
saved in ~/Maldir/per...@example.com

Then by single click on the email from per...@example.com I am
launching new instance of mutt to review all previous emails related
to this person. Isn't that handy?

Then by clicking q, I exit the new instance of mutt and come back to
original email.

Then I have database backed CRM system, so if I wish to find any
person, that person may have assigned multiple email addresses and I
can then review them with single click or by choice within mutt. Mutt
is then opening "mutt -f ~/Maildir/someem...@example.com" in new
terminal, but it can work in console as well.

To understand sieve language, look in the manual of GNU Mailutils.




-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/

Reply via email to