Add mail address to mailling list via website

easterbunny

New member
Joined
May 27, 2007
Messages
3
I'm trying to add mail address to a mailinglist via the website of that domain.

I thought that would be easy, using Curl to POST the mail address to DA. But I'm getting an strange error: Could not execute your request - You do not own that domain.

The PHP script I use for testing:
PHP:
function DA_SSL_Request($user, $password, $request, $method='GET', $post_content='', $host='localhost', $port=2222)
{
	$headers = '';
	$headers[] = "Content-Type: application/x-www-form-urlencoded";
	$headers[] = 'Content-length: '.strlen($post_content);
	$headers[] = 'Authorization: Basic '.base64_encode("$user:$password");
	
	$ch = curl_init();
	$complete_url = 'https://'.$host.':'.$port;
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method.' '.$request.' HTTP/1.1');
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	curl_setopt($ch, CURLOPT_URL,$complete_url);
	curl_setopt($ch, CURLOPT_FAILONERROR, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 15); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_content);
	
	curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
	
	$answer = curl_exec($ch);
	
	echo $answer;
	
	if( !$answer )
	{
		$answer['error'] = 1;
		$answer['error_msg'] = "CONNECTION ERROR ".curl_errno($ch).": ".curl_error($ch);
	}
	
	else
	{
		parse_str($answer,$answer);
	}
	
	return $answer;
}



$user = 'testda';
$password = '****';

$request = "/CMD_EMAIL_LIST";
$method = 'POST'; 
$post_content = "domain=mydomain.com&type=list&action=add&[email protected]&name=blaat"; 

$host = 'myDAhost.org';
$port = 2222;

$retval = DA_SSL_Request($user, $password, $request, $method, $post_content, $host, $port);
I'm sure I'm the owner of this domain and when I use this test script to send an GET request to /CMD_EMAIL_LIST?domain=mydomain.com I get the list of mailinglists for this domain.

The error must be some ware in the POST request so DA don't recognize the posted domainname which raises this error. But I can't find out where...
 
Back
Top