Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mutt and monthly delete old messages

498 views
Skip to first unread message

Mark Fletcher

unread,
Sep 26, 2016, 10:40:03 AM9/26/16
to
Hi

I'm aware there are large number of proponents of Mutt on this list, and
so I thought I'd give it a whirl.

I've got fetchmail downloading from my gmail account only the folder
that I have Google Inbox putting all the list messages for this list in,
and forwarding them to my local user on my PC. I use exim4 for an MTA on
my machine, running Jessie.

Net result -- all the list mails, except the ones I send (thanks Google)
in one muttable folder on my machine. For now this is great, but the
number of mails will get out of hand. It's not really sensible to
aggressively delete mails after reading them as you never know when a
thread is going to end, and it's nice to be able to look back at the
previous messages in a thread. Say what you like about Google Inbox (and
I am sure some of you will), at least there you can mark messages as
Done and if the thread gets resurrected the previous messages will
return so you can scroll back to them if you want. On the other hand I
thought I'd try mutt because it seems to make a far better job of
helping me stay within the rules of this list when posting.

So I was thinking of implementing a policy of deleting messages from
this mail folder on my PC (the one Mutt is looking at) on a say monthly
basis. Looking at the mutt documentation I think it can do something
like that but it seems to be assuming separate folders within one's
local mail file, and I am just using the mail file directly. Call me
thick but I'm not understanding how I could get mutt to do this, and
certainly not how I could get it to do it automatically. I want this to
happen in the background, I don't want to have to initiate it. I am
using the default style of mail file mutt sets up if you don't ask it to
do anything special when you first launch it after installing from the
Debian repository.

Any advice on the smoothest way to get background archiving (which in
this case means deletion) of old messages in this scenario? I'm not
married to a Mutt solution, any solution that will automatically delete
the right mails at the right time is fine. Gene I think you have
mentioned in the past that you have something in place for this don't
you?

Thanks

Mark

Brian

unread,
Sep 26, 2016, 11:10:04 AM9/26/16
to
On Mon 26 Sep 2016 at 23:36:54 +0900, Mark Fletcher wrote:

> Any advice on the smoothest way to get background archiving (which in
> this case means deletion) of old messages in this scenario? I'm not
> married to a Mutt solution, any solution that will automatically delete
> the right mails at the right time is fine. Gene I think you have
> mentioned in the past that you have something in place for this don't
> you?

I don't do what I think you want to do but archivemail (which is in
Debian) looks worth exploring,

--
Brian.

Mark Fletcher

unread,
Sep 26, 2016, 7:00:04 PM9/26/16
to
Description: archive and compress or delete your old email
Archivemail moves old mail out of a mailbox (in Maildir, MH, or mbox format, or
via IMAP) and archives it in a compressed mbox-format mailbox file. It
is well
suited to be run from cron for automatic archiving of your old mail.
Archivemail can also just delete old mail so it is useful for cleaning up
mailing list or spam mailboxes.

Lifted that from aptitude show archivemail. This is perfect, exactly
what I was after! Thanks Brian!

Mark

Jochen Spieker

unread,
Oct 2, 2016, 5:30:03 PM10/2/16
to
Mark Fletcher:
>
> So I was thinking of implementing a policy of deleting messages from
> this mail folder on my PC (the one Mutt is looking at) on a say monthly
> basis.

If you prefer a mutt-only solution (without archivemail) you could also
use a hook to mark all mails older than 30 days for deletion whenever
you open the corresponding mailbox.

Untested, adapt "debian" to match your mailbox name:

folder-hook =debian 'push "<delete-pattern> ~d>30d\n"'

Mutt will then mark older messages for deletion when you enter the
mailbox and ask for confirmation when you quit mutt, change to a
different mailbox or press '$'.

J.
--
I am not scared of death but terrified of people in Tommy Hilfiger
sweatshirts.
[Agree] [Disagree]
<http://archive.slowlydownward.com/NODATA/data_enter2.html>
signature.asc

Jonathan Dowland

unread,
Oct 3, 2016, 6:00:05 AM10/3/16
to
On Tue, Sep 27, 2016 at 07:53:57AM +0900, Mark Fletcher wrote:
> Lifted that from aptitude show archivemail. This is perfect, exactly
> what I was after! Thanks Brian!

Another vote for archivemail from me. I have a local patch to mine to add a feature
to delete a mailbox if, after archiving, it would be empty. Which reminds me that I
tried to get it upstream, which turned into trying to get a feature added to the
Python mailbox API, which was pretty damn difficult and I gave up trying to convince
the maintainer of my use-case. But I have the patch (both in Python library form and
as a monkeypatch in archivemail itself) if anyone wants it. Maybe one day I'll have
the time and inclination to try again with Python (it was the beginning of a long
road: it would have gone into Python 3, and archivemail needs a lot of other work to
get it working in Python 3 anyway)


--
Jonathan Dowland
Please do not CC me, I am subscribed to the list.
signature.asc
0 new messages