[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cpx] Re: [vps2] automated management of virtmaps



Jared,

Ok, you and Sherm and Scott have now got my curiosity up.

What would be the reason behind you giving me the long perl script that basically does (in the end) the same thing that the 3 liner that Sherm gave me does? I notice that one using the VSAP::Client and the other is using the VSAP:Server. I assume that the client just weeds stuff out and plays with the data before it feeds it to the server command. Yes?

Jonathan

--------------------------------------
#!/usr/bin/perl
use VSAP::Server::Modules::vsap::mail;
VSAP::Server::Modules::vsap::mail::update_entry( 'joe@xxxxxxxx' => 'joeuser');
--------------------------------------
## Other commands I found while browsing through VSAP
## VSAP::Server::Modules::vsap::mail::add_entry($sourceaddr . $sourcedomain, $dest); ## VSAP::Server::Modules::vsap::mail::update_entry($sourceaddr . $sourcedomain, $dest);
## VSAP::Server::Modules::vsap::mail::delete_entry($source);
--------------------------------------

----------------------------------------------------------------
#!/usr/bin/env perl

use VSAP::Client;

if(@ARGV != 2) {
       print "Usage: $0 source dest\n";
       exit;
}
$source = $ARGV[0];
$dest = $ARGV[1];

$vsap = new VSAP::Client(Debug => 0);
$vsap->authenticate('ADMIN_USER', 'PASSWORD', 'HOSTNAME');

$cmd = '<vsap xmlns:cp="http://vsap.org/cp";>' .
               '<vsap type="mail:addresses:add">' .
                       '<source>' . $source . '</source>' .
                       '<dest>' . $dest . '</dest>' .
               '</vsap>' .
       '</vsap>';vsap
$response = $vsap->send($cmd);

$vsap->quit;
----------------------------------------------------------------

======================================================================
This is <cpx@xxxxxxxxxxxxx>      <http://www.groupmail.org/lists/cpx/>
Before posting a question, please search the archives (see above URL).


Home | Main Index | Thread Index
Match: Format: Sort by:
Search: