Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2004
    Location
    Israel
    Posts
    17

    Default web based mail on normal port

    Heya Fellas,

    I was wondering if it's possible to have my own email viewer on my site's root, becuase on the computer I'm currently on I'm restricted to the cpanel/whm port and also the /webmail doesn't work for me here , so I was wondering if I could just use a php script that will run from the normal site's port (80).

    Thank you,
    - Ben Bond Pere

  2. #2
    Member
    Join Date
    Jul 2003
    Location
    SW London (UK)
    Posts
    50

    Default

    Try this PHP script:

    <?php
    /* proxy.php version 3.01 - A proxy script for Cpanel/WHM/Webmail
    <a href="http://scripts.brophus.com" target="_blank">http://scripts.brophus.com</a> or e-mail us at scripts@brophus.com

    Please contact us first if you wish to distribute this script;
    This header comment must remain intact at all times. Thank you

    Don't forget to ask how you can make donations!
    */

    /* To setup, you'll need to copy the next 5 lines into .htaccess
    php_value magic_quotes_gpc off
    php_flag always_populate_raw_post_data on
    RewriteEngine on
    RewriteRule !^/?proxy - [C]
    RewriteRule .* /proxy.php?port=2082 [L]

    You should change the port number (2082) in .htaccess to suit:
    CPanel port=2082
    WHM port=2086
    Webmail port=2095 (though webmail also seems to work on 2082)

    Please contact us if you have any queries. Thank you!
    */

    # you could set the default timeout and port numbers here if you want
    @$timeout = $_GET['timeout'] or $timeout = 30;
    @$port = $_GET['port'] or $port = 2082;
    # no user servicable parts below here <img src="images/smilies/wink.gif" border="0" alt="">
    $fp = @fsockopen ('127.0.0.1', $port, $errno, $errstr, $timeout)
    or die ("couldn't connect to port $port: $errstr ($errno)\n");
    $request = "{$_SERVER['REQUEST_METHOD']} {$_SERVER['REQUEST_URI']} HTTP/1.0"
    . ($nl = "\r\n");
    $headers = array_change_key_case(getallheaders(), CASE_LOWER);
    if (!(@$body = $GLOBALS['HTTP_RAW_POST_DATA'] or $body='')) {
    if ($ct = @explode('boundary=', $headers['content-type'])
    and @$boundary = $ct[1]) {
    if (@$_POST)
    foreach ($_POST as $name => $value)
    $body .= "--{$boundary}{$nl}Content-Disposition: form-data; "
    . "name=\"{$name}\"{$nl}{$nl}{$value}{$nl}";
    if (@$_FILES) {
    while (list($name, $props) = each($_FILES)) {
    $ct = $props['type'] or $ct = 'application/octet-stream';
    $body .= "--{$boundary}{$nl}Content-Disposition: form-data; "
    . "name=\"{$name}\"; filename=\"{$props['name']}\"{$nl}"
    . "Content-Type: {$ct}{$nl}{$nl}";
    if ($fd = @fopen($filename = $props['tmp_name'], 'rb')) {
    $body .= fread($fd, filesize($filename));
    fclose ($fd); }
    $body .= "$nl"; } }
    $body .= "--{$boundary}--{$nl}{$nl}"; }
    elseif (@$_POST) {
    foreach ($_POST as $name => $value)
    $vars[] = urlencode($name) . '=' . urlencode($value);
    $body .= implode('&', $vars); }
    }
    $headers['content-length'] = strlen($body);
    $headers['connection'] = 'close';
    while (list ($header, $value) = each ($headers))
    $request .= "{$header}: {$value}{$nl}";
    fputs ($fp, "$request$nl$body");
    while (!feof($fp)) {
    $line = fgets ($fp,1024);
    if ($line == "\r\n" || $line == "\n") break;
    header($line); }
    fpassthru($fp);
    ?>

  3. #3
    Member
    Join Date
    Aug 2003
    Location
    United Kingdom
    Posts
    186

    Default

    If you are interested in using cPanel Proxy, I've added a FAQ & a HOW-TO:

    FAQ: Can I change the ports cPanel & WHM uses?
    http://unofficial-support.com/node/view/47

    HOW-TO: cPanel Proxy 0.4.1
    http://unofficial-support.com/node/view/50

  4. #4
    Member
    Join Date
    Mar 2004
    Location
    Israel
    Posts
    17

    Default

    w00t w00t.. lotsa thanks there mate.. very helpful

Similar Threads & Tags
Similar threads

  1. clamd on port 1248, is that normal
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-22-2007, 09:46 AM
  2. Web based email?
    By Spartan123 in forum E-mail Discussions
    Replies: 8
    Last Post: 08-10-2007, 07:32 PM
  3. Kernel SMP and normal on SMP based processor
    By Grzeslaw in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 07-24-2007, 06:09 AM
  4. Cannot send mail from web-based mail clients
    By apodigm in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 05-17-2005, 03:40 PM
  5. Normal for Cpanel to disable Urchin at port 9999?
    By Valetia in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-14-2004, 08:18 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube