Menu

Tree [eb393f] master /
 History

HTTPS access


File Date Author Commit
 doc 2021-11-05 Gergely Szasz Gergely Szasz [5ca2d7] Initial commit
 examles 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release
 wsdl 2021-11-05 Gergely Szasz Gergely Szasz [5ca2d7] Initial commit
 AUTHORS 2021-11-05 Gergely Szasz Gergely Szasz [5ca2d7] Initial commit
 COPYING 2021-11-05 Gergely Szasz Gergely Szasz [5ca2d7] Initial commit
 ChangeLog 2021-11-05 Gergely Szasz Gergely Szasz [5ca2d7] Initial commit
 INSTALL 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release
 README.md 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release
 THANKS 2021-11-05 Gergely Szasz Gergely Szasz [5ca2d7] Initial commit
 gwarch.pl 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release
 gwarchiver-common.pl 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release
 gwautoarch.pl 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release
 gwlist.pl 2021-11-08 Gergely Szasz Gergely Szasz [eb393f] Initial release

Read Me

Groupwise (third party) archiving tool gwarchiver 0.9

These perl scripts are commad line tools to list/archive/unarchive
mails on a groupwise post office (POA) or groupwise archive directory

What gwarchiver does have:

  • not so much, you can use config files for tune parameters and
    control scripts

Help! <xyz> doesn't work</xyz>

If you're having a problem using/running gwarchiver scripts, the place
you're most likely to get help is the official forums at
https://sourceforge.net/p/gwarchiver/discussion/

What you'll need to run gwarchiver scripts

Linux (or maybe other uni*x like OS)

Required:

  • curl
  • perl and perlio:gzip perl module

Windows

  • it may work on windows, but i never tested.

Why not GW autoarchive?

Because the autoarchive "service" is very limited:
* archive only readed messages
* the archive task run only when the user logon with GW client:
so disabled, proxied or "webmail" boxes never archived
* you only set the age of items to be archive (older than)

Note: the disabled users emails cannot be archived by these scripts,
because we have to "login" as well...

Gergely Szasz szaszg@hu.inter.net
4th November, 2021

Usage

There are three scripts:
* gwlist.pl -- list emails of users in online mailbox or in archive database
* gwarch.pl -- archive or unarchive emails from a list (created by gwlist.pl)
if you create gwunarch.pl symlink to gwarch.pl the default is to
unarchive mails
* gwautoarch.pl -- automatically archive emails

Groupwise trusted app

These scripts use the groupwise SOAP service with the "trustedapplication"
authentication method to process all users postboxes.

  • add a trusted application in your groupwise server: https://10.16.10.24:9710/gwadmin-console/index.jsp#system:main
    (you have to use your server IP address instead of 10.16.10.24 and
    admin-console port instead of 9710. 9710 is the default port)
    "Trusted Applications" -> New... -> fill the Name field (and other fields
    if you want) after "OK" GW show the key. "Export" or copy because you
    cannot see again, GW show it only once.
    ("Listen very carefully, I shall say zis only once..." :)

  • Now you can change your default TRUSTNAME and TRUSTKEY to created ones in
    gwarchiver-common.pl. (%CONF = ...) or you have to use config files.

gwlist.pl

Synopsis

gwlist.pl [@configfile.conf|@ configfile.conf] [-a] [user1,user2,user3,user4,...]

Description

List users emails to a csv (tsv) file.

configfile.conf -- configuration file
-a -- list emails from an archive ($CONF{ARCHIVEPATH})
user1,user2,... -- specify users to process

Configuration

The configuration file is a perl script, which override the %CONF hash:

  $CONF{WEBAUTH}   = 'admin:000000'; #the username and password for web api 
  $CONF{WEBURL}    = 'https://10.16.10.22:9710/gwadmin-service/list/USER';
                                     #the URL of the web api
  $CONF{TRUSTNAME} = 'gwarchiver';   #the name of the trusted application
  $CONF{TRUSTKEY}  = 'ABCD.....EF';  #the key of the trusted application
  $CONF{URL}       = 'https://10.16.10.22:7191/soap'; #the URL of SOAP service
  $CONF{ARCHIVEPATH} = '/mnt/GWARCHIVE/', #the path of groupwise archive
                                          #(on the server)
  $CONF{LIST}      = 'list.csv'; #the path and name of the list file
  $CONF{DATEFR}    = '1970-01-01T00:00:00Z'; #list emails created after this
                     date (>=)
  $CONF{DATETO}    = '2030-01-01T00:00:00Z'; #list emails created before this
                     date (<)

gwarch.pl

Synopsis

gwarch.pl [@configfile.conf|@ configfile.conf] [-u] [user1,user2,user3,user4,...]

Description

Archive or unarchive users' emails listed in a csv (tsv) file
(generated by gwlist.pl).

configfile.conf -- configuration file
-u -- unarchive emails from an archive ($CONF{ARCHIVEPATH})
user1,user2,... -- specify users to process

Configuration

The configuration file is a perl script, wich override the %CONF hash:

  $CONF{WEBAUTH}   = 'admin:000000'; #the username and password for web api 
  $CONF{WEBURL}    = 'https://10.16.10.22:9710/gwadmin-service/list/USER';
                                     #the URL of the web api
  $CONF{TRUSTNAME} = 'gwarchiver';   #the name of the trusted application
  $CONF{TRUSTKEY}  = 'ABCD.....EF';  #the key of the trusted application
  $CONF{URL}       = 'https://10.16.10.22:7191/soap'; #the URL of SOAP service
  $CONF{ARCHIVEPATH} = '/mnt/GWARCHIVE/', #the path of groupwise archive
                                          #(on the server)
  $CONF{LIST}      = 'list.csv'; #the path and name of the list file
  $CONF{DATEFR}    = '1970-01-01T00:00:00Z'; #list emails created after this
                     date (>=)
  $CONF{DATETO}    = '2030-01-01T00:00:00Z'; #list emails created before this
                     date (<)
  $CONF{ARCHIVE}   = ''; #if non empty, list archive instead of online PO
  $CONF{CHECK}     = 'archivepath:.mounted';  #semicolon separated list of
                         #checks performed before run. Now only 'archivepath'
                         #exists. it check the file after colon is exists. if
                         #not script exit with an error
  $CONF{MAXILEN}   = MAXILEN;  #if the processed mails itemid string longer
                               #than MAXILEN, we split the SOAP request
                               #multiple POST instead of one big
  $CONF{SKIPFILE}  = ''; #a file hold the list of userids to skip
  $CONF{SKIP}      = ''; #list of userids to skip (SKIPFILE override the
                         #SKIP list

gwautoarch.pl

Synopsis

gwautoarch.pl [@configfile.conf|@ configfile.conf] [user1,user2,user3,user4,...]

Description

Archive emails e.g. in a daily basis, running as a cron job.

configfile.conf -- configuration file
user1,user2,... -- specify users to process

Configuration

The configuration file is a perl script, wich override the %CONF hash:

  $CONF{WEBAUTH}   = 'admin:000000'; #the username and password for web api 
  $CONF{WEBURL}    = 'https://10.16.10.22:9710/gwadmin-service/list/USER';
                                     #the URL of the web api
  $CONF{TRUSTNAME} = 'gwarchiver';   #the name of the trusted application
  $CONF{TRUSTKEY}  = 'ABCD.....EF';  #the key of the trusted application
  $CONF{URL}       = 'https://10.16.10.22:7191/soap'; #the URL of SOAP service
  $CONF{ARCHIVEPATH} = '/mnt/GWARCHIVE/', #the path of groupwise archive
                                          #(on the server)
  $CONF{LIST}      = 'list.csv'; #the path and name of the list file
  $CONF{DATEFR}    = '1970-01-01T00:00:00Z'; #list emails created after this
                     date (>=)
  $CONF{DATETO}    = '2030-01-01T00:00:00Z'; #list emails created before this
                     date (<)
  $CONF{ARCHIVE}   = ''; #if non empty, list archive instead of online PO
  $CONF{CHECK}     = 'archivepath:.mounted';  #semicolon separated list of
                         #checks performed before run. Now only 'archivepath'
                         #exists. it check the file after colon is exists. if
                         #not script exit with an error
  $CONF{MAXILEN}   = MAXILEN;  #if the processed mails itemid string longer
                               #than MAXILEN, we split the SOAP request
                               #multiple POST instead of one big
  $CONF{SKIPFILE}  = ''; #a file hold the list of userids to skip
  $CONF{SKIP}      = ''; #list of userids to skip (SKIPFILE override the
                         #SKIP list

You should tune some parameters in the script file instead of use a
config file:

#########################################################################
#########################################################################
#########################################################################
$CONF{ARCHIVEPATH} = '/mnt/GWARCHIVE';
$CONF{LIST} = "$CONF{ARCHIVEPATH}/_gwautoarch/log-".`date +%F|tr -d "\n"`."-$$.csv.gz";
$CONF{DATEFR} = `date +%FT00:00:00Z --date -5year-1day|tr -d "\n"`;
$CONF{DATETO} = `date +%FT00:00:00Z --date -5year|tr -d "\n"`;
$CONF{SKIPFILE} = "$CONF{ARCHIVEPATH}/_gwautoarch/aarch-vip.lst";
#########################################################################

The default config archive only one day's emails 5 years ago. So if you run
it every day, your users online mailboxes hold only 5 year mails online.
e.g.: if your script runs at 2021-11-01 00:05:00 than archive mails created
between 2016-10-30 00:00:00 and 2016-11-01 00:00:00

2016-10-30 00:00:00 <= created < 2016-11-01 00:00:00

Examples

  • gwlist.pl @dom1po.conf

list all mails of all users according to config file

The default config values list online mails created between 1970-01-01 and
2100-01-01 and the mail source are 'received' or 'sent'. So appointments,
tasks or mails in Trash or Draft mails not listed (or archived).
You can change the dates, but the source is "hard coded" in the SOAP template.

  • gwlist.pl test_elek,gwtest1

list all mails of users: test_elek and gwtest1

  • gwlist.pl -a test_elek,gwtest1

list all archived mails of users: test_elek and gwtest1

If your archive path not '/mnt/GWARCHIVE' you have to change it in the
gwarchiver-common.pl or you have to use a config file.

  • gwarch.pl @oldmails.conf

oldmails.conf:

#!/bin/perl

$CONF{ARCHIVEPATH} = '/mail/archive';
$CONF{LIST} = 'oldmail.csv';
$CONF{DATETO} = '2015-01-01T00:00:00Z';
$CONF{SKIP} = 'vip_user1
vip_user2
vip_user3';

1;

archive mails listed in a list file according to oldmails.conf config file:
* listed in oldmail.csv - this file created by gwlist.pl
* mails created between 1970-01-01 and 2015-01-01
* but do not archive mails of vip_user1, vip_user2 and vip_user3
* archive to /mail/archive directory
* (you need /mail/archive/.mounted file because script check it by default)

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.