imapdump

package module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 12 Imported by: 0

README

imapdump

workflow badge Go Reference

A tool for dumping emails to local in batch.

中文使用说明

Usage

Command

./imapdump -conf config.yaml

Configuration

dir: dump
accounts:
  # name, name of the subdirectory
  - name: username@mydomain.com
    # host, host and port for IMAP server, must be TLS
    host: imap.mydomain.com:993
    # username, username of login
    username: username@mydomain.com
    # password, password of login
    password: xxxxxxxxxxxxxxxxxxx
    # prefixes, mailbox name prefixes, if you are not sure of maibox names, you can check the log
    prefixes:
      - Archive # this will match 'Archive', 'Archives', 'Archived' and 'Archives/2022' etc
      - 存档

Container Image

Check GitHub Packages for available container images

Check Dockerfile for details

By default, container image will execute imapdump every 6 hours

All you need to do is to mount /data for data persistence, and put a config.yaml at /data/config.yaml

Notification

Execution result will be delivered to environment variable $NOTIFY_URL, if given, by HTTP POST.

{"text": "MESSAGE..."}

Credits

GUO YANKE, MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpAccount

func DumpAccount(ctx context.Context, opts DumpAccountOptions) (err error)

func DumpAccountMailbox

func DumpAccountMailbox(ctx context.Context, dir string, c *client.Client, mailbox string) (count int64, err error)

func DumpMessage

func DumpMessage(dir string, msg *imap.Message) (err error)

func DumpMessagePath

func DumpMessagePath(dir string, msg *imap.Message) string

func DumpMessagePathExisted

func DumpMessagePathExisted(dir string, msg *imap.Message) (ok bool, err error)

func SanitizeMessageID

func SanitizeMessageID(s string) string

Types

type DumpAccountOptions

type DumpAccountOptions struct {
	DisplayName string
	Dir         string
	Host        string
	Username    string
	Password    string
	Prefixes    []string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL