Mailing List CGatePro@mail.stalker.com Message #92171
From: Johan Wynne <johan.wynne@further.se>
Subject: Re: Store mail on two locations simultaneously.
Date: Mon, 13 Aug 2007 11:21:24 +0200
To: CommuniGate Pro Discussions <CGatePro@mail.stalker.com>
Graeme Fowler skrev:
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


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <CGatePro@mail.stalker.com>.
To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
Send administrative queries to  <CGatePro-request@mail.stalker.com>
  
Ok, thanks Graeme and Stefan. We will try to get it to work somehow.
/ Regards, JW
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster