XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum [Powered by Invision Power Board]
Printable Version of Topic
Click here to view this topic in its original format
XMail Forum > XMail Queue Manager > Xqm 1.36, Xqm/cmd 0.93, Agent 1.24 Released!


Posted by: hschneider Jul 14 2003, 10:56 AM
QUOTE

You can download the latest release of XQM, XQM/CMD and XQM Agent at
http://xmail.marketmix.com

--- Changes ---

Generally:
- Fixed a date problem
- New config settings FORCE_MAILROOT and FORCE_SERVICENAME
- WIN32: Registry keys are not needed anymore.
- A preflight thread clears the queue from zombie slog files and fills the system's file cache for faster queries.

XQM 1.36:
- Message- and queue size are monitored now.
- Diagnosis details tab in the inspector's dialog, which gives closer informations about errors.
- Built with latest wxWindows framework which fixes some XP issues
- Exporter exports file size and diagnosis field

XQM/CMD 0.93:
- Defrost messages from command line now.

XQM Agent 1.24:
- WIN32: Installing multiple service instances is now possible. Details see README.TXT in the Agent's program folder.
- Optional debug output informs about .conf file path and if MailRoot and servicename were forced.
- Some internal changes that caused a coredump on FreeBSD also went into this release.


Posted by: hschneider Jul 14 2003, 07:18 PM
If you downloaded today's release of XQM and its Agent for Win32 platform, make sure that their version is 1.36 (XQM) and 1.24 (Agent). The download links were pointing to the old archives for some hours. In that case please download again. Sorry for the inmommodities!

Posted by: hschneider Jul 15 2003, 07:46 AM
XQM AGENT 1.25 released!

This is for Linux and FreeBSD platform only. Fixes a bug which caused the Agent not to daemonize on some systems.
Download from http://xmail.marketmix.com

Posted by: BooT Jul 16 2003, 12:50 PM
Hey....!!!

I like this one....It is looking better and better!!! I think it is faster aswell!

just one Q...

What happened to the "To" Field?

Posted by: hschneider Jul 16 2003, 02:50 PM
Yes it's faster -- To-Field? It's still there ...

Posted by: BooT Jul 16 2003, 02:56 PM
Mine only got the "From" field in it...There is no "To" field there

LOL

How do i add it then?

???

Posted by: hschneider Jul 16 2003, 02:59 PM
What is your platform ?

Maybe the column width was dragged to 0 ... in that case delete the *.dat file inside the xqm folder. and restart xqm.

Posted by: BooT Jul 16 2003, 03:28 PM
Thanx...It worked now...

I like the Diagnosis when u "Inspect" te mail...very helpful and cool!

Well Done!

Posted by: hschneider Jul 16 2003, 03:41 PM
Fine smile.gif

Posted by: fonsy Sep 3 2003, 09:59 AM
QUOTE (hschneider @ Jul 14 2003, 11:56 AM)
QUOTE

You can download the latest release of XQM, XQM/CMD and XQM Agent at
http://xmail.marketmix.com
[...]

Hi.

When I try to download Xqm/cmd for win32 (http://xmail.marketmix.com/downloads/xqm_win32.zip), get a 404...

Posted by: hschneider Sep 3 2003, 10:29 AM
Ooops - fixed - thanks!

Posted by: fonsy Sep 3 2003, 01:11 PM
Thanks.

One question...

Can xqm-cmd conect to xqm agent in remote machine?

Posted by: hschneider Sep 3 2003, 01:15 PM
No. But you can run it by telnet or SSH on the remote machine itself.

Posted by: fonsy Sep 3 2003, 03:07 PM
I want to create a web page, hosted in a Win2K server, with the information that XQM can offer, from a XMail in a FreeBSD on LAN.

I try to install the agent in the FreeBSD and use xqm-cmd like client in the windows machine, and parse xqm-cmd's output with php...

I will look for another solution. :-)

Thanks.

Posted by: hschneider Sep 3 2003, 03:55 PM
I see ... e.g. you can call xqm/cmd on the bsd machine by a CGI, sending its output to your Win2K machine.

Posted by: fonsy Sep 3 2003, 11:55 PM
QUOTE (hschneider @ Sep 3 2003, 04:55 PM)
I see ... e.g. you can call xqm/cmd on the bsd machine by a CGI, sending its output to your Win2K machine.

I think about in first place.

The problem is that machine is only a mail server. Does not have apache, and no other services.

It did not want to resign to leave the maximum of resources for XMail.

In any case, I already solved it, at least at the moment (Very little *or nothing* elegant way).

I studied the protocol which you use between the agent and the XQM, putting proxy in the middle, and modifying an old ASP that it had for another thing.

query, soon query_status 1, hoping the 0 and to request query_result, parse the string ___NEXT___.

I think that it will work to me, while does not make an update of the agent.

I believe, I already saying, but I do not get tired to say it. You have done one of greatest XMail utilities, and port it to FreeBSD a great favor! :-)

Posted by: fonsy Sep 4 2003, 05:19 AM
QUOTE (fonsy @ Sep 4 2003, 12:55 AM)
QUOTE (hschneider @ Sep 3 2003, 04:55 PM)
I see ... e.g. you can call xqm/cmd on the bsd machine by a CGI, sending its output to your Win2K machine.

I think about in first place.

The problem is that machine is only a mail server. Does not have apache, and no other services.
[...]

In case of anyone are in seemed situation:

In order to make it more portable, and works as much in Windows as in UNIX, I passed it to PHP.

The final configuration:

Using CRON or AT (UNIX or Windows), Xqm-cmd does "query" every x minutes / hours.

The PHP file, requests the result of that query, but without updating it. Thus it goes very fast.

The code of the PHP is here: (I'm only test it on Windows, at this moment...)

CODE

<?

//Valores iniciales.
//Initial values


//IP del XQM-Agent
//XQM-Agent IP
$IP = "192.168.100.7";

//Puerto TCP del XQM-Agent
//XQM-Agent TCP Port
$Puerto = 8000;

//Error de TimeOUT en segundos
//TimeOUT error in seconds
$TimeOUT = 60;

//Retorno de carro y avance de línea
//Carrier return and line feed
$CrLf = chr(13).chr(10);
$Cr = chr(13);
$Lf = chr(10);

$Resultado = "";

$XML = "";
$Cabecera = "";

//Establecer conexión.
//Make conection
$XQM_Agent = fsockopen($IP, $Puerto, &$NroError, &$TextoError, $TimeOUT);

//Comprobar la conexión.
//Check if conected.
if(!$XQM_Agent) {
   echo "No se pudo establacer conexión!\n<br>(".$NroError.") ".$TextoError."<br>";
   exit();
}    


//Código XML
$XML = "<?xml version='1.0'?>".Chr(10);
$XML = $XML."<methodCall>".Chr(10);
$XML = $XML."<methodName>query_result</methodName>".Chr(10);
$XML = $XML."<params>".Chr(10);
$XML = $XML."</params>".Chr(10);
$XML = $XML."</methodCall>";

//Cabecera de la petición.
//Petition header.
$Cabecera = "POST /RPC2 HTTP/1.0".$CrLf;
$Cabecera = $Cabecera."Host: ".$IP.":".$Puerto.$CrLf;
$Cabecera = $Cabecera."User-Agent: Script chorra".$CrLf;
$Cabecera = $Cabecera."Content-Type: text/xml".$CrLf;
$Cabecera = $Cabecera."Content-Length: ".strlen($XML).$CrLf;


//Enviar la petición
//Send petition
fputs($XQM_Agent, $Cabecera.$CrLf.$XML.$CrLf);

//Guardar la respuesta en un buffer
//Save response in buffer.
$Buffer = fgets($XQM_Agent, 32);

//Si es la respuesta esperada, todo Ok.
//If is the waiting for answer, all Ok.
if ($Buffer='HTTP/1.0 200 OK'){

//Esperar por la respuesta (Cabecera + XML)
//Wait for response (Header and XML)
while ($Buffer = fgets($XQM_Agent,128)){

 //Ir acumulando la respuesta.
 //Accumulating responses.
        $Respuesta = $Respuesta.$Buffer;
}

}else{
//Si la respuesta no es la esperada, detener el proceso.
//If the answer we do not like, stop the process.
echo "<br>\nError de conexión...<br>\n".$Buffer;

}

//Cerrar la conexión.
//Close conection.
fclose($XQM_Agent);

//Separar la Cabecera y el XML, reutilizando las variables anteriores.
//Split Header and XML, reusing the previous variables.
list($Cabecera, $XML) = split ("\r\n\r",$Respuesta,2);

/*

Ya se que, llegados a este punto, se podría hacer una búsqueda
vulgar en el texto, y extraer el campo *string* "a lo macho"...

Pero ya que hemos llegado hasta aquí, por qué no hacerlo bien? :-)


I already know, once we are at this point, we can made a vulgar
search in the text, and extract the *string* field "a lo macho"...  

But since we have arrived up to here, why not to do it well? :-)

*/

//Limpiar el XML.
//Clean XML.
$XML=trim($XML);

//El parse elimina los CrLf que son separadores en *string*. Hay que reemplazarlos.
//Parser eliminates the CrLf that is delimiting in *string* field. Is necessary to replace them.

//Quitar primero cualquier \n que no esté en *string*
//Clear first any \n that is not in *string*
$XML=trim(ereg_replace(">\n",">", $XML));

//Reemplazar los \n en *string*, por el asterisco (*)
//Replace \n in *string*, by the asterisk (*)
$XML=ereg_replace("\n","*", $XML);


//Usar el parser del XML para interpretar la respuesta del XQM-Agent.
//Use XML parser to interpret the answer of the XQM-Agent.
$Parser = xml_parser_create();
xml_parser_set_option($Parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($Parser,XML_OPTION_SKIP_WHITE,1);
xml_parse_into_struct($Parser,$XML,$Valores,$Campos);
xml_parser_free($Parser);

//Buscar el campo 'string'
//Find 'string' field
foreach ($Campos as $Campo=>$Valor) {
if ($Campo == "string") {

 //Obtener el valor del campo
 //Get field value
 $Resultado = $Valores[$Valor[0]]["value"];

} else {

 continue;

}
}

//Guardar la información en un array.
//Save information on array.
$Mensajes = split ("__NEXT__",urldecode($Resultado));



//Aquí insertar el código apropiado...
//Insert here your code.


//Ejemplo:
//Sample

$Planos = array("<",">");
$Codigos = array("&lt;","&gt;");

foreach ($Mensajes as $Mensaje) {

List ($Tipo, $Fecha, $Remitente, $Destinatario, $Asunto, $Fichero, $Tamaño, $Diagnostico) = explode('*', substr($Mensaje,1,strlen($Mensaje)-1));

if (!$Tipo == ""){


 echo "\n<hr>";
 echo "\n<br>Tipo: ".$Tipo;
 echo "\n<br>Fecha: ".$Fecha;
 echo "\n<br>Remitente: ".str_replace($Planos, $Codigos, $Remitente);
 echo "\n<br>Destinatario: ".str_replace($Planos, $Codigos, $Destinatario);
 echo "\n<br>Asunto: ".quoted_printable_decode($Asunto);
 echo "\n<br>Fichero: ".$Fichero;
 echo "\n<br>Tamaño: ".$Tamaño;
 echo "\n<br>Diagnostico: ".$Diagnostico;
}
}

?>

Posted by: hschneider Sep 4 2003, 05:49 AM
>... to request query_result, parse the string ___NEXT___.
I see y... you're a real HACKER :-)

> I think that it will work to me, while does not make an update of the agent.
The protocol is XML RPC, which is standardized. IT will never be touched by any update. Maybe its data content will change some day, but you see it is easy to parse.

>I believe, I already saying, but I do not get tired to say it. You have done one of >greatest XMail utilities, and port it to FreeBSD a great favor! :-)

Thanks! wub.gif

Posted by: fonsy Sep 4 2003, 06:09 AM
QUOTE

I see y... you're a real HACKER :-)

Jajajajajajajajaja
Nothing else far from the truth...

The truth is that I have been as much time as teacher on networking, that almost I can't remember what is programming!

QUOTE

The protocol is XML RPC, which is standardized. IT will never be touched by any update. Maybe its data content will change some day, but you see it is easy to parse.

That sounds very good! :-)

Posted by: hschneider Sep 4 2003, 09:33 AM
To make things complete, here a complete listing of the Agent's RPCs:

CODE

   def version(self):
       return(VERSION)
   
   def versionstring(self):
       return('XQM_Agent '+VERSION+'/' + sys.platform)
   
   def platform(self):
       return(sys.platform)
   
   def ping(self):
       return('ALIVE')
   
   def preflight(self):
       self.Server.queue.preflight()
       return(0)
   
   def server_start(self):
       self.Server.start()
       return(0)
       
   def server_stop(self,force=0):
       self.Server.stop(force)
       return(0)
       
   def server_restart(self,async=0):
       self.Server.restart(async)
       return(0)
   
   def server_status(self,verbose=0):
       return(self.Server.status(verbose))
       
   def query(self):
       self.qresult = ''
       t = TRun(self.qstatus, self.Server.queue.query2, self._listadd)
       #self.Server.queue.query2(self._listadd)
       return()
       
   def query_status(self):
       return(self.qstatus.value)
   
   def query_result(self):
       if self.qstatus.value == 0:
           return(self.qresult)
       else:
           return('')

   def query_stop(self):
       self.Server.queue.stop_query()
       return()
       
   def lastquery(self):
       return(self.Server.queue.lastquery)

   def inspect(self, file):
       m = xmaillib.Spoolfile(file)
       return(urllib.quote(m.content + '__SLOG__' + m.slog))
   
   def remove(self, file):
       self.Server.queue.remove(file)
       return()

   def removeall_mess(self):
       self.Server.queue.removeall_mess()
       return()    

   def removeall_rsnd(self):
       self.Server.queue.removeall_rsnd()
       return()  
   
   def removeall_froz(self):
       self.Server.queue.removeall_froz()
       return()  

   def defrost(self, file):
       self.Server.queue.defrost(file)
       return()    

   def defrostall(self):
       self.Server.queue.defrostall()
       return()      

   def flush(self, server='127.0.0.1', port='6017'):
       try:
           return(self.Server.queue.flush(self.ctrl_host,self.ctrl_port))
       except:
           return('No CTRL access !')
   
   def stat(self):
       return("%s\n%s\n%s\n%s" % self.Server.queue.stat())


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)