Net::Server::PreforkSimple and External Commands

A

afrinspray

I'm using the Net::Server::preForkSimple framework and
Net::Server::Mail::ESMTP to make a content filter for postfix. I need
to call an external program in the data callback of Mail::ESMTP but I'm
having trouble executing external commands with Exec, System and
Backticks. Perl returns no errors, and the SMTP client is disconnected
immediately when calling the command (I just put an echo command in for
testing, so it's not that).

Does Net::Server::preforkSimple allow external commands to be executed?
Any ideas?

Thanks,

Mike
 
A

Anno Siegel

I'm using the Net::Server::preForkSimple framework and
Net::Server::Mail::ESMTP to make a content filter for postfix. I need
to call an external program in the data callback of Mail::ESMTP but I'm
having trouble executing external commands with Exec, System and
Backticks. Perl returns no errors, and the SMTP client is disconnected
immediately when calling the command (I just put an echo command in for
testing, so it's not that).

Does Net::Server::preforkSimple allow external commands to be executed?
Any ideas?

I don't know the module, but it would have to go through tremendous
contortions to forbid "exec" and "system".

Show a short program that demonstrates the behavior. Someone who
happens to have Net::Server::preforkSimple may be able to run it
and find out what's wrong.

Anno
 
A

afrinspray

Sorry I didn't respond this weekend.
Here's an example. "Got here" is printed to the client socket, but
"got here 2" is not.

-------------------------------------------------------------------

#!/usr/bin/perl -w
package PreForkSimpleTest;


use Net::Server::preForkSimple;
@ISA = qw(Net::Server::preForkSimple);

sub process_request
{
my $self = shift;

my $sock = $self->{server}->{client};

print $sock "Got Here\n";
my $cmd = `echo Hello`;
print $sock "Got Here 2\n";

}

__PACKAGE__->run(20205);

1;
 
A

afrinspray

Sorry... the bottom of the example (run(20205)) is not correct. Just
remove the 20205 and it will default to port 20203.

Thanks,
Mike
 
A

afrinspray

Sorry to bump this post, but I still haven't found an answer (two weeks
later). Can anyone think of any reason why a forked process of a
PreForkSimple object wouldn't be able to execute external programs?
 
X

xhoster

afrinspray said:
Sorry to bump this post, but I still haven't found an answer (two weeks
later). Can anyone think of any reason why a forked process of a
PreForkSimple object wouldn't be able to execute external programs?

I would guess it has something to do with chroot.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,085
Latest member
cryptooseoagencies

Latest Threads

Top