Re: Urgent Help, please!
Don't worry I wasn't going to ask you to code my script :) I'll try to recompile PHP and see what happens, hope it really works out! Thanks anyway for your precious help and I wish to thank all the people that answered my message, even though I tried suid the scripts and didn't work out. I'll let you know if this PHP recompile will do. Best regards, Guyver - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: guyver [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 21, 2001 12:36 AM Subject: Re: Urgent Help, please! Guyver, I am sorry I can't write the script for you.. Just configure PHP with --with-vpopmail (Should find the directory automatically) compile PHP and Apache Again.. and Look at the vpopmail.h and vauth.h for the callable functions and there parameters. Sean - Original Message - From: guyver [EMAIL PROTECTED] To: Sean C Truman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 4:38 PM Subject: Re: Urgent Help, please! Sean C Truman writes: Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean Wow, that sounds very interesting, could you please be more specific about it? I absolutely have to finish the script by tomorrow... :( So basically I should recompile my PHP simply adding --with-vpopmail=/home/vpopmail ?? I've checked the Inter7 website but there's nothing about it (or at least nothing that I could find) except on the Admin Guide I found a piece of text regarding vpopmail API but I thought it was only for C programs... am I wrong? It says there is a library at ~vpopmail/lib/libvpopmail.a that is linkable with C programs how do I link it to PHP? Thanks again for your patience. Best regards, Guyver
Re: Urgent Help, please! How to use vpopmail functions in PHP!
hi well, judging from the source code you should try the following functions: vpopmail_add_user() also read the file in ext/vpopmail in the php4 source tree... greetz hope it helps Flavio On Fri, Sep 21, 2001 at 10:53:54AM +0200, The Guyver wrote: Sorry for bothering you guys again, but I've recompiled PHP/Apache with vpopmail support in (I checked with phpinfo() and I got this: vpopmail vpopmail support enabled vpopmail version 4.10.30 vpopmail uid/gid php uid/gid/euid/egid 89/89 99/99/99/99 vpopmail dir /home/vpopmail vpopmail vadddomain /home/vpopmail/bin/vadddomain vpopmail vdeldomain /home/vpopmail/bin/vdeldomain vpopmail vaddaliasdomain /home/vpopmail/bin/vaddaliasdomain so I guess everything should be working) BUT when I call the vpopmail functions (like vadduser() ) I get this error: Fatal error: Call to undefined function: vadduser() in /home/www/test/scripts/mail_add.php on line 9 Am I missing something? I though once compiled in those functions were already present, how do I define them. Please help me out, I feel very close to the solution but still cannot reach it. Thanks again to anyone answering! Guyver - Original Message - From: The Guyver [EMAIL PROTECTED] To: Sean C Truman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 21, 2001 9:51 AM Subject: Re: Urgent Help, please! Don't worry I wasn't going to ask you to code my script :) I'll try to recompile PHP and see what happens, hope it really works out! Thanks anyway for your precious help and I wish to thank all the people that answered my message, even though I tried suid the scripts and didn't work out. I'll let you know if this PHP recompile will do. Best regards, Guyver - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: guyver [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 21, 2001 12:36 AM Subject: Re: Urgent Help, please! Guyver, I am sorry I can't write the script for you.. Just configure PHP with --with-vpopmail (Should find the directory automatically) compile PHP and Apache Again.. and Look at the vpopmail.h and vauth.h for the callable functions and there parameters. Sean - Original Message - From: guyver [EMAIL PROTECTED] To: Sean C Truman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 4:38 PM Subject: Re: Urgent Help, please! Sean C Truman writes: Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean Wow, that sounds very interesting, could you please be more specific about it? I absolutely have to finish the script by tomorrow... :( So basically I should recompile my PHP simply adding --with-vpopmail=/home/vpopmail ?? I've checked the Inter7 website but there's nothing about it (or at least nothing that I could find) except on the Admin Guide I found a piece of text regarding vpopmail API but I thought it was only for C programs... am I wrong? It says there is a library at ~vpopmail/lib/libvpopmail.a that is linkable with C programs how do I link it to PHP? Thanks again for your patience. Best regards, Guyver -- http://no-way.org/~fcu/
Re: Urgent Help, please! How to use vpopmail functions in PHP!
Yes, you're right! But then when using the correct function I had the UID/GID problem. I'm working on that right now. Regards, Guyver - Original Message - From: Flavio Curti [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 21, 2001 11:55 AM Subject: Re: Urgent Help, please! How to use vpopmail functions in PHP! hi well, judging from the source code you should try the following functions: vpopmail_add_user() also read the file in ext/vpopmail in the php4 source tree... greetz hope it helps Flavio
Re: Urgent Help, please! How to use vpopmail functions in PHP!
i think they write something about that in the README file of the vpopmail extension greetz hope it helps Flavio On Fri, Sep 21, 2001 at 12:01:21PM +0200, The Guyver wrote: Yes, you're right! But then when using the correct function I had the UID/GID problem. I'm working on that right now. Regards, Guyver -- http://no-way.org/~fcu/
Re: Urgent Help, please! SOLVED
Well thanks to all of you guys, I've solved my problem. However even with vpopmail support built into PHP it didn't work out 'cause permissions where not set right. I solved this way: I setuid che vpopmail scripts. (not all of them just vadduser and vmoduser) Don't know if it's correct but it works for me :) Best regards, Guyver
RE: Urgent Help, please!
The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
RE: Urgent Help, please!
does your webserver user have rights to work in the vpopmail dirs? -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 2:30 PM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
Re: Urgent Help, please!
How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
RE: Urgent Help, please!
RTFM. http://www.apache.org is your friend. Regards, Tren. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:37 PM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
RE: Urgent Help, please!
The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
Re: Urgent Help, please!
Thanks again!! I'll try it, hope it works. Best regards, Guyver - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:37 PM Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory.
RE: Urgent Help, please!
Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
Re: Urgent Help, please!
Why dont you just compile the vpopmail in PHP and do the calls from PHP iteself. Sean - Original Message - From: Tren Blackburn [EMAIL PROTECTED] To: 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 1:47 PM Subject: RE: Urgent Help, please! Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
Re: Urgent Help, please!
PHP scripts are parsed, not executed. Setuid is useless with PHP. The only thing I can think of is to make your web server run as root or vpopmail (NOT recommended) or turn the PHP script into a perl script or C program and make it setuid-vpopmail. -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: Tren Blackburn [EMAIL PROTECTED]; 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:56 PM Subject: Re: Urgent Help, please! Why dont you just compile the vpopmail in PHP and do the calls from PHP iteself. Sean - Original Message - From: Tren Blackburn [EMAIL PROTECTED] To: 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 1:47 PM Subject: RE: Urgent Help, please! Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
RE: Urgent Help, please!
Or add the the user that runs the webserver to the vchkpw group. -Original Message- From: Brandon Ramirez [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:01 PM To: [EMAIL PROTECTED] Subject: Re: Urgent Help, please! PHP scripts are parsed, not executed. Setuid is useless with PHP. The only thing I can think of is to make your web server run as root or vpopmail (NOT recommended) or turn the PHP script into a perl script or C program and make it setuid-vpopmail. -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: Tren Blackburn [EMAIL PROTECTED]; 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:56 PM Subject: Re: Urgent Help, please! Why dont you just compile the vpopmail in PHP and do the calls from PHP iteself. Sean - Original Message - From: Tren Blackburn [EMAIL PROTECTED] To: 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 1:47 PM Subject: RE: Urgent Help, please! Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
RE: Urgent Help, please!
This perl script creates a new user , it does NOT need to be SUID. Only a script that created a NEW Domain would need to be suid. I have that available if you need it. My apache runs as user vpopmail. I am not a qualified perl programmer, so I offer no security with this script. zack #!/usr/bin/perl -w use CGI ':all'; my $query = new CGI; my $new_user = $query-param('new_user'); my $domain = $query-param('domain'); my $password = $query-param('password'); my $adduser = `/var/vpopmail/bin/vadduser $new_user\@$domain $password`; print header(), start_html(Done.), end_html(); -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
RE: Urgent Help, please!
You also can use sudo to execute programs as a certain user. http://www.courtesan.com/sudo - Ing. Ruben Olague | Systems Administrator | Podernet, S.A. de C.V. | Mexico, D.F.| Tel: (01) 5257 0730 | -
Re: Urgent Help, please!
Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean - Original Message - From: Brandon Ramirez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:01 PM Subject: Re: Urgent Help, please! PHP scripts are parsed, not executed. Setuid is useless with PHP. The only thing I can think of is to make your web server run as root or vpopmail (NOT recommended) or turn the PHP script into a perl script or C program and make it setuid-vpopmail. -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: Tren Blackburn [EMAIL PROTECTED]; 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:56 PM Subject: Re: Urgent Help, please! Why dont you just compile the vpopmail in PHP and do the calls from PHP iteself. Sean - Original Message - From: Tren Blackburn [EMAIL PROTECTED] To: 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 1:47 PM Subject: RE: Urgent Help, please! Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
Re: Urgent Help, please!
I forgot all about that option. Thanks for telling me about that. But woudn't it still need to be run as a different user? -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 4:24 PM Subject: Re: Urgent Help, please! Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean - Original Message - From: Brandon Ramirez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:01 PM Subject: Re: Urgent Help, please! PHP scripts are parsed, not executed. Setuid is useless with PHP. The only thing I can think of is to make your web server run as root or vpopmail (NOT recommended) or turn the PHP script into a perl script or C program and make it setuid-vpopmail. -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: Tren Blackburn [EMAIL PROTECTED]; 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:56 PM Subject: Re: Urgent Help, please! Why dont you just compile the vpopmail in PHP and do the calls from PHP iteself. Sean - Original Message - From: Tren Blackburn [EMAIL PROTECTED] To: 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 1:47 PM Subject: RE: Urgent Help, please! Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver
Re: Urgent Help, please!
Sean C Truman writes: Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean Wow, that sounds very interesting, could you please be more specific about it? I absolutely have to finish the script by tomorrow... :( So basically I should recompile my PHP simply adding --with-vpopmail=/home/vpopmail ?? I've checked the Inter7 website but there's nothing about it (or at least nothing that I could find) except on the Admin Guide I found a piece of text regarding vpopmail API but I thought it was only for C programs... am I wrong? It says there is a library at ~vpopmail/lib/libvpopmail.a that is linkable with C programs how do I link it to PHP? Thanks again for your patience. Best regards, Guyver
Re: Urgent Help, please!
Guyver, I am sorry I can't write the script for you.. Just configure PHP with --with-vpopmail (Should find the directory automatically) compile PHP and Apache Again.. and Look at the vpopmail.h and vauth.h for the callable functions and there parameters. Sean - Original Message - From: guyver [EMAIL PROTECTED] To: Sean C Truman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 4:38 PM Subject: Re: Urgent Help, please! Sean C Truman writes: Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean Wow, that sounds very interesting, could you please be more specific about it? I absolutely have to finish the script by tomorrow... :( So basically I should recompile my PHP simply adding --with-vpopmail=/home/vpopmail ?? I've checked the Inter7 website but there's nothing about it (or at least nothing that I could find) except on the Admin Guide I found a piece of text regarding vpopmail API but I thought it was only for C programs... am I wrong? It says there is a library at ~vpopmail/lib/libvpopmail.a that is linkable with C programs how do I link it to PHP? Thanks again for your patience. Best regards, Guyver
Re: Urgent Help, please!
Brandon, No you can run it as any user.. I believe the vpopmail API takes care of the user problem.. (Atleast I remeber reading it in the mailing list) Sean - Original Message - From: Brandon Ramirez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 3:29 PM Subject: Re: Urgent Help, please! I forgot all about that option. Thanks for telling me about that. But woudn't it still need to be run as a different user? -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 4:24 PM Subject: Re: Urgent Help, please! Brandon, If you configure PHP --with-vpopmail=/home/vpopmail you can call the vadduser() function from within your PHP script. This is one of the reason Ken created the API for vpopmail. Sean - Original Message - From: Brandon Ramirez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:01 PM Subject: Re: Urgent Help, please! PHP scripts are parsed, not executed. Setuid is useless with PHP. The only thing I can think of is to make your web server run as root or vpopmail (NOT recommended) or turn the PHP script into a perl script or C program and make it setuid-vpopmail. -- Brandon Ramirez UnrealHost Head System Administrator www.unrealhost.net - Original Message - From: Sean C Truman [EMAIL PROTECTED] To: Tren Blackburn [EMAIL PROTECTED]; 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 2:56 PM Subject: Re: Urgent Help, please! Why dont you just compile the vpopmail in PHP and do the calls from PHP iteself. Sean - Original Message - From: Tren Blackburn [EMAIL PROTECTED] To: 'Sean O'Dea' [EMAIL PROTECTED]; 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 1:47 PM Subject: RE: Urgent Help, please! Scripts cannot be suid. At least on Linux and AIX and SCO they can't. Can't speak for others. You'd have to use some C program to call this, or re-write it in C. Regards, Tren. -Original Message- From: Sean O'Dea [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 12:38 PM To: 'The Guyver'; '[EMAIL PROTECTED]' Subject: RE: Urgent Help, please! The script should be owned by vpopmail chown vpopmail script Set the script to run as vpopmail chmod u+s script That will allow the script to have the same permissions as vpopmail and it should be able to write the the directory. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:37 AM To: Sean O'Dea; [EMAIL PROTECTED] Subject: Re: Urgent Help, please! How do I do it please?? Thanks again! - Original Message - From: Sean O'Dea [EMAIL PROTECTED] To: 'The Guyver' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 20, 2001 8:32 PM Subject: RE: Urgent Help, please! The script probably needs to run setuid to the vpopmail user. -Original Message- From: The Guyver [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: Urgent Help, please! Hello there, I'm in a desperate need to write a PHP script that creates a new mailbox with vpopmail 4.10.35 I've written everything correctly but when I use exec or system I always end up with this error: Error: Unable to chdir to vpopmail/domains directory please help me it's very urgent if anybody has a clue I'll appreciate so much. Guyver