Mailing List CGatePro@mail.stalker.com Message #92167
From: Graeme Fowler <G.E.Fowler@lboro.ac.uk>
Subject: Re: Store mail on two locations simultaneously.
Date: Mon, 13 Aug 2007 08:54:07 +0100
To: CommuniGate Pro Discussions <CGatePro@mail.stalker.com>
X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6)
On Mon, 2007-08-13 at 09:39 +0200, Stefan Seiz wrote:
> There is no option in CGP i know of which does exactly what you describe
> above.

Directly there isn't, no. However the External Helper protocol would
work, almost trivially.

http://www.communigate.com/CommuniGatePro/Helpers.html#Filters

You could very easily write a helper which does a simple "cp" on the
file passed by the CGP server. In Perl (but you could use anything):

while (<>) {
  chomp;
  if ($_ =~ /\d+ FILE (.+)/) {
    open FILE, "< $1" or die "Couldn't open $1: $!\n";
    open TARGET, "> /path/to/backups/$1" or die "Couldn't write backup:
$!\n";
    while (<FILE>) {
      print TARGET;
    }
  }
}

Where $1 is the pattern matched in brackets in the "if" line.

The problem with this approach is that basic copy this will give you a
backup, but it won't be directly usable by CGP since the filename format
will be completely wrong. It shouldn't be too hard to extrapolate the
file format and make it DTRT, however.

Graeme

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster