Zubrag.com :: Forum

zubrag.com => cPanel Scripts => Topic started by: jfm on December 25, 2007, 10:01:02 PM



Title: Email forwarder creator - delete option?
Post by: jfm on December 25, 2007, 10:01:02 PM
I have set up the creator script on my website to create forwards and appreciate your making it available. Is there a possibility that you might someday add a delete option, so that users can delete their own forward(s)?

Thanks,
Jere


Title: Re: Email forwarder creator - delete option?
Post by: zubrag on December 26, 2007, 07:14:44 AM
Hi. Will create Delete Email Forwarder in few days. Will post update here.


Title: Re: Email forwarder creator - delete option?
Post by: jfm on January 16, 2008, 05:21:07 PM
Is this still on the agenda?

Jere


Title: Re: Email forwarder creator - delete option?
Post by: zubrag on January 04, 1980, 04:17:13 AM
Hi Jere.  I believe delete cpanel forwarder script is available a part of cPanel Toolbox. You can find more info and download cPanel Toolbox here (http://www.zubrag.com/forum/index.php/topic,239.0.html).


Title: Re: Email forwarder creator - delete option?
Post by: jfm on January 17, 2008, 09:39:04 AM
Hi Jere.  I believe delete cpanel forwarder script is available a part of cPanel Toolbox. You can find more info and download cPanel Toolbox here (http://www.zubrag.com/forum/index.php/topic,239.0.html).

I guess I'm confused. If this was already available, then why this answer:

   
Re: Email forwarder creator - delete option?
Reply #1 on: December 26, 2007, 03:14:44 pm
   Reply with quoteQuote
Hi. Will create Delete Email Forwarder in few days. Will post update here.

And looking at the contents of the zip file I don't see anything appearing to be related to forwarders - either to create or delete. What am I missing?

Jere


Title: Re: Email forwarder creator - delete option?
Post by: zubrag on January 18, 2008, 07:15:50 AM
Hi. You are correct. Sorry. I guess it is lack of time.

<?php

###############################################################
# Delete Email Forwarder on cPanel
###############################################################

// cpanel user (the one you login to cpanel)
define('CPANELUSER','cpanel-username-here');

// cpanel password (the one you login to cpanel)
define('CPANELPASS','cpanel-password-here');

// your cpanel domain (localhost, or domain name)
define('CPANELDOMAIN','localhost');

// cPanel skin (usually "x")
// Check http://www.zubrag.com/articles/determine-cpanel-skin.php to know it for sure
define('CPANEL_SKIN','x');

////////////////////////////////////////////////////////////////
/////////////////////// END OF SETTINGS ////////////////////////
////////////////////////////////////////////////////////////////

function getVar($name, $def = '') {
  if (isset($_REQUEST[$name]) && ($_REQUEST[$name] != ''))
    return $_REQUEST[$name];
  else
    return $def;
}

$cpuser = CPANELUSER;
$cppass = CPANELPASS;
$cpdomain = CPANELDOMAIN;
$cpskin = CPANEL_SKIN;

$email=getVar('email');
$eforward=getVar('eforward');

if (empty($email) || empty($eforward)) {
  echo "<h1>Delete Email Forwarder on cPanel</h1>";
  echo "All fields are required.<br>
<form method='post'>
  Email:<input name='email' value='$email'> (sample: john@mydomain.com)<br>
  Forward: <input name='eforward' value='$eforward'> (sample: jimm@site2.com)<br>
  <input type='submit' value='Delete forwarder' style='border:1px solid black'>
</form>";
  die();
}

// Delete email forwarder
$f = @fopen
("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/dodelfwd.html?email=$email=$eforward",
 "r");
if (!$f) {
  die('Cannot delete forwarder.');
}

@fclose($f);

echo "Email Forwarder deleted: $email =&gt; $eforward";

?>


Title: Re: Email forwarder creator - delete option?
Post by: Wae on May 26, 2010, 03:39:46 AM
Why does this script above doesn't work? Is there an update to this?