Who can tell me where is imsconnutil'log?

When I run "imsconnutil -a", I can get the logs.

[root@umail1 log]# imsconnutil -a

UIDIMAP last accessHTTP last access POP last access

=============================================================================== ====================

admin-NOT-RECORDED- 14/Aug/2006:11:07:47-NOT-RECORDED-

yubing-NOT-RECORDED- 14/Aug/2006:11:07:5414/Aug/2006:11:05:45

Is there any txt log on server? thanks!

null

[446 byte] By [jack@armsun.net] at [2007-11-26 9:27:08]
# 1

Hi,

The imsconnutil data is stored in a database, it isn't available as a text file. What information did you need which the imsconnutil isn't currently providing? Also please in future provide the version information for your messaging server install (./imsimta version).

Cheers,

Shane.

shane_hjorth at 2007-7-7 0:06:43 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 2

I want use php read the log directly.

I must config apache User: mailsrv Group: mail ,or I get these error

[14/Aug/2006:13:39:03 +0800] umail1 [26119]: General Critical: func=configmsg_init; error=cannot find config file; file=msg.conf; msg=make sure you set CONFIGROOT environment variable to the directory containing config file ERROR: Could not initialize config system.

<?php

/**

* system command

*

* @param string $command

* @return string

*/

function conn_access($command) {

$command = escapeshellcmd($command);

if (!($p=popen("($command)2>&1",'r'))) {

return false;

}

while (!feof($p)) {

$line=fgets($p,1000);

$out .= $line;

}

pclose($p);

return $out;

}

$cmd = 'imsconnutil -a';

$user = conn_access($cmd);

echo $user;

?>

[root@umail1 log]# imsimta version

Sun Java(tm) System Messaging Server 6.2-3.04 (built Jul 15 2005)

libimta.so 6.2-3.04 (built 01:30:02, Jul 15 2005)

Linux umail1 2.4.21-32.EL #1 Wed May 18 18:03:37 EDT 2005 i686 i686 i386 GNU/Linux

Could you tell me how to use php to read the db data? :)

Because I don't like apache run in mail:maisrv?

Thanks !

Message was edited by:

jack@armsun.net

jack@armsunnet at 2007-7-7 0:06:43 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3

I'm more than a little confused by what you're saying.

1. Apache? What are you using apache for? There is no need for Apache in Messaging Server at all. I don't understand the reference.

2. No, there is no way to "read the database" wiht php. We may change that database without warning. Use the command line tool, and script what you want.

3. The error you're seeing, missing msg.conf. This is a critical file, used for holding a local copy of the Messaging Server's configuration. You will need to restore it from backup, or reconfigure/reinstall Messaging Server. I know of no other way to recover from deleting this file.

jay_plesset at 2007-7-7 0:06:43 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 4

Hi,

I think your best bet would be to make a new wrapper script that set up the appropriate environment variables (e.g. CONFIGROOT=<msg base>/config) and called imsconnutil -a. If that script was SUID and had the owner/group set to mail:mailsrv you should be able to avoid running the whole apache instance as mail:mailsrv (I believe the apache install needs to allow SUID though).

Either way its going to be a bit messy and a potential security hole.

As Jay noted earlier, you cannot read the DB itself as this isn't publically documented and may change at any time.

Cheers,

Shane.

shane_hjorth at 2007-7-7 0:06:43 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 5

Hi ,

Thanks for your's help!

I use apache because I don't know how to configure messaging server'httpd can run 'php+ldap+mysql ' so I run my third system on apache.

When I have changed the apache's httpd.conf User: mailsrv, Group mail,It's can get the command line " imsconnutil -a" result.But this way looks very troube, Because I must translate these data into mysql databases;

May be directly read the log.db is easy , I don't care the db struct change later.

If I know how to use php read db, I can easy read the mail index DB store.idx too!

"DB itself as this isn't publically documented " that's true Is there any way I can know it's structure Like sqllite or mysql is very easy to know.

Thanks again

jack@armsunnet at 2007-7-7 0:06:43 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 6

Hi,

> I use apache because I don't know how to configure

> messaging server'httpd can run 'php+ldap+mysql ' so I

> run my third system on apache.

mshttpd can only present very specific web-pages, it isn't a generic web-server as you noted. Running apache makes sense for what you have described so far.

> "DB itself as this isn't publically documented "

> that's true Is there any way I can know it's

> structure Like sqllite or mysql is very easy to

> know.

Unfortunately there isn't any way I know of to retrieve data directly from the database files - especially from a running installation. The database itself isn't accessible outside of the application -> its an embedded database, not a generic SQL type database which you can connect to.

What is it you are trying to achieve - the end goal?

Cheers,

Shane.

shane_hjorth at 2007-7-7 0:06:43 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 7

dear Cheers

My end goal:

write a completed system to view user login info , user`s mail info,

allow user or forbidden user login ete, All operation run in this system.

I want write this system with php+mysql ,So first I must translate all jes data to mysql data.

At all , Thanks very much.

jack@armsunnet at 2007-7-7 0:06:44 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 8

I'm going to make some suggestions . . .

1. login info.Parse the various log files for this, or run the connect utility. Parse the output from it.

2. User's mail info. Pull that from LDAP and from mboxutil as needed.

3. Allow/forbid user login. Manipulate LDAP.

Why you want to limit yourself to php and mysql, I don't know. Use the tools available to you. Perl comes to mind....

jay_plesset at 2007-7-7 0:06:44 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...