Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

sendmail problem

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

  1. ncconquer

    ncconquer Well-Known Member

    Joined:
    Jun 20, 2004
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    156
    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,470
    Likes Received:
    21
    Trophy Points:
    463
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ncconquer

    ncconquer Well-Known Member

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice