Alessio Cecchi wrote:
Hello all,

i'm using vpopmaild to manage some domains (add_user, add_alias ...) with a simply php script run on a remote web service.



@40000000474fd7970d4bc924 30689 < login [EMAIL PROTECTED] XXXXXXX
@40000000474fd7970daf1704 30689 > +OK M
@40000000474fd7970db6102c 30689 <
@40000000474fd7970db617fc 30689 < add_user [EMAIL PROTECTED] XXXXXM
@40000000474fd7970dc8483c 30689 > +OK+M
@40000000474fd7970dc8bd6c 30689 > vpopmail_dir /home/vpopmailM
@40000000474fd7970dc92eb4 30689 > domain_dir /home/vpopmail/domains/circoli.itM
@40000000474fd7970dc99444 30689 > uid 89M
@40000000474fd7970dca0974 30689 > gid 89M

<snip>

@40000000474fd7970dd2bc04 30689 > no_spamassassin 0M
@40000000474fd7970dd32194 30689 > delete_spam 0M
@40000000474fd7970dd38724 30689 > no_maildrop 0M
@40000000474fd7970dd3f09c 30689 > system_admin_privileges 0M
@40000000474fd7970dd56b84 30689 > .M
@40000000474fd7970e4b1884 30689 < [EOF]
@40000000474fd7970f781f04 30689 > -ERR 0.305 Username existsM
@40000000474fd7f825dfafb4 tcpserver: status: 2/10


Are you waiting for vpopmaild's responses? It looks to me as if you are just sending commands down the pipe, without waiting for responses, or checking for errors. The recordio run should look like this:

> +OK                  --   Once connected wait for +OK
< login [EMAIL PROTECTED] XXXXXXX
> +OK+                 --   Login OK, multi line response is coming
> vpopmail_dir /home/vpopmail
> domain_dir /home/vpopmail/domains/circoli.it
> uid 89
> gid 89

<snip>

> no_spamassassin 0
> delete_spam 0
> no_maildrop 0
> system_admin_privileges 0
> .                   --  Read lines of response until single . on line
< add_user [EMAIL PROTECTED] XXXXX   --   send for next command
> -ERR 0.305 Username existsM -- last command was error, ready for next
< quit                --  send the quit commnad
> +OK                 --  now it is safe to close the connection

Also, if you don't care about the user information returned by login, you should use slogin (silent-login).

It may be a while before I find time to fix this within the daemon. (I got slammed by two 'need it yesterday' projects at the same time.) I admit it should not be possible to lock it up this way, but you are way out of spec on following the protocol. Please either expand your code to accept what you are sent, or use one of the following libraries:

Bill Shupp's NET_Vpopmaild has been accepted as a part of PEAR. You can find it here:

  http://pear.php.net/package/Net_Vpopmaild

If that is too complex, you might want to look at my original at:

   http://pmailadmin.sourceforge.net/vpopmaild-php.php

The code itself is available on the SourceForge pMailAdmin project.

This is much simpler, and is what Bill's project is based on. There are a few bug fixes that need to be ported back to my code, so if you can handle using a PEAR module that is probably best.

Rick



!DSPAM:474fef5032006323851287!

Reply via email to