DISQUS

Doug Hellmann: MailArchiveByDate - Sort Mail.app Messages into Archive Folders

  • karl · 10 months ago
    In .procmailrc

    MONTH=`date +%Y/%m`
    YEAR=`date +%Y`
    umask 022

    :0 ic
    * ? test ! -d $MAILDIR/$YEAR
    | mkdir -p $MAILDIR/$YEAR

    :0:
    *
    $MAILDIR/$MONTH
  • Doug Hellmann · 10 months ago
    That would sort the incoming mail into year/month folders instead of your inbox, right? It would be useful if you had access to the server and could install a .procmailrc. I don't on at least one of my mail servers.
  • rachel · 3 months ago
    this is wonderful. One of my favorite scripts of all time! Thank you very much

    I had a huge backlog of emails to archive, and it felt too overwhelming to create the folders, etc. This script filed over 1,000 emails in under 5 minutes. OK, maybe 7 minutes when I take into account that I customized the name of the Archive folder (zArchive so it's not at the top of the email folders)
  • Doug Hellmann · 3 months ago
    Hi, Rachel, I'm glad you found it useful. Thanks for posting the performance information, too. I don't think I've ever used it on that many emails at one time.