Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    119

    Default how can i install formmail.log to track spam?

    Hi,


    it looks likely there are spam or some account sent a lot of mail,

    i want to install a script to track the spam,

    it looks kilely i can install a formmail.log to track it,

    can anyone tell me more detail of the installing?



    thanks

  2. #2
    Member
    Join Date
    May 2008
    Posts
    1,114

    Default

    Try below one:

    mv /usr/sbin/sendmail /usr/sbin/sendmail.act
    (==>NOTE: Watch out .. if you, by mistake, repeat this install you will overwrite your real sendmail file ... better you make yet another copy with "cp" under another name.)
    pico /usr/sbin/sendmail (paste the below code into it)
    chmod +x /usr/sbin/sendmail
    echo > /var/log/formmail.log
    chmod 777 /var/log/formmail.log

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

    #!/usr/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 - @info\n";

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

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

    Refer:- http://forum.swsoft.com/showthread.php?threadid=20031

Similar Threads & Tags
Similar threads

  1. FormMail-clone.cgi [was: Security spam hole in cgi-sys/formmail.pl re-write]
    By cpanelnick in forum cPanel and WHM Discussions
    Replies: 175
    Last Post: 04-05-2011, 05:00 AM
  2. Help me track down some spam!
    By erinspice in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 10-31-2007, 07:49 PM
  3. mod_security blocking formmail... and formmail SPAM
    By wilfried in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-09-2006, 01:29 AM
  4. Possible to track down an exploited formmail script?
    By Metro2 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-08-2006, 11:09 AM
  5. How to track down spam script?
    By celliott in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-07-2006, 11:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube