Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AE.Net.Mail.Attachment.Save() method exception #204

Open
alexneb opened this issue Jun 22, 2018 · 1 comment
Open

AE.Net.Mail.Attachment.Save() method exception #204

alexneb opened this issue Jun 22, 2018 · 1 comment

Comments

@alexneb
Copy link

alexneb commented Jun 22, 2018

Hi guys,

We use AE.Net.Mail to save IMAP mail attachments to specified folders.
We are on the "receiving" side and recently something has changed in "sending" side .
Here is how the attachment metadata now looks
"
Content-Type: application/octet-stream;
name0="FW DEFAULT CCB_UPGRADE_V25 - Defect #165 - Cannot access th";
name
1="e Bill page on a Pending Bill.msg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename0="FW DEFAULT CCB_UPGRADE_V25 - Defect #165 - Cannot access th";
filename
1="e Bill page on a Pending Bill.msg"
Content-ID: <FW DEFAULT CCB_UPGRADE_V25 - Defect #165 - Cannot access the Bill page on a Pending Bill.msg>
"
Apparently when the name of an attachment is "too long" a "multipart" name - filename0 and filename1 is used.

In this case Attachment.Filename in AE.Net.Mail is empty and our code

attachment.Save(config.PARKED_FOLDER + "\" + subject + "\" + attachment.Filename);

results into IO exceptions in AE.Net.Mail.Attachment.Save(String filename) in c:\repos\aenetmail\Attachment.cs:line 46

I am not sure when and IF ever the situation could be fixed in "Sending" end. I need to find a workaround on my side now.

I wonder if there is any other way to get a filename in AE.Net.Mail aside of parsing e-mail body for attachment name. This approach is error prone and would use it as a last resort...

For this particular case we have the following in e-mail body -

Attachment 1 : FW DEFAULT CCB_UPGRADE_V25 - Defect #165 - Cannot access the Bill page on a Pending Bill.msg (see attachment <FW DEFAULT CCB_UPGRADE_V25 - Defect #165 - Cannot access the Bill page on a Pending Bill.msg>)
Attachment 2 :
Attachment 3 :

Thanks a lot for your help in advance!

Alex Nebogatov,

Montreal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@alexneb and others