Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tcl and imap4: How to get the mail-body?

53 views
Skip to first unread message

Thomas Feuerstack

unread,
Nov 2, 2017, 10:22:03 AM11/2/17
to
Hi,

i'm trying to create a simple program, which reads the content of a
mailbox-folder. I've detected the imap4-package, documented under

https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/imap4/imap4.html

and getting the shown example to run with my mail-server was rather easy.

What's still unclear to me is the way, on which i can download the
content/body of mails, i locate in an opened folder (regardless if they
are ascii-text, or structured data which could be fed into the
mime-package), while it seems that ::imap4::fetch only fetches the
content of mailheader-attributes.

Can someone help me, coming around with this?

Thanks a lot - Thomas

Arjen Markus

unread,
Nov 3, 2017, 6:06:29 AM11/3/17
to
I have never used it, but the only command that seems appropriate is "imap4::msginfo", as it is the only command that uses a message ID. The docs are not explicit about that though.

Regards,

Arjen

Thomas Feuerstack

unread,
Nov 3, 2017, 10:22:04 AM11/3/17
to
Am 03.11.2017 um 11:06 schrieb Arjen Markus:
> I have never used it, but the only command that seems appropriate is
> "imap4::msginfo", as it is the only command that uses a message ID.

Thanks for your fast response, which motivated me to search one more
time for hints.

At last i found a (the?) solution by tracking the source code of imap4.tcl.

One can use the keyword TEXT, either in imap4::fetch as in
imap4::msginfo as well to get the E-Mail's textual content.

i.e.

set fields {TEXT}
::imap4::fetch $imap :1 -inline {*}$fields
::imap4::msginfo $imap 1 TEXT

will lead to the desired result.

> The docs are not explicit about that though.

Agreed. They should be extended by list of usable keywords.

Regards - Thomas




0 new messages