The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

sendmail problem

Discussion in 'E-mail Discussions' started by ncconquer, Aug 3, 2005.

  1. ncconquer

    ncconquer Well-Known Member

    Joined:
    Jun 20, 2004
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    Hi!
    i was setup PHP Nobody Spammers.
    root@yourserver [~]# mv /usr/sbin/sendmail /usr/sbin/sendmail.real
    root@yourserver [~]# pico /usr/sbin/sendmail
    and enter:
    =========
    #!/usr/local/bin/perl

    # use strict;
    use Env;
    my $date = `date`;
    chomp $date;
    open (INFO, ">>/var/log/formmail.log") || die "Failed to open file ::$!";
    my $uid = $>;
    my @info = getpwuid($uid);
    if($REMOTE_ADDR) {
    print INFO "$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n";
    }
    else {

    print INFO "$date - $PWD - @infon";

    }
    my $mailprog = '/usr/sbin/sendmail.real';
    foreach (@ARGV) {
    $arg="$arg" . " $_";
    }

    open (MAIL,"|$mailprog $arg") || die "cannot open $mailprog: $!n";
    while (<STDIN> ) {
    print MAIL;
    }
    close (INFO);
    close (MAIL);
    ===

    and now my root can't send mail because it is nobody?
    pico /var/log/formmail.log
    Thu Aug 4 08:10:14 ICT 2005 - /root - Thu Aug 4 08:11:01 ICT 2005 - / - Thu Aug 4 08:19:25 ICT 2005 - / - Thu Aug 4 08:27:48 ICT 2005 - /
    And Neomail can't send any mail.
     
    #1 ncconquer, Aug 3, 2005
    Last edited: Aug 3, 2005
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Well, adding a wrapper like that can cause problems. That said, are you sure that the wrapper that you put in place has the exact same permissions and ownership of the original sendmail? They should be:

    chmod +x /usr/sbin/sendmail
    chmod g+s /usr/sbin/sendmail
    chown root:mailtrap /usr/sbin/sendmail

    touch /var/log/spam_log
    chmod 0777 /var/log/formail.log
     
  3. ncconquer

    ncconquer Well-Known Member

    Joined:
    Jun 20, 2004
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    Ready ok.
    Thanks for help.
     
Loading...

Share This Page