[Dovecot] list all emails from command line?

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Tue Jun 3 06:11:31 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 2 Jun 2014, Joseph Tam wrote:
> So something like this for dumping the INBOX contents
>
> 	#!/bin/sh
>
> 	master-user=masteru
> 	master-password=masterp
>
> 	while read user server; do
> 	netcat --ssl $server 993 <<_EOF_ >${user}.report
> 	1 LOGIN ${user}*${master-user} ${master-password)
> 	2 SELECT INBOX
> 	3 ...
> 	4 LOGOUT
> 	_EOF_
> 	done
>
> I don't know enough IMAP to fill in "3 ..." to dump all headers, but I'm
> sure it's not hard to find out.

3 fetch 1:* RFC822.HEADER

> It's even simpler if you don't need to do it remotely: just use
>
> 	doveadm fetch -A hdr MAILBOX '*'

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBU41nFHz1H7kL/d9rAQIEkggAoqpjh3Yn/0lJbGSf9D4zI/TO8utmUGtK
ZqmZ/j9KOm7+GvaS3z4WqlIkwfYFqIgTuiLBn9bHU6Dzynr+DDD8ydqGxiaQa3WY
XgDQv6xU/bti4NXMZtpRxKg8r/SXW3Y/N36Y9sH3yYf7LTopQh1rW9cEdiyWY8c5
AjPmSdzxXnlmrwCCtJvjEPjvSZbIN2ilAXPMaDCbDNKZM7/VNvB+Yi8P7c6zdq6s
Hdjn9h4FEqoB9zgiEGC1z4YSzVjaTGS7a+1+gS7WUJ6BX1al04eT4FlTu4WetTU8
mJmZAO/c8OA/+1FO1HW2u3FRhd1gIH/CRigfuGgfT7hwN3xcej1FPA==
=gzhc
-----END PGP SIGNATURE-----


More information about the dovecot mailing list