Skip to content

Commit

Permalink
#70 first version of rbox admin tools
Browse files Browse the repository at this point in the history
first version is able to list all objects for given dovecot user.
cmdline arguments:
-p <poolname> -U <user>

e.g. 
rbox_list_objects -p mail_storage -U t1

+ minor refactoring. (X_ATTR defines moved to Rados-mail-object),
size_t to string conversion.
  • Loading branch information
jrse committed Aug 18, 2017
1 parent 7f3ac9d commit 18f6e41
Show file tree
Hide file tree
Showing 10 changed files with 549 additions and 51 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ AC_CONFIG_FILES([
Makefile
src/Makefile
src/librmb/Makefile
src/librmb/tools/Makefile
src/dict-rados/Makefile
src/storage-rbox/Makefile
lib/Makefile
Expand Down
7 changes: 4 additions & 3 deletions src/librmb/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

SUBDIRS = \
tools

AM_CPPFLAGS =

AM_CXXFLAGS =
Expand All @@ -22,5 +24,4 @@ headers = \
rados-mail-object.h

pkginc_libdir=$(pkgincludedir)
pkginc_lib_HEADERS = $(headers)

pkginc_lib_HEADERS = $(headers)
43 changes: 43 additions & 0 deletions src/librmb/rados-mail-object.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,49 @@

namespace librmb {

enum rbox_metadata_key {
/*
* mailbox global unique id the mail currently is in.
*/
RBOX_METADATA_MAILBOX_GUID = 'M',
/* Globally unique identifier for the message. Preserved when
copying. */
RBOX_METADATA_GUID = 'G',
/* POP3 UIDL overriding the default format */
RBOX_METADATA_POP3_UIDL = 'P',
/* POP3 message ordering (for migrated mails) */
RBOX_METADATA_POP3_ORDER = 'O',
/* Received UNIX timestamp in hex */
RBOX_METADATA_RECEIVED_TIME = 'R',
/* Physical message size in hex. Necessary only if it differs from
the dbox_message_header.message_size_hex, for example because the
message is compressed. */
RBOX_METADATA_PHYSICAL_SIZE = 'Z',
/* Virtual message size in hex (line feeds counted as CRLF) */
RBOX_METADATA_VIRTUAL_SIZE = 'V',
/* Pointer to external message data. Format is:
1*(<start offset> <byte count> <options> <ref>) */
RBOX_METADATA_EXT_REF = 'X',
/* Mailbox name where this message was originally saved to.
When rebuild finds a message whose mailbox is unknown, it's
placed to this mailbox. */
RBOX_METADATA_ORIG_MAILBOX = 'B',

RBOX_METADATA_MAIL_UID = 'U',
RBOX_METADATA_VERSION = 'I',
/*
* Mails from envelope
*/
RBOX_METADATA_FROM_ENVELOPE = 'A',
RBOX_METADATA_PVT_FLAGS = 'C',
/* metadata used by old Dovecot versions */
RBOX_METADATA_OLDV1_EXPUNGED = 'E',
RBOX_METADATA_OLDV1_FLAGS = 'F',
RBOX_METADATA_OLDV1_KEYWORDS = 'K',
RBOX_METADATA_OLDV1_SAVE_TIME = 'S',
RBOX_METADATA_OLDV1_SPACE = ' '
};

class RadosMailObject {
public:
RadosMailObject();
Expand Down
7 changes: 7 additions & 0 deletions src/librmb/tools/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/src/librmb

bin_PROGRAMS = rbox_list_objects
rbox_list_objects_SOURCES = rbox_list_objects.cpp

rbox_list_objects_LDADD = ../librmb.la
Loading

0 comments on commit 18f6e41

Please sign in to comment.