Discussion:
smart saving
Ben Fitzgerald
2018-11-01 23:06:30 UTC
Permalink
Hi

has anyone ever written something for mutt that allows for "smart saving"?

I'm thinking, if you use gmail then everything gets dumped into your inbox,
and therefore you typically need to save stuff in a folder. This at least
is my usage pattern for non-mailing lists (mailing lists go straight to
their folder).

When I hit "s" it would be lovely to have the last folder I saved a message
with the same "meta" (simple case - same "from:").

Thinking about how to implement this, I'd basically need to:

* pipe the msg to a script in a subshell
* script reads in some saved state of "last save folder + meta pattern"
* get the "from:"
* map over the metas for a match
* spit out the folder
* leave mutt with =my/correct/folder waiting for me to hit return

Anyone aware of such a thing?

Anyone got any comments on improvements/suggestions why it's a bad idea?

I can imagine people will not like saving state, however you could
just dump it into the mutt header cache directory.

Regards,
--
Ben Fitzgerald
Erik Christiansen
2018-11-02 01:48:20 UTC
Permalink
Post by Ben Fitzgerald
When I hit "s" it would be lovely to have the last folder I saved a message
with the same "meta" (simple case - same "from:").
That is the mutt default, in my experience. Since that is never useful
here, I set save-hooks to meet local needs. While most of mine set a
second archive mailbox for each delivery mailbox, there is one which
parallels your use-case:

fcc-save-hook '%L fam_grp' family

That sets "family" as the default save destination for anything from
anyone I've listed in a "alias -group fam_grp rita ***@example.com"
line. It's an fcc-save-hook rather than just a save-hook to put my
replies there as well. Now _that_ is smart, and seems far more useful
than spraying emails disc-wide based on nothing more than "From:".

Erik
Ben Fitzgerald
2018-11-02 12:23:31 UTC
Permalink
Post by Erik Christiansen
Post by Ben Fitzgerald
When I hit "s" it would be lovely to have the last folder I saved a message
with the same "meta" (simple case - same "from:").
That is the mutt default, in my experience. Since that is never useful
here, I set save-hooks to meet local needs. While most of mine set a
second archive mailbox for each delivery mailbox, there is one which
fcc-save-hook '%L fam_grp' family
That sets "family" as the default save destination for anything from
line. It's an fcc-save-hook rather than just a save-hook to put my
replies there as well. Now _that_ is smart, and seems far more useful
than spraying emails disc-wide based on nothing more than "From:".
Interesting, I'll check this out. My "From:" example was a bit too
contrived. Ultimately I'd like this for work, where I end up with
many emails, from the same 50 people, that could be about different
things. It might hash the subject and then dump it into the same
folder I put in the first time.

Ben.
--
Ben Fitzgerald
Jon LaBadie
2018-11-02 20:19:38 UTC
Permalink
Post by Ben Fitzgerald
Post by Erik Christiansen
Post by Ben Fitzgerald
When I hit "s" it would be lovely to have the last folder I saved a message
with the same "meta" (simple case - same "from:").
That is the mutt default, in my experience. Since that is never useful
here, I set save-hooks to meet local needs. While most of mine set a
second archive mailbox for each delivery mailbox, there is one which
fcc-save-hook '%L fam_grp' family
That sets "family" as the default save destination for anything from
line. It's an fcc-save-hook rather than just a save-hook to put my
replies there as well. Now _that_ is smart, and seems far more useful
than spraying emails disc-wide based on nothing more than "From:".
Interesting, I'll check this out. My "From:" example was a bit too
contrived. Ultimately I'd like this for work, where I end up with
many emails, from the same 50 people, that could be about different
things. It might hash the subject and then dump it into the same
folder I put in the first time.
Don't know if this is something you can use.

I store may received email in mbox format under ~/Mail/<mboxfile>.
Mutt will automatically create the file the first time I receive
and save the email, using the sender's email name.

For some situations it is better to have one mbox for multiple
email addresses. For example, I communicate with several people
from one business office and would prefer to read emails from
them as a group rather than individuals.

For that I designate one file as "master", and make the other
email names links (hard or soft) to the master. Then mutt saves
to the current email address but this is simply a link to the
master "office email address".

I also do this for individuals who use multiple emails. And for
people with hard to remember email names (who can remember that
"enzulumeti" is actually Susan :).

Jon
--
Jon H. LaBadie ***@jgcomp.com
11226 South Shore Rd. (703) 787-0688 (H)
Reston, VA 20190 (703) 935-6720 (C)
Continue reading on narkive:
Loading...