PHP/shell script

Paul Joseph Thompson captbunzo at squirrelmail.org
Fri Aug 15 18:29:34 CDT 2003


This shouldn't be so tough. I have quite a bit of PHP experience, so
I should be able to give you a hand.

Basically, you can do all of this in PHP, pretty much - INCLUDING
the checking of the file for the email address.

Why don't you email me back some more details about the project and
I will give you a better reply. Feel free to do that on the list or
to me personally.

Good Luck,
Paul Thompson

brad said:
> Hi all,
>
> I am trying to write a php script to allow a user to go to a web
> page and enter an email address or domain to be blocked or
> unblocked in the sendmail access file.  The script needs to check
> the current access file to see if the address is already in
> there, add the address with the correct attribute (RELAY, or 550
> REJECT We do not accept spam!) if its not in there, or return a
> notice to the user that the address is already blocked/released.
> I am a complete novice in PHP and not very versed in shell
> scripting.
>
> The web page is a php form mail and passes to the script the
> email address as $email and the attribute to block or release as
> an action of 0 or 1.  My approach is to have php call up a shell
> command within an IF/ELSE statement and have the shell command
> determine if the address is there.  I was thinking of catting the
> file and grepping for $email, but I am not sure what to return to
> the PHP script and how to pass to it whether the address was
> followed by RELAY or 550.  Finally, if the address was not found
> in access, the script needs to append the address with the
> correct attribute and run makemap.  I am wanting a way to verify
> that makemap did not return any dupes and give the user an error
> if it did.
>
> Any thoughts on how to approach this?
>
> TIA,
>
> Brad
>
>
>
> majordomo at kclug.org Enter without the quotes in body of message

-- 
Paul Joseph Thompson
captbunzo at squirrelmail.org
AIM/Yahoo/MSN IM: Captain Bunzo
ICQ Number: 38801719




More information about the Kclug mailing list