Jump to content


Photo

Example needed for global blocking address/domain

API block address block domain

  • Please log in to reply
1 reply to this topic

#1 davelicious

davelicious
  • Members
  • 2 posts

Posted 09 March 2018 - 06:01 AM

Hi,
I'm trying to add email addresses to the global sender filter block list.

Here is the source XML I use to add "BLOCK.THIS@EMAIL.ADDRESS" to the block list with comment "BLOCKED PHISHING SENDER"

<?xml version="1.0" encoding="UTF8"?>
<methodCall>
 <methodName>config.create</methodName>
 <params>
  <param>
   <value>
    <struct>
     <member>
      <name>parent_type</name>
      <value><string><![CDATA[global]]></string></value>  
     </member>
     <member>
      <name>name</name>
      <value><string><![CDATA[BLOCK.THIS@EMAIL.ADDRESS]]></string></value>  
     </member>
     <member>
      <name>type</name>
      <value><string><![CDATA[mta_sender_block_address]]></string></value>  
     </member>
     <member>
      <name>parent_path</name>
      <value><string></string></value>  
     </member>
     <member>
      <name>mta_sender_block_comment</name>
      <value><string><![CDATA[BLOCKED PHISHING SENDER]]></string></value>  
     </member>
     <member>
      <name>mta_sender_block_action</name>
      <value><string><![CDATA[Block]]></string></value>  
     </member>
    </struct>  
   </value>    
  </param> 
 </params> 
</methodcall>

But this result in this very vague output XML telling me I'm using an Invalid tag sequence
Can someone please tell me the right "tag sequence" or at least provide an example?

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultString</name>
          <value>
            <string>
              <![CDATA[Invalid tag sequence: 
<methodCall>
</methodcall> at /home/product/code/firmware/current/lib/perl5/site_perl/5.22.0/XML/RPC.pm line 158.]]>
</string>
          </value>
        </member>
        <member>
          <name>faultCode</name>
          <value>
            <i4>0</i4>
          </value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>


#2 davelicious

davelicious
  • Members
  • 2 posts

Posted 09 March 2018 - 06:44 AM

Just want to share I found the solution myself  -_- 

 

<?xml version="1.0" encoding="utf8"?>
<methodCall>
  <methodName>config.create</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>parent_type</name>
            <value><string><![CDATA[global]]></string></value>
          </member>
          <member>
            <name>name</name>
            <value><string><![CDATA[BLOCK.THIS@EMAIL.ADDRESS]]></string></value>
          </member>
          <member>
            <name>type</name>
            <value><string><![CDATA[mta_sender_block_address]]></string></value>
          </member>
          <member>
            <name>parent_path</name>
            <value><string></string></value>
          </member>
          <member>
            <name>mta_sender_block_comment</name>
            <value><string><![CDATA[BLOCKED PHISHING SENDER]]></string></value>
          </member>
          <member>
            <name>mta_sender_block_action</name>
            <value><string><![CDATA[Block]]></string></value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>