Random email archiving things

getmail

# File: ~/.getmail/getmailrc

[retriever]
type = SimpleIMAPSSLRetriever
server = imap.server.com
username = xxxUSERxxx
password = xxxPASSWORDxxx
# mailboxes = ("INBOX", "Sent Items", "tax")
mailboxes = ALL

[destination]
type = Maildir
path = ~/gmMaildir/

[options]
verbose = 1
read_all = false
delete = false

redate.sh

#!/bin/bash

for FILE in $(find ./new -type f); do \
  csplit --quiet $FILE /X-getmail-retrieved-from-mailbox/
  DATE=$(grep "^Date: .*$" xx00 | sed "s/Date: //g")
  rm xx00 xx01

  DATE=$(echo "$DATE" | perl -p0e "s/\n.+//g" \
   | perl -p0e "s/[A-Z]{3} ([0-9]{2}), ([A-Z]{3} [0-9]{4})/\1 \2/g" \
   | sed "s/^%//g" \
   | sed "s/ZE10//g" \
   | sed "s/^Jan, //g" \
   | sed "s/ 1100$/ +1100/g" \
   | sed "s/ 1000$/ +1000/g"
  )

  echo $(date -d "$DATE") " " $FILE
  touch -d "$DATE" $FILE
done;

doveadm

Location of doveadm on synology: /volume<x>/@appstore/MailPlus-Server/bin/

import

doveadm import -u isaac maildir:/home/isaac/gmMaildir "INBOX" HEADER "X-getmail-retrieved-from-mailbox" "INBOX"

index

doveadm index -u isaac INBOX