buy
Add Email Forwarder

Description

You can use this Add Email Forwarder API to Add Email Forwarder your Webuzo panel.

Parameters

NameMethodValueDescriptionRequired
actGETemail_forwardThe action specified to add email forwader.Yes
addPOSTintThis will trigger add email forwader.Yes
emailPOSTtextUser Name of Email account 

e.g:-  If email is user_test@domain.com you need to pass only user_test
Yes
domainPOSTtextDomain of  user email account 
Yes
forwarder
POSTemail | pipe | sys | fail | discardType of Forwader you want to set (email | pipe | sys | fail | discard)Yes
femail
POSTemailSpecify the TO Email address.
When Forwader type is email
No
fail
POSTmsg
Specify the fail message.

When Forwader type is fail.
No
pipe_path
POSTtext
Specify the pipe_path

When Forwader type is pipe.


Note: Add path after /home/username/

exmple : /home/user1/folder1/test
you need to pass only
folder1/test
No

Sample Code

Curl PHP

You can use the following commands to create different types of forwarders:

1. Create Forwarder To Email Address:

    Specify the TO Email address and other required details.

curl --insecure -d "add=1" -d "forwarder=email" -d "domain=domain.com" -d "email=username_of_email_account " -d "femail=specify_the_TO_email_address" -u "WEBUZO_USER:USER_PASSWORD" -X POST "https://HOSTNAME_OR_SERVERiP:2003/index.php?api=json&act=email_forward"

2. Create Forwarder Fail with message:

    Set the 'fail' parameter to the fail message you want to display

curl --insecure -d "add=1" -d "forwarder=fail" -d "domain=domain.com" -d "email=username_of_email_account" -d "fail=fail message" -u "WEBUZO_USER:USER_PASSWORD" -X POST "https://HOSTNAME_OR_SERVERiP:2003/index.php?api=json&act=email_forward"

3. Create Forwarder To Your System Account:

    This type forwards emails to your system account.

curl --insecure -d "add=1" -d "forwarder=sys" -d "domain=domain.com" -d "email=username_of_email_account" -u "WEBUZO_USER:USER_PASSWORD" -X POST "https://HOSTNAME_OR_SERVERiP:2003/index.php?api=json&act=email_forward"

4. Create Forwarder Pipe to a Program:

    Specify the path of the pipe file (e.g. if pipe path is  /home/user_name/folder1/pipe_file then you need pass like this folder1/pipe_file ).

curl --insecure -d "add=1" -d "forwarder=pipe" -d "domain=domain.com" -d "email=shakir" -d "pipe_path=public_html/test_folder/test" -u "WEBUZO_USER:USER_PASSWORD" -X POST "https://HOSTNAME_OR_SERVERiP:2003/index.php?api=json&act=email_forward"

5. Create Forwarder Discard (Not Recommended):

    This type discards the forwarded emails.

curl --insecure -d "add=1" -d "forwarder=discard" -d "domain=domain.com" -d "email=shakir" -u "WEBUZO_USER:USER_PASSWORD" -X POST "https://HOSTNAME_OR_SERVERiP:2003/index.php?api=json&act=email_forward"

Output

Email forwarder successfully created.
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list