I am looking at Create email filter · cPanel & WHM Developer Portal . This problem is a one-line Windows batch file.
First, I see an error in the documentation URL example. The example is:
There is no ? in the example line. The first & should be ? .
I figured out from the error message saying something about "illegal function name." When I changed the first & to ? the error changed to "No valid rules." Therefore, I think my problem is I don't know how to express a valid rule for this cPanel function.
I am afraid maybe the documentation for this function may be incorrect in other ways besides the example above. Or, I am just not smart enough to figure it out independently. And therefore, I will certainly appreciate some help.
I have successfully used the UAPI to create an email address, delete an email address, get an email quota, and return a list of email accounts for the domain. But create email filter is more complicated for me.
Here is what I am doing in a Windows batch file:
This is supposed to redirect mail from jerry to gerry. However, I get this error, "No valid rules."
The response is
I also tried substituting %2a for *, and %24 for $ . But I get the same error.
I hope somebody can help me figure this function out.
First, I see an error in the documentation URL example. The example is:
https://hostname.example.com:2083/cpsess##########/execute/Email/store_filter&filtername=coffee&action%2a=deliver&match%2a=contains&part%2a=%24header_from&val%2a=coconut
There is no ? in the example line. The first & should be ? .
I figured out from the error message saying something about "illegal function name." When I changed the first & to ? the error changed to "No valid rules." Therefore, I think my problem is I don't know how to express a valid rule for this cPanel function.
I am afraid maybe the documentation for this function may be incorrect in other ways besides the example above. Or, I am just not smart enough to figure it out independently. And therefore, I will certainly appreciate some help.
I have successfully used the UAPI to create an email address, delete an email address, get an email quota, and return a list of email accounts for the domain. But create email filter is more complicated for me.
Here is what I am doing in a Windows batch file:
cURL -H "Authorization: cpanel indinferaem:[token]" "https://assigned-email-manager.com:2083/execute/Email/store_filter?filtername=redirect&action*=deliver&match*=contains&part*=$header_to&val*=jerry&[email protected]&dest*[email protected]"
This is supposed to redirect mail from jerry to gerry. However, I get this error, "No valid rules."
The response is
{"warnings":null,"data":null,"errors":["No valid rules."],"metadata":{},"status":0,"messages":null}
I also tried substituting %2a for *, and %24 for $ . But I get the same error.
I hope somebody can help me figure this function out.