Sign in to follow this  
Followers 0
stealthmsgr

MIME headers

15 posts in this topic

Per earlier conversation with Water. I am looking for ideas. The scenario is this: Windows 2003 R2, Exchange 2003, Outlook 2003 (plain text). Email from one input is incompatible with messaging std in that in the entire message body is used <CR> <CRLF>. This is no problem until at the end of the Subject line and the start of the body. OL can't determine the begining of the message body and inputs lines of the MIME header into the message body.

Waters Outlook UDF is the way to go. Can I parse (strip off, or filter) the MIME header? or pull out the message body? Either way I need to re-send the message back into OL.

Thanks for any help.

Share this post


Link to post
Share on other sites



The only function coping with MIME headers is _OL_MailheaderGet.

The message body of a mail is just a property you access using _OL_ItemGet.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Being new to Autoit, but this is fixed (at the end of each line) can I look for the <CR> <CRLF> and insert a <LF> into the position after the first <CR>?

This could be done in the entire messge without harming anything I think?

Share this post


Link to post
Share on other sites

Should be possible. You retrieve the body into a variable, change whatever you need to change and then create a new mail using the changed body.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I see. The problem and where I'm hesitant with that is in non-repudiation.

Share this post


Link to post
Share on other sites

But wouldn't it be easier to talk to the sender of these mails and convince him to make his mails conforming to standards?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Under normal circumstances. This is a specific system that can't be changed.

Share this post


Link to post
Share on other sites

In this case i would create a copy of the mail, change the body to my needs and then process this modified mail. The original mail should be moved to an archive for any kind of audit.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Good idea. I'll give it a go. Thanks for the help.

I'll update you if you're interested.

Share this post


Link to post
Share on other sites

Sure.

Use _OL_ItemCopy, _OL_ItemGet, _OL_ItemModify and _OL_ItemMove for this job.

If you have any questions or run into problems I will be glad to assist.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Will do. I'll post how this works out.

Cheers.

Share this post


Link to post
Share on other sites

Water, I am pulling out the message body and working with it in text form to remove the <CR>. I'm having some problems with finding the single occurance of <CR> from the <CRLF>.

The line formation is like this:

Blah Blah Blah <CR>

<CRLF>

Blah Blah Blah <CR>

<CRLF>

Etc.

So far I'm using StringRegExpReplace($chars, "®", @CRLF) to find it, but I get an extra <LF> in the text body.

I guess I could also replace the <CR><CRLF> instance with <CRLF><CRLF>.

I have worked some with the regular expressions tables and looked at the PCRE reference info and I'm just not connecting the dots.DUH!

Can you give me a few pointers to get me moving again?

Share this post


Link to post
Share on other sites

I'm not very familiar with regular expressions as well. So I would replace <CR><CRLF> with <CRLF><CRLF> using StringReplace.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Water,

As promised this is the code I produced to strip the <CR><CRLF> from the text copy. It looks for an instance of the text to appear, then copies a duplicate to work with. Then does a RegEx replacement into a 3rd text file for resending into Exchange. I leave the first copy untouched for non-repudiation (of sorts). Guess I could kill off the 2nd copy in the process. Might be a little sloppy but I've have the correct combination to strip the command characters off. Now I just need to resend it back into Exchange. Any ideas?

local $chars, $file, $filename

Local $file = FileOpen("C:Data Filetestfile.txt", 0)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

; Read in characters

While 1

Local $chars = FileRead($file, -1)

If @error = -1 Then ExitLoop

MsgBox(0, "MSG:", $chars)

FileWrite("C:Data Filetest2.txt", $chars)

Local $sOutput = FileRead($chars, -1)

Local $sOutput = StringRegExpReplace($chars, "rsH", @CRLF)

FileWrite("C:Data Filetest3.txt", $sOutput)

Exit

WEnd

FileClose($file)

Share this post


Link to post
Share on other sites

You can use functions _OL_ItemCreate and _OL_ItemSend to create and send a mail.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0