Zubrag.com
June 19, 2018, 08:35:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Email forward creator script problem  (Read 18943 times)
MHz
Newbie
*
Posts: 6


« on: October 29, 2007, 08:10:47 AM »

Hi all,

I'm having problems with the mail forward creator script. I get an error from Cpanel that all fields need to be filled in. I entered all he information asked by the script. Is there a solution for this? I'm using CPanel version 11.50.0

Thanks!

Logged
zubrag
Administrator
Hero Member
*****
Posts: 786


WWW
« Reply #1 on: October 29, 2007, 08:20:02 AM »

Hi. Looks like fields are named differently on your cPanel. What is the skin name? Could you provide access to the cpanel, or maybe you could go to create email forwarder on your cpanel, select "view page source" and send me page source to zubrag a t zubrag.com to look how fields are named?
Logged
MHz
Newbie
*
Posts: 6


« Reply #2 on: October 29, 2007, 08:33:58 AM »

Hi,

My CPanel theme is X3. I sended you the source.

Thanks!
Logged
zubrag
Administrator
Hero Member
*****
Posts: 786


WWW
« Reply #3 on: October 29, 2007, 09:01:24 AM »

Need another page. sent you email.
Logged
MHz
Newbie
*
Posts: 6


« Reply #4 on: October 29, 2007, 12:34:23 PM »

Zubrag, please check your PM's
Logged
zubrag
Administrator
Hero Member
*****
Posts: 786


WWW
« Reply #5 on: October 31, 2007, 08:07:22 AM »

Hi! Please replace
http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddfwd.html?email=$euser&domain=$edomain&forward=$eforward

with
http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddfwd.html?email=$euser&domain=$edomain&fwdemail=$eforward

Does it help?
Logged
MHz
Newbie
*
Posts: 6


« Reply #6 on: October 31, 2007, 10:58:57 AM »

Yes, It works. But the strange thing is that CPanel says this: "All email sent to FORWARDADDRESSHERE will now be copied to REALEMAILADDRESSHERE"

But the forward creator script says this: "Cannot create email forwarding"

I checked it in CPanel and the forwarder is created, but why does the script say that it isnt?

And can I change the forwarder created page? Or is that impossible?

Thanks!


Logged
zubrag
Administrator
Hero Member
*****
Posts: 786


WWW
« Reply #7 on: October 31, 2007, 11:57:17 AM »

Script thinks forwarder is not created if there is "failure" word, or there is no "redirected" word. I believe in cPanel 11 word "redirected" was changed to "copied" (All email sent to FORWARDADDRESSHERE will now be copied to REALEMAILADDRESSHERE). So replace in the script "redirected" with "copied" and it should work.

If you want to customize forwarder created page then replace following code:
Code:
if (ereg ("failure", $text, $out) || !strpos($text,"redirected")) {
  die('Cannot create email forwarding.' . $text);
}

echo "Email Forwarder created: $euser@$edomain => $eforward";

with this code
Code:
if (ereg ("failure", $text, $out) || !strpos($text,"redirected")) {
  header('Location: http://www.example.com/path/to/the/failed.html');
  exit();
}

header('Location: http://www.example.com/path/to/the/success.html');
Logged
MHz
Newbie
*
Posts: 6


« Reply #8 on: October 31, 2007, 11:31:27 PM »

Thanks Zubrag!

One last question:

In the script you need to define the domain. Can the domain be predefined, so the domain box can be removed? So the user only has to define the usernme and its rel email address?

Logged
zubrag
Administrator
Hero Member
*****
Posts: 786


WWW
« Reply #9 on: November 01, 2007, 06:37:57 AM »

Yes, remove following code
  Domain:<input name='edomain' value='$edomain'> (sample: mysite.com)<br>

and change $edomain=getVar('edomain'); to $edomain='put.domain.here';
Logged
MHz
Newbie
*
Posts: 6


« Reply #10 on: November 01, 2007, 08:02:25 AM »

aah, thanks! You're the best! Keep on the good work!
Logged
loveunit
Newbie
*
Posts: 4


« Reply #11 on: December 12, 2008, 04:37:08 PM »

Hi - Firstly thanks for creating such great scripts.

I use the FTP creation script in a CMS program, however I am having trouble making the email forward script work - I use cPanel 11 with x3 skin.

I get the following error:

Cannot create email forwarding.
The forwarder could not be added because the form was not complete or would create a mail loop.

I am using the script as an include from post form data.

I have made the adjustments to the form I read other places:

change forward to fwdemail
change redirected to copied

could you give me any pointers - thanks in advance.

EDIT: I also tested my settings directly in the browser URL and they work fine.
Logged
loveunit
Newbie
*
Posts: 4


« Reply #12 on: December 12, 2008, 05:09:49 PM »

Hi - I worked up a fix from the FTP code - which works differently:

replace the fopen and debug ---

// create email ##
$url = "http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddfwd.html?";

$url = $url . "email=$euser&domain=$edomain&fwdemail=$eforward";

$result = @file_get_contents($url);

if ( $result === FALSE ) die("ERROR: Email Forward not created. Please make sure you passed correct parameters.");

if ( $fresults == 1 ) { echo $url.'<br />'.$result; } // tell the world ##

$fresults = 1; for feedback - $fresults = 0; to leave headers empty for redirection ##

thanks... for all your hard work.. please keep providing code.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC