Github messages for mblaze
 help / color / mirror / Atom feed
From: Anachron <Anachron@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: The proper way to delete mails?
Date: Fri, 27 Oct 2023 09:32:25 +0200	[thread overview]
Message-ID: <20231027073225.QIi71qzPVL7aJvlGvxFW5aB0RLHqhPf8251yztEgEJA@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-236@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

New comment by Anachron on mblaze repository

https://github.com/leahneukirchen/mblaze/issues/236#issuecomment-1782438887

Comment:
To give you another idea on how to do it, I wrote a script to automatically move old mails to an "ARCHIVE" mailbox which isn't synced back to the server.

This way I don't clutter my inbox while still being able to read them later if needed to.

```sh
#!/bin/sh

MAILACC="${1}"
MAILINBOX="${HOME}/usr/mls/${MAILACC}/INBOX"
MAILARCHIVE="${HOME}/usr/mls/${MAILACC}/ARCHIVE"
MAILYEAR=$(echo "$(date +%Y) -2" | bc -s)

test -d "${MAILINBOX}" || exit 1

! test -d "${MAILARCHIVE}" && mmkdir "${MAILARCHIVE}"
printf 'Searching for messages older than %s-01-01\n' "${MAILYEAR}"
ml=$(mlist "${MAILINBOX}" | mpick -t 'date <= "'"${MAILYEAR}"'-01-01"' | msort -d)
test -n "${ml}" || { printf 'Nothing found!\n'; exit; }
printf 'Archiving %s messages\n' $(printf '%s\n' "${ml}" | wc -l)
printf '%s\n' "${ml}" | mrefile "${MAILARCHIVE}"
printf 'Creating inbox sequence\n'
mlist "${MAILINBOX}" | msort -r -d > "${HOME}/usr/mls/${MAILACC}/inbox.seq"
printf 'Creating archive sequence\n'
mlist "${MAILARCHIVE}" | msort -r -d > "${HOME}/usr/mls/${MAILACC}/archive.seq"
```

  parent reply	other threads:[~2023-10-27  7:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 13:39 [ISSUE] " hills
2023-03-30 13:43 ` leahneukirchen
2023-03-30 14:02 ` hills
2023-03-30 14:06 ` leahneukirchen
2023-03-30 14:06 ` leahneukirchen
2023-03-30 14:13 ` hills
2023-10-27  7:32 ` Anachron [this message]
2024-09-11 19:56 ` [ISSUE] [CLOSED] " leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231027073225.QIi71qzPVL7aJvlGvxFW5aB0RLHqhPf8251yztEgEJA@z \
    --to=anachron@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).