Hello All,
I'm attempting to write a python script to forward email from an OWA account that does not allow automatic forwarding or SMTP/IMAP access. I've hit a stumbling block regarding the "CK" variables that OWA sends with its sendmail requests. I can retrieve messages using urllib2 and parse them manually or BeautifulSoup and extract subject, body, etc as well as the "CK" variable that I assume is some kind of message checksum. When I create a send mail request with all of this extracted info, I get an error message with a different CK variable. Somehow this variable keeps changing and I don't know how, why, or even what this variable is. Any help is appreciated.
In the code below, message_html is the actual message html retrieved from OWA in premium mode.
Full code attached
-
checksum = re.findall(r'(?<=var a_sCK = ").{32}', message_html)
-
ck = re.sub(r"\\","",checksum[0])
-
-
#later on this ck variable is embedded in an xml url #body request like so:
-
-
output = """<params><Id>%s</Id><CK>%s</CK><Subj>%s</Subj><Imp>1</Imp><Sensitivity>0</Sensitivity><Body>%s</Body><Text>0</Text><DeliveryRcpt>0</DeliveryRcpt><ReadRcpt>0</ReadRcpt><To><item><Rcp AO="3" DN="paul@smithops.net" EM="paul@smithops.net" RT="SMTP"></Rcp></item></To></params>""" % (id,ck,subject,body)
-
-
#then the following error comes up:
-
-
<div id=err _msg="The action could not be completed because of a conflict with the original item. The conflict may have occurred when an existing item was updated on another computer or device. Open the item again and try making your changes. If the problem continues, contact technical support for your organization." _cd=1></div><div id=divCstInfo itemId="---hidden message id----" ck="--value of ck that does not match that which was extracted and sent ---"></div>
-
-