This project is read-only.

message.Attachments sometimes is wrong

Topics: Issues
Jan 23, 2014 at 11:03 PM
Edited Jan 23, 2014 at 11:05 PM
Hi,

sometimes, the message.Attachment.Count is zero even if there are attachments.
Here is the log (I've changed the mail addresses manually):
IMAPX24 UID FETCH 368 (FLAGS BODYSTRUCTURE)

* 339 FETCH (FLAGS (\Answered) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 1563 33 NIL ("inline" NIL))("APPLICATION" "XML" ("name" "daticert.xml") NIL NIL "base64" 1236 NIL ("inline" ("filename" "daticert.xml")))("MESSAGE" "RFC822" ("name" "postacert.eml") NIL NIL "7BIT" 919 ("Thu, 23 Jan 2014 15:59:24 +0100" "prova - PECID=2964" ((NIL NIL "mario.rossi" "postecert.it")) ((NIL NIL "mario.rossi" "postecert.it")) ((NIL NIL "mario.rossi" "postecert.it")) ((NIL NIL "pinco.pallo" "pec.ording.roma.it")) NIL NIL NIL "<E685AED3.00243072.BF9CEA08.0B946E84.posta-certificata@postecert.it>") ("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "7bit" 7 1) 21 NIL ("attachment" ("filename" "postacert.eml"))) "MIXED" ("boundary" "----------=_1390489180-9987-7"))("APPLICATION" "X-PKCS7-SIGNATURE" ("name" "smime.p7s") NIL NIL "base64" 3412 NIL ("attachment" ("filename" "smime.p7s"))) "SIGNED" ("protocol" "application/x-pkcs7-signature" "micalg" "sha1" "boundary
" "----F66FF9B4EFA24E0CC07B434906A082AE")) UID 368)
IMAPX24 OK FETCH complete

A first chance exception of type 'System.FormatException' occurred in System.dll
The attachment are:
smime.p7s
daticert.xml
postacert.eml

please note that I've performed some modifications to the source code because of some "infinite loops" (see my previus discussion)

It happens only sometimes... but I've not yet identified the cause.
How is it possible ? Of course, I can access to the attachment accessing the webmail site
thanks in advance
Francesco
Jan 23, 2014 at 11:19 PM
Edited Jan 23, 2014 at 11:20 PM
Here is another log. Similar case.
I hope it can be useful to identify the problem.
IMAPX26 UID FETCH 373 (FLAGS INTERNALDATE RFC822.SIZE BODYSTRUCTURE)

* 344 FETCH (FLAGS (\Answered \Seen) INTERNALDATE "24-Jan-2014 00:14:10 +0100" RFC822.SIZE 9381 BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 1561 33 NIL ("inline" NIL))("APPLICATION" "XML" ("name" "daticert.xml") NIL NIL "base64" 1254 NIL ("inline" ("filename" "daticert.xml")))("MESSAGE" "RFC822" ("name" "postacert.eml") NIL NIL "7BIT" 762 ("Fri, 24 Jan 2014 00:14:04 +0100" "test PECID=44444" (("mario.rossi@postecert.it" NIL "mario.rossi" "postecert.it")) (("mario.rossi@postecert.it" NIL "mario.rossi" "postecert.it")) (("mario.rossi@postecert.it" NIL "mario.rossi" "postecert.it")) ((NIL NIL "pinco.pallo" "pec.ording.roma.it")) NIL NIL NIL "<E685AED3.002488A0.C161BAF9.0B946E84.posta-certificata@postecert.it>") ("TEXT" "PLAIN" ("charset" "UTF-8") NIL NIL "7bit" 6 1) 15 NIL ("attachment" ("filename" "postacert.eml"))) "MIXED" ("boundary" "----------=_1390518849-13421-7"))("APPLICATION" "X-PKCS7-SIGNATURE" ("name" "sm
ime.p7s") NIL NIL "base64" 3412 NIL ("attachment" ("filename" "smime.p7s"))) "SIGNED" ("protocol" "application/x-pkcs7-signature" "micalg" "sha1" "boundary" "----C2F88B13D4C6D68F9FC7920E6965D6C7")) UID 373)
* 343 FETCH (FLAGS (\Answered \Seen))
* 343 FETCH (FLAGS (\Answered \Seen))
* 344 FETCH (FLAGS (\Answered \Seen))
* 344 FETCH (FLAGS (\Answered \Seen))
IMAPX26 OK FETCH complete
A first chance exception of type 'System.FormatException' occurred in System.dll
IMAPX27 UID FETCH 373 (BODY.PEEK[1.1.MIME] BODY.PEEK[1.1])

* 344 FETCH (BODY[1.1.MIME] {124}
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

 BODY[1.1] {1561}
-- Ricevuta di avvenuta consegna del messaggio indirizzato a guglielmo.vita=
le@pec.ording.roma.it "posta certificata" --

Il giorno 24/01/2014 alle ore 00:14:09 (+0100) il messaggio con Oggetto
"test PECID=3D44444" inviato da "mario.rossi@postecert.it"
ed indirizzato a "pinco.pallo@pec.ording.roma.it"
e' stato correttamente consegnato al destinatario.
Identificativo del messaggio: E685AED3.002488A0.C161BAF9.0B946E84.posta-cer=
tificata@postecert.it
Il messaggio originale e' incluso in allegato, per aprirlo cliccare sul fil=
e "postacert.eml" (nella webmail o in alcuni client di posta l'allegato pot=
rebbe avere come nome l'oggetto del messaggio originale).
L'allegato daticert.xml contiene informazioni di servizio sulla trasmissione


NOTA
  La presenza o meno del messaggio originale, come allegato della ricevuta =
di consegna (file postacert.eml),
 dipende dal tipo di ricevuta di consegna che e' stato scelto di ricevere, =
secondo la seguente casistica:


 - Ricevuta di consegna completa (Default): il messaggio originale
   completo e' allegato alla ricevuta di consegna.
 - Ricevuta di consegna breve: il messaggio originale  e' allegato alla
   ricevuta di consegna  ma eventuali allegati presenti al suo interno
   verranno sostituiti con i rispettivi hash.
 - Ricevuta di consegna sintetica: il messaggio originale non verra'
   allegato nella ricevuta di consegna.

   Per maggiori dettagli consultare:
    http://kb.aruba.it/KB/a701/ricevuta-di-avvenuta-consegna.aspx?KBSearchI=
D=3D1358305
 UID 373)
IMAPX27 OK FETCH complete
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
IMAPX28 UID FETCH 373 (BODY.PEEK[1.2.MIME] BODY.PEEK[1.2])

* 344 FETCH (BODY[1.2.MIME] {143}
Content-Type: application/xml; name="daticert.xml"
Content-Disposition: inline; filename="daticert.xml"
Content-Transfer-Encoding: base64

 BODY[1.2] {1254}
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHBvc3Rh
Y2VydCB0aXBvPSJhdnZlbnV0YS1jb25zZWduYSIgZXJyb3JlPSJu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Z25hPgogICAgPC9kYXRpPgo8L3Bv
c3RhY2VydD4K
 UID 373)
IMAPX28 OK FETCH complete
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
IMAPX29 UID FETCH 373 (BODY.PEEK[1.3.MIME] BODY.PEEK[1.3])

* 344 FETCH (BODY[1.3.MIME] {111}
Content-Type: message/rfc822; name=postacert.eml
Content-Disposition: attachment; filename="postacert.eml"

 BODY[1.3] {762}
Received: from pec-webmail-be2 (192.168.45.241) by relay.postecert.it (8.6.036.03)
        id 52CEDCB20023805A for pinco.pallo@pec.ording.roma.it; Fri, 24 Jan 2014 00:14:04 +0100
Received: from (192.168.44.147) by 192.168.45.241;  Fri, 24 Jan 2014 00:14:04 +0100
Message-ID: <E685AED3.002488A0.C161BAF9.0B946E84.posta-certificata@postecert.it>
Date: Fri, 24 Jan 2014 00:14:04 +0100 (CET)
From: "mario.rossi@postecert.it" <mario.rossi@postecert.it>
To: pinco.pallo@pec.ording.roma.it
Subject: test PECID=44444
MIME-Version: 1.0
Content-Type: text/plain;charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-TipoRicevuta: completa
X-Riferimento-Message-ID: <3711757.281231390518844008.JavaMail.defaultUser@defaultHost>

 BLA
 UID 373)
IMAPX29 OK FETCH complete
thank you
Francesco
Jan 31, 2014 at 3:37 PM
Edited Jan 31, 2014 at 3:39 PM
Hi Pavel,

I'm testing the new source code. Some of the problems seem to be fixed.
But I still have a problem with the attachments.
Infact, sometimes, accessing to the m.Attachments I get null. But the attachment is present !
can you check this issue ?

here is the log (the mail address is replaced with .)

best regards,
francesco
The thread 0x3140 has exited with code 259 (0x103).
'Rimtest.vshost.exe' (CLR v4.0.30319: Rimtest.vshost.exe): Loaded 'C:\rim_old\Rimtest\Rimtest\bin\Release\PecManager.dll'. Symbols loaded.
'Rimtest.vshost.exe' (CLR v4.0.30319: Rimtest.vshost.exe): Loaded 'C:\rim_old\Rimtest\Rimtest\bin\Release\ImapX.dll'. Symbols loaded.
IMAPX1 CAPABILITY

* CAPABILITY IMAP4rev1 UIDPLUS IDLE LOGIN-REFERRALS NAMESPACE QUOTA CHILDREN AUTH=CRAM-MD5 AUTH=DIGEST-MD5
IMAPX1 OK capabilities listed
IMAPX2 LOGIN "***.***@postecert.it" "******"

IMAPX2 OK login successful
IMAPX3 LIST "" %

* LIST (\HasNoChildren) "/" Drafts
* LIST (\NoInferiors) NIL INBOX
* LIST (\HasNoChildren) "/" "Sent Items"
* LIST (\HasNoChildren) "/" trash
IMAPX3 OK LIST completed
IMAPX4 EXAMINE "Drafts"

* 3 EXISTS
* 0 RECENT
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
* OK [PERMANENTFLAGS ()] cannot change any flags
* OK [UIDVALIDITY 1381496218] mailbox UID validity
* OK [UIDNEXT 66] predicted next UID
IMAPX4 OK [READ-ONLY] EXAMINE complete
IMAPX5 EXAMINE "INBOX"

* 347 EXISTS
* 0 RECENT
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
* OK [PERMANENTFLAGS ()] cannot change any flags
* OK [UIDVALIDITY 1239258136] mailbox UID validity
* OK [UNSEEN 323] first unseen message number
* OK [UIDNEXT 377] predicted next UID
IMAPX5 OK [READ-ONLY] EXAMINE complete
IMAPX6 EXAMINE "Sent Items"

* 8 EXISTS
* 0 RECENT
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
* OK [PERMANENTFLAGS ()] cannot change any flags
* OK [UIDVALIDITY 1381496218] mailbox UID validity
* OK [UIDNEXT 10] predicted next UID
IMAPX6 OK [READ-ONLY] EXAMINE complete
IMAPX7 EXAMINE "trash"

* 0 EXISTS
* 0 RECENT
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
* OK [PERMANENTFLAGS ()] cannot change any flags
* OK [UIDVALIDITY 1239258900] mailbox UID validity
* OK [UIDNEXT 29] predicted next UID
IMAPX7 OK [READ-ONLY] EXAMINE complete
IMAPX8 SELECT "INBOX"

* 347 EXISTS
* 0 RECENT
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)] flags can be changed
* OK [UIDVALIDITY 1239258136] mailbox UID validity
* OK [UNSEEN 323] first unseen message number
* OK [UIDNEXT 377] predicted next UID
IMAPX8 OK [READ-WRITE] SELECT complete
IMAPX9 UID SEARCH UNSEEN SUBJECT "PECID="

* SEARCH 374 375
IMAPX9 OK SEARCH complete
IMAPX10 UID FETCH 374 (FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (FROM TO DATE SUBJECT CC CONTENT-TYPE)] BODYSTRUCTURE)

* 345 FETCH (FLAGS () INTERNALDATE "25-Jan-2014 07:28:01 +0100" RFC822.SIZE 6236 BODY[HEADER.FIELDS (FROM TO DATE SUBJECT CC CONTENT-TYPE)] {300}
Date: Sat, 25 Jan 2014 07:28:00 +0100
From: posta-certificata@postecert.it
To: ***.***@postecert.it
Subject: ACCETTAZIONE: a - PECID=2965
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; 
    boundary="----=_Part_6658544_6309986.1390631280060"

 BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "ISO-8859-1") NIL NIL "quoted-printable" 382 9)("APPLICATION" "XML" ("name" "daticert.xml" "charset" "UTF-8") NIL NIL "quoted-printable" 855 NIL ("attachment" ("filename" "daticert.xml"))) "MIXED" ("boundary" "----=_Part_6658543_22444531.1390631280059"))("APPLICATION" "X-PKCS7-SIGNATURE" ("name" "smime.p7s") NIL "S/MIME Cryptographic Signature" "base64" 3274 NIL ("attachment" ("filename" "smime.p7s"))) "SIGNED" ("protocol" "application/x-pkcs7-signature" "micalg" "sha1" "boundary" "----=_Part_6658544_6309986.1390631280060")) UID 374)
IMAPX10 OK FETCH complete
'Rimtest.vshost.exe' (CLR v4.0.30319: Rimtest.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_it_b77a5c561934e089\System.resources.dll'. Module was built without symbols.
A first chance exception of type 'System.FormatException' occurred in System.dll
IMAPX11 UID FETCH 375 (FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (FROM TO DATE SUBJECT CC CONTENT-TYPE)] BODYSTRUCTURE)

* 346 FETCH (FLAGS () INTERNALDATE "25-Jan-2014 07:28:02 +0100" RFC822.SIZE 9486 BODY[HEADER.FIELDS (FROM TO DATE SUBJECT CC CONTENT-TYPE)] {289}
Subject: CONSEGNA: a - PECID=2965
Date: Sat, 25 Jan 2014 07:28:00 +0100
To: ***.***@postecert.it
From: posta-certificata@pec.aruba.it
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="----EEF6304B4D5C6291F49FDE06B44356B3"

 BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 1559 33 NIL ("inline" NIL))("APPLICATION" "XML" ("name" "daticert.xml") NIL NIL "base64" 1232 NIL ("inline" ("filename" "daticert.xml")))("MESSAGE" "RFC822" ("name" "postacert.eml") NIL NIL "7BIT" 907 ("Sat, 25 Jan 2014 07:27:54 +0100" "a - PECID=2965" ((NIL NIL "***.***" "postecert.it")) ((NIL NIL "***.***" "postecert.it")) ((NIL NIL "***.***" "postecert.it")) ((NIL NIL "guglielmo.vitale" "pec.ording.roma.it")) NIL NIL NIL "<E685AED3.0025EED4.C8155DB9.0B946E84.posta-certificata@postecert.it>") ("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "7bit" 3 1) 21 NIL ("attachment" ("filename" "postacert.eml"))) "MIXED" ("boundary" "----------=_1390631280-25602-7"))("APPLICATION" "X-PKCS7-SIGNATURE" ("name" "smime.p7s") NIL NIL "base64" 3412 NIL ("attachment" ("filename" "smime.p7s"))) "SIGNED" ("protocol" "application/x-pkcs7-signature" "micalg" "sha1" "boundary" "----EEF6304B4D5C6291F49FDE06B44356B3")) UID 375)
IMAPX11 OK FETCH complete
A first chance exception of type 'System.FormatException' occurred in System.dll
A first chance exception of type 'System.ArgumentNullException' occurred in System.Core.dll
A first chance exception of type 'System.ArgumentNullException' occurred in PecManager.dll
Jan 31, 2014 at 4:26 PM
Pavel,

I've runned the same test twice, with both the libraries, against the same mail server and same messages.

The old version of Imapx 2.0.0.15 - sometimes - was not able to detect attachment.
The new source code of the Imapx 2.0.0.15 is systematically wrong in detecting attachment.
All my messages have attachments.

I've a log (but is too long to post here). If you want, I can send it to you by mail.
Let me know
thank you

francesco
Jan 31, 2014 at 5:33 PM
Edited Jan 31, 2014 at 5:35 PM
Hi Francesco,

it would be good to see the log, feel free to send it to my mail. ( p13a92@gmail.com )

Greets,

Pavel
Feb 11, 2014 at 1:57 AM
Hi Pavel,

any news about the attachments issue ?
I've provided the log in separated email.

Please let me know :)

best regards,
Francesco



2014-01-31 18:33 GMT+01:00 pavel_azanov <[email removed]>:

From: pavel_azanov

Hi Francesco,

it would be good to see the log, feel free to send it to my mail. [email removed] )

Greets,

Pavel

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Feb 12, 2014 at 11:56 AM
Hi agilesferlix,

sorry for the delayed response, I received the log and took a look at it. Currently I'm preparing a new release whih should fix this problem. It's an issue within the BodyStructureParser class.

Greets,

Pavel
Feb 24, 2014 at 9:15 AM
Hi Pavel,

Any news about new release ?
The issue starts to be a problem for me....... At the moment, even a patch would be great :)

Greets,
Francesco
Apr 8, 2014 at 8:18 PM
Good evening!

Please have a look at the latest code in the repository. Various fixes have been done. I'd be happy if you can test it and give some feedback!

Best regards,

Pavel
May 15, 2014 at 9:22 AM
I found out about this problem too.
I have other mails with attachments, but the Attachments collection of the Message object is empty (Attachments = {ImapX.Attachment[0]})

ContentDisposition of the attachment bodypart = {inline; filename=wr_out_050314161002.txt}
May 15, 2014 at 9:54 AM
Hi M_DB,

the inline attachments can be accessed through Message.EmbeddedResources. If you can find your attachment there, then all is fine, otherwise it's a bug in the bodystructure parser and I'm working on improving it.

Greets,

Pavel