Jump to content


Photo

Example for managing per-user whitelist / blacklist?


  • Please log in to reply
2 replies to this topic

#1 Matthew Van Sickler

Matthew Van Sickler
  • Members
  • 5 posts

Posted 09 April 2015 - 06:00 PM

As the topic says, I am looking for example XML for retrieving and setting per-user whitelist and blacklist settings.  Does anyone have any examples they could share?    Thanks in advance!



#2 Matthew Van Sickler

Matthew Van Sickler
  • Members
  • 5 posts

Posted 09 April 2015 - 06:41 PM

After digging around in the documentation and using config.varlist I was able to answer my own question about adding entries.   Still not sure how to pull the existing entries.

 

Add user whitelist:

<methodCall>
 <methodName>config.add</methodName>
  <params>
   <param>
    <value>
     <struct>
      <member>
       <name>parent_type</name>
        <value>
         <string>
          <![CDATA[user]]>
         </string>
        </value>
      </member>
      <member>
       <name>variable</name>
        <value>
         <string>
          <![CDATA[user_scana_sender_allow]]>
         </string>
        </value>
      </member>
      <member>
       <name>values</name>
        <value>
         <array>
          <data>
            <value>
             <string>
              <![CDATA[whitelistentry@test.com]]>
             </string>
            </value>
           </data>
          </array>
         </value>
        </member>
        <member>
         <name>parent_path</name>
          <value>
           <string><![CDATA[testuser@mydomain.com]]></string>
          </value>
        </member>
       </struct>
      </value>
     </param>
   </params>
</methodCall>

Add user blacklist entry:

<methodCall>
 <methodName>config.add</methodName>
  <params>
   <param>
    <value>
     <struct>
      <member>
       <name>parent_type</name>
        <value>
         <string>
          <![CDATA[user]]>
         </string>
        </value>
      </member>
      <member>
       <name>variable</name>
        <value>
         <string>
          <![CDATA[user_scana_sender_block]]>
         </string>
        </value>
      </member>
      <member>
       <name>values</name>
        <value>
         <array>
          <data>
            <value>
             <string>
              <![CDATA[blacklistentry@test.com]]>
             </string>
            </value>
           </data>
          </array>
         </value>
        </member>
        <member>
         <name>parent_path</name>
          <value>
           <string><![CDATA[testuser@mydomain.com]]></string>
          </value>
        </member>
       </struct>
      </value>
     </param>
   </params>
</methodCall>


#3 Matthew Van Sickler

Matthew Van Sickler
  • Members
  • 5 posts

Posted 10 April 2015 - 06:49 PM

Pulling a user's whitelist entries:

<methodCall>
 <methodName>config.get</methodName>
  <params>
   <param>
    <value>
     <struct>
      <member>
       <name>type</name>
        <value>
         <string>
          <![CDATA[user]]>
         </string>
        </value>
      </member>
      <member>
       <name>variable</name>
        <value>
         <string>
          <![CDATA[user_scana_sender_allow]]>
         </string>
        </value>
      </member>
        <member>
         <name>path</name>
          <value>
           <string><![CDATA[testuser@mydomain.com]]></string>
          </value>
        </member>
       </struct>
      </value>
     </param>
   </params>
</methodCall>