Write quaratine to Message Center Execution instance | Community
Skip to main content
Level 2
May 20, 2021
Question

Write quaratine to Message Center Execution instance

  • May 20, 2021
  • 1 reply
  • 2049 views

I need to write to the address schema (quarantines) on the Message Center execution instance due to spam trap hits. I will in practice write quarantines present on the marketing instance to the message center instance since there is no sync out of the box.

 

I've tried to run the below code in a workflow but get error: INT-150012 The HTTP query returned a 'Forbidden' type error (403)


I use the same connection information to query for current quarantines in message center in another workflow.

 

How can I make this work to write to nms:address in execution instance?
Is it just a matter of getting credentials to a login with admin (write) permission on the execution server.

NOTE: Code and error example updated after adding try catch and changing from NlElement to string as input param.

 

//--ACCOUNT AND LOGON DATA
var extAccount = instance.vars.extAccountId;
var rtCell = NL.ExecutionInstance.getExtAccount(extAccount, NL.ExecutionInstance.MESSAGECENTER_TYPE);
if( !NL.XTK.parseBoolean(rtCell.@active) ) { logError("account disabled");}
vars.login = String(rtCell.@account);
vars.password = String(rtCell.@password);
vars.url = String(rtCell.@server);

//-----INIT CONNECTION----
document.cnx = new HttpSoapConnection(vars.url + '/nl/jsp/soaprouter.jsp', 'utf-8', 0)
document.soapSrv = new SoapService(cnx, 'urn:xtk:session')
document.soapSrv.addMethod('Write', 'xtk:session#Write',['object','string'],[])
var tokens = NL.ExecutionInstance.logonRemote(vars.url, vars.login, vars.password);
document.cnx.addTokens(tokens["sessionToken"], tokens["securityToken"]);

//WRITE ADDRESS
var newAddress = "<address type='0' status='4' address='peter@example.com' quarantineReason='2' xtkschema='nms:address' _operation='insertOrUpdate'/>";
//xtk.session.Write(newAddress); //Test if object can be saved in marketing instance
try{
document.soapSrv.Write(newAddress);
}
catch( e )
{
if( e.soapFault ) logInfo("A SOAP Fault occured : " + e.soapFault.toXMLString());
else logInfo("An error occured : " + e);
}

//--------END------------
document.soapSrv.dispose();
document.cnx.dispose();

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

CedricRey
Level 5
May 25, 2021

Hello PLundmark,

 

I'm very interested with your question : it could be relevant to do what you intempt ! Specialy with spam trap.

And what I see with your code is good to me, you seem to do it right.

But I'm affraid that is not possible : I'm not surprised to see that you don't have the right to write datas from mkt instance, for evident security reasons.

 

One thing to know : the quarantine / nms:address are handle by the Message Center instances. So if someone attemps to send real time messages to them, it will be quickly stoped (usually after 1 attempt) and then reject by the MC instance.

Also, the quarantines are synchronised with you marketing instance (via the mcSync workflow)

 

But I agree : why if the quarantines are synchronised in one way, it's not the case on the other way? And if the marketing instance is aware of spam trap adresses, it could be relevant for the delivrability to share this information with MC instances.

 

If the message center instance is managed by yourself, you could try to synchronise the quarantine from the MC instance (by reading and writing the nmsAdresses from it, instead of writing from the mkt instance) with a local account ?

 

Sorry to not giving more help...

Cedric

PLundmarkAuthor
Level 2
May 25, 2021

Thanks for your reply Cedric!

There are proven spam traps quarantined in the marketing instance and the message center will most probably send to these addresses. This is why it is important, at least as a one time migration, to get the quarantines from the marketing instance into the message center instance.

 

Adobe is hosting - hence the issue. I have asked Adobe to perform the import but they refuse.

If I had direct access to the execution instance it would be a very easy operation to just insert these into the database. 

 

/Peter