private Attachment GetAttachment(Redemption.Attachment redemptionAttachment, int bodyFormat)
		{
			string temp = LocalFileManager.GetLocalCopyOfFileTarget(redemptionAttachment.DisplayName);
			DeleteFile(temp);

			redemptionAttachment.SaveAsFile(temp);
			_unpackedTempCopies.Add(temp);

			// Attachment Content Type cannot be determined, whilst the Index will be set at a
			// higher level -> Flatten call
			// [09/07/09] DE9310 DZ: Prefer using FileName instead of DisplayName due for
			// this defect.

			// [01/09/09] DE9621 DZ: Redemption.Attachment.FileName/DisplayName couldn't correctly retrieve
			// the Unicode names when running on Office2003 with "Cached Exchanged Mode" turned on. Therefore
			// try raw attribute first.
			// RightClick send .msg, PR_ATTACH_LONG_FILENAME_W/PR_DISPLAY_NAME_W donot present.
			// Drag to attach .msg and send, PR_ATTACH_LONG_FILENAME_W does not present.
			string attname = redemptionAttachment.get_Fields(MapiDefines.PR_ATTACH_LONG_FILENAME_W) as string;
			if (string.IsNullOrEmpty(attname))
			{
				attname = redemptionAttachment.get_Fields(MapiDefines.PR_DISPLAY_NAME_W) as string;
				if (string.IsNullOrEmpty(attname))
				{
					// Redemption.Attachment.FileName should never return null/contain invalid file name characters
					// but can incorrectly decode Unicode characters, resulting underscores '____'.
					attname = redemptionAttachment.FileName;
				}
			}
			// Sanitize required due to filename retrieved from "get_fields()" may contain "????" for incorrectly
			// decoded Unicode character.
			attname = LocalCopyOfFileManager.GetValidFileName_excl_invalid_chars(attname);
			var attachment = new Attachment(new FCS.Lite.Interface.File(temp, attname),
												   string.Empty, Guid.NewGuid().ToString(), string.Empty, false)
										{
											Properties = new[] { new CustomProperty(PropertyNames.LocalFileName, temp) }
										};
			using (RWSAttachment rWSAttachment = new RWSAttachment(redemptionAttachment))
			{
				attachment.IsSignature = MapiSignatureInspector.IsSignature(rWSAttachment, (OlBodyFormat)bodyFormat);
			}

			return attachment;
		}
		private string[] RemoveAllAttachmentsFromMSGPreserveSignature(Redemption.SafeMailItem msgItem, OlBodyFormat format)
		{
            var recordKeys = new List<string>();
			Redemption.Attachments attachments = msgItem.Attachments;
			using (new ComRelease(attachments))
			{
				for (int i = attachments.Count; i > 0; i--)
				{
					Redemption.Attachment attachment = attachments.Item(i);
					using (var rwsAttachment = new RWSAttachment(attachment))
					{
						if (!MapiSignatureInspector.IsSignature(rwsAttachment, format))
						{
                            try
                            {
                                object data = attachment.get_Fields(MapiDefines.PR_RECORD_KEY);
                                if (data != null)
                                {
                                    string recordkey = GetStringFromBytes(data);
                                    recordKeys.Add(recordkey);
                                }
                            }
                            catch(Exception ex)
                            {
                                Interop.Logging.Logger.LogError(ex);
                            }                            
							attachment.Delete();
						}
					}
				}
			}
            return recordKeys.ToArray();
		}