Imap-mail-archiver

From SME Server
Jump to navigationJump to search
Warning.png Work in Progress:
This page is a Work in Progress. The contents off this page may be in flux, please have a look at this page history the to see list of changes.


Warning.png Warning:
There is no contrib for this and you need to have a basic knowledge of IMAP







logo
MaintainerReetP
Urlhttps://nextcloud.com
Source: smeserver-
LicenceAGPLv3
Category

Cloud

Tags emailimap


Maintainer

John Crisp

Version

https://src.koozali.org/jcrisp/mail-archiver

Description

A simple IMAP email archiver for email stores locally and remotely, and storing in an ordered format.

Forked from

https://github.com/netconstructor/Imap4-Archiver

Installation

dnf install perl-Dotenv
mkdir git
cd git
git clone https://src.koozali.org/jcrisp/mail-archiver
cp env.example .env

Edit your .env and set your server details.

To impersonate another user you can use the format:

user*admin

Usage

Usage:

Action: All

From/To year go to separate Inbox/Sent year folders. Older than yearFrom go to Archives/old/Inbox|Sent

perl ./mailarchive.pl --action All --yearFrom YEAR --yearTo YEAR

Folder layout eg:

Mailbox/Archives/$year/Inbox
Mailbox/Archives/$year/Sent 
Mailbox/Archives/Old/Inbox
Mailbox/Archives/Old/Sent

Action: Years

From/To year go to separate Inbox/Sent year folders. Older than yearFrom are not touched

perl ./mailarchive.pl --action Years --yearFrom YEAR --yearTo YEAR

Folder layout eg:

Mailbox/Archives/$year/Inbox 
Mailbox/Archives/$year/Sent

Action: Before

Anything more than X days old go to Archives/old/Inbox|Sent

perl ./mailarchive.pl --action Before --daysOld DAYS ( >=7 )

Folder layout eg:

Mailbox/Archives/Old/Inbox
Mailbox/Archives/Old/Sent

Options:

Set the following to 0 to diable or 1 to enable

General script debugging:

[--debug]

IMAP advanced logging:

[--debugimap]

Copy but do not delete original:

[--debug-delete]

Other thoughts

Could probably write other layouts but it suited me for Thunderbird. Could cron for certain accounts eg admin archive every 3-0 days etc.

Not the fastest, but does what I want.

Could be more modular, could open the accounts DB and go through each user? Not sure about passwords.

Could be used in Smanager.

Bugs

Probably lots.

Changelog

Only released version in smecontrib are listed here.