Jump to content

Stickybit

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by Stickybit

  1. That's not an easy task - since MTA traffic is UDP - and the software is closed source. A reliable script for that purpose would have to come from the MTA team, or from some nasty hacker / cheater who has revese enginered the MTA traffic.

    Regards Stickybit

  2. Oh i wanted such a script but i just made one using other scripts and merged to enable auto reboot of mta server if it goes down. You close the server via admin shutdown button and ask ur hoster to run ur auto start script in background and tada it starts ur server after the time specified by u in script say 10 sec or 20 sec or more. Pretty neat huh?

    Does this one of ur does the same thing ?

    Nope.

    or is it just a script for only linux root to run the server

    Yes.

    cause if people have shell access on a webhost they dont have root access u have to keep that in mind dude.

    Nope. Only real sysadm's who has root acces - and who can handle root acces, should mess with daemons.

    -Stickybit

  3. K dude whats for latest version 5 got any script? just repace 0.4 with latest one right?

    The script for version 5 is the same as for version 4. Just replace the version numbers.

    and what about rebooting the server?

    The script should be part of the init.d / rc.d scripts - and could then be automaticly started and stopped when entering / exiting specific runlevels.

    and why root access only , cant u just password protect the directory , cause most webhosts dont give root access , so whats the solution to that?

    This ain't a cgi script for a webserver, so password protected directory's isn't an option. Password protected diretory's isn't really security anyway - it's just a webserver feature. Only root should be able to start daemons, and daemons (especially 3. party daemons without sourcecode) should never run as root. That is the reason for the sudo'ing.

    Just a note i tried ur script and all it does is give internal server error.

    This isn't a script for your webpage. It's a plain perl script for shell execution.

    -Sticky bit

  4. The script has been slightly modyfied - so it matches version 0.5. Click on the "Bugfixed version" link in the above posting, to get the new version.

    MTA team: Why do you erase the logfile when restarting the server? It would be nice if you just apended data to the logfile instead of emptying it on server starts.

    Regards Sticky

  5. I see no problem in running the script on a PHP capeable IIS server... unless the Windows version of MTA server is using an other logformat.

    Instead of executing wget.. you can use fopen to open the remote file in the mode needed.

    -Stickybit

  6. .. and for ver. 0.4 - pretty much the same:

    #!/usr/bin/perl
    
    use English;
    
    die "\nYou must be root in order to start the MTA server.\n\n" if ($EFFECTIVE_USER_ID != 0);
    die "\nUsage: $PROGRAM_NAME {start|stop}\n\n" if (!(($ARGV[0] eq 'start') or ($ARGV[0] eq 'stop')));
    
    $action = $ARGV[0];
    $user   = 'mta';
    $dir    = '/opt/MTAServer-0.4/';
    $bin    = 'MTAServer0.4';
    
    CASE: {
    
      ($action eq 'start') && do {
    
         print "\nStarting MTA daemon.\n\n";
         chdir($dir);
         system('sudo -u ' . $user . ' ' . $dir . $bin . ' -b') == 0 or die "Fatal error while starting server.\n";
         last CASE;
    
      };
    
      ($action eq 'stop') && do {
    
         print "\nStopping MTA daemon.\n\n";
         system ('ps -C ' . $bin  . ' -o pid= | xargs kill -9') == 0 or die "Fatal error while stopping server.\n";
         last CASE;
    
      };
    
    }
    

    -Sticky bit

  7. Hi guys

    I have a few suggestions for the linux server:

    1: An option for generating .pid files would be nice.

    2: Force the server to run as a non-superuser - or include documentation on how to make a secure installation - or include a start script which starts the server in a secure way.

    3: A default unix-like directory structure like this:

    [installdir]/bin/MTAServer0.3

    [installdir]/bin/SecureStartScript

    [installdir]/etc/mtaserver.conf

    [installdir]/etc/motd.txt

    [installdir]/etc/banned.lst

    [installdir]/doc/README

    [installdir]/doc/CHANGELOG

    [installdir]/var/mtaserver.pid

    -Sticky bit

  8. Hi Guys

    Having installed the server program on a linux server.. i realized the the program needed some kind of startup script... so I wrote one: /sbin/mta. here is the simple code:

    #!/usr/bin/perl
    
    
    use English;
    
    
    die "\nYou must be root in order to start the MTA server.\n\n" if ($EFFECTIVE_USER_ID != 0);
    die "\nUsage: $PROGRAM_NAME {start|stop}\n\n" if (!(($ARGV[0] eq 'start') or ($ARGV[0] eq 'stop')));
    
    
    $action = $ARGV[0];
    $user   = 'mta';
    $dir    = '/opt/MTAServer-0.3/';
    $bin    = 'MTAServer0.3';
    
    
    CASE: {
    
      ($action eq 'start') && do {
    
         print "\nStarting MTA daemon.\n\n";
         chdir($dir);
         system('sudo -u '. $user .' '. $dir . $bin .' -b') == 0 or die "Error while starting server.\n";
         last CASE;
    
      };
    
      ($action eq 'stop') && do {
    
         print "\nStopping MTA daemon.\n\n";
         exec ('ps -C '. $bin .' -o pid= | xargs kill -9') == 0 or die "Error while stopping server.\n";
         last CASE;
    
      };
    
    }
    
    

    Before you can use this script.. you must create a non-priveleged user called "mta"... and alter the content of $dir to reflect your MTA install directory. For increased security, I have set these permissions on the files:

    -rw------- 1 mta mta 0 Oct 26 17:31 banned.lst

    -rw------- 1 mta mta 1417 Dec 31 02:46 CHANGELOG

    -rw------- 1 mta mta 49 Feb 8 11:02 motd.txt

    -rwx------ 1 mta mta 178897 Dec 31 20:32 MTAServer0.3

    -rw------- 1 mta mta 8489 Feb 8 11:00 mtaserver.conf

    -rw------- 1 mta mta 3092 Dec 31 02:48 README

    That was my 50 cent. Thanks for a great program. :)

    -Sticky bit

×
×
  • Create New...