Marius Burkard
2016-07-08 9bcd2fd54728b9e634442f584268da03acaea633
commit | author | age
413d3b 1 <?php
T 2
b1a6a5 3 require 'soap_config.php';
413d3b 4
T 5
6 $client = new SoapClient(null, array('location' => $soap_location,
b1a6a5 7         'uri'      => $soap_uri,
MC 8         'trace' => 1,
9         'exceptions' => 1));
413d3b 10
T 11
12 try {
b1a6a5 13     if($session_id = $client->login($username, $password)) {
413d3b 14         echo 'Logged successfull. Session ID:'.$session_id.'<br />';
T 15     }
b1a6a5 16
413d3b 17     //* Set the function parameters.
T 18     $client_id = 1;
19     $params = array(
b1a6a5 20         'policy_name' => 'numberone',
MC 21         'virus_lover' => 'Y',
22         'spam_lover' => 'Y',
23         'banned_files_lover' => 'Y',
24         'bad_header_lover' => 'Y',
25         'bypass_virus_checks' => 'Y',
26         'bypass_spam_checks' => 'Y',
27         'bypass_banned_checks' => 'Y',
28         'bypass_header_checks' => 'Y',
29         'spam_modifies_subj' => 'Y',
30         'virus_quarantine_to' => '',
31         'spam_quarantine_to' => '',
32         'banned_quarantine_to' => '',
33         'bad_header_quarantine_to' => '',
34         'clean_quarantine_to' => '',
35         'other_quarantine_to' => '',
36         'spam_tag_level' => 1,
37         'spam_tag2_level' => 1,
38         'spam_kill_level' => 1,
39         'spam_dsn_cutoff_level' => 1,
40         'spam_quarantine_cutoff_level' => 1,
41         'addr_extension_virus' => '',
42         'addr_extension_spam' => '',
43         'addr_extension_banned' => '',
44         'addr_extension_bad_header' => '',
45         'warnvirusrecip' => 'Y',
46         'warnbannedrecip' => 'Y',
47         'warnbadhrecip' => 'Y',
48         'newvirus_admin' => '',
49         'virus_admin' => '',
50         'banned_admin' => '',
51         'bad_header_admin' => '',
52         'spam_admin' => '',
53         'spam_subject_tag' => '',
54         'spam_subject_tag2' => '',
55         'message_size_limit' => 10,
56         'banned_rulenames' => 'welt'
57     );
58
413d3b 59     $affected_rows = $client->mail_policy_add($session_id, $client_id, $params);
b1a6a5 60
413d3b 61     echo "Policy ID: ".$affected_rows."<br>";
b1a6a5 62
MC 63
413d3b 64     if($client->logout($session_id)) {
T 65         echo 'Logged out.<br />';
66     }
b1a6a5 67
MC 68
413d3b 69 } catch (SoapFault $e) {
T 70     echo $client->__getLastResponse();
71     die('SOAP Error: '.$e->getMessage());
72 }
73
74 ?>