Board index » delphi » knowing if pop3 email has attachment without retrieve it?

knowing if pop3 email has attachment without retrieve it?

hello,

anyone know how to determine if an email has an attachment by the
information in the headers only without retrieving the actual message?

looking at Internet mail suite and Indy components I don't see any way
of doing this.  I basically want the ability to not download emails with
attachments.

the testing that I've done has shown that contenttype can't be relied on

to be reliable and the attachment properties are not set until a
retreive is done.

thanks,
Michael

 

Re:knowing if pop3 email has attachment without retrieve it?


Quote
"Michael Messerschmidt" <rmess...@nospampheaa.org> wrote in message

news:3D174DE9.E7C8E433@nospampheaa.org...

Quote
> anyone know how to determine if an email has an attachment by the
> information in the headers only without retrieving the actual message?
> looking at Internet mail suite and Indy components I don't see any way
> of doing this.  I basically want the ability to not download emails with
> attachments.

This is a limitation of the POP3 protocol.  Have you investigated IMAP4
(specifically the FETCH BODYSTRUCTURE capability).

hth...
--
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.370 / Virus Database: 205 - Release Date: 6/5/2002

Re:knowing if pop3 email has attachment without retrieve it?


Michael,

Quote
> anyone know how to determine if an email has an attachment by the
> information in the headers only without retrieving the actual
message?
>  ...

> the testing that I've done has shown that contenttype can't be
relied on

I always though otherwise. Would you be able to list the facts that
brought you to the conclusion.

Quote
> to be reliable and the attachment properties are not set until a
> retreive is done.

The protocol itself, has no facility to retrieve headers only (IMAP
does if you can use it instead). But, I've heard, people just reset
connection as soon as they retrieve headers of the message thus
preventing sometimes huge attachment be communicated back to the
client. This is, probably, plain wrong from all accounts, but if
nothing else works <g>, could do the trick ...

Alex

Re:knowing if pop3 email has attachment without retrieve it?


Quote
"Alex Brainman" <brain...@sussan.com.au> wrote in message

news:3d17b9b9_2@dnews...

Quote
> Michael,

> The protocol itself, has no facility to retrieve headers only (IMAP
> does if you can use it instead).

 Alex,

although optional,  the TOP command can be used to obtain the header.

Regards,

Mike

Re:knowing if pop3 email has attachment without retrieve it?


Hi Don,

I had a feeling that was the answer.

Quote
> This is a limitation of the POP3 protocol.

No I haven't.  looking at both IMS and Indy help files I don't see any
reference to IMAP4.  Can this protocol be used to retrieve anyones email that
has a pop3 account?

thanks,
Michael

Quote
> Have you investigated IMAP4
> (specifically the FETCH BODYSTRUCTURE capability).

Re:knowing if pop3 email has attachment without retrieve it?


Alex,

well I've had emails that had no contenttype, I've also had emails that
had an attachment but the contenttype said "plain/text", and I've had
emails that had no attachments but the contenttype said it did.
Therefore, I don't consider it a reliable way of determining if there is
an attachment.

Quote
> I always though otherwise. Would you be able to list the facts that
> brought you to the conclusion.

> > to be reliable and the attachment properties are not set until a
> > retreive is done.

yes there is. RetrieveHeaders is the call for IMS components.
Quote

> The protocol itself, has no facility to retrieve headers only (IMAP
> does if you can use it instead). But, I've heard, people just reset
> connection as soon as they retrieve headers of the message thus
> preventing sometimes huge attachment be communicated back to the
> client. This is, probably, plain wrong from all accounts, but if
> nothing else works <g>, could do the trick ...

> Alex

Re:knowing if pop3 email has attachment without retrieve it?


Michael,

Quote
> although optional,  the TOP command can be used to obtain the

header.

My fault, you're right, with exception that hardly anyone implemented
the option; our POP3 server (MS Exchange) doesn't do it anyway <g> ...

Alex

Re:knowing if pop3 email has attachment without retrieve it?


Michael,

Please, be aware, that I'm talking "MIME-Version: 1.0" e-mail here ...

Quote
> well I've had emails that had no contenttype

as per protocol it means "Content-Type: text/plain" (by default), I've
never seen otherwise, send me a sample if you have;

Quote
>, I've also had emails that
> had an attachment but the contenttype said "plain/text"

attachment can be any content type "plain/text" included;

Quote
>, and I've had
> emails that had no attachments but the contenttype said it did.

send me one of those too <g> ...

Quote
> > The protocol itself, has no facility to retrieve headers only ...

> yes there is. RetrieveHeaders is the call for IMS components.

I'm talking "protocol" here not some tricks by XXX vendor. How do you
know if it works and what the implications are?

Alex

Re:knowing if pop3 email has attachment without retrieve it?


"Alex Brainman" <brain...@sussan.com.au> wrote in news:3d190d8d$1_1@dnews:

Quote
> the option; our POP3 server (MS Exchange) doesn't do it anyway <g> ...

Doesnt surprise me. We've had to add so many "hacks" for Exchanges POP3. It
completely violates the RFCs in several places.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
      "Programming is an art form that fights back"

   Want more Indy stuff? Try the Atozed Indy Portal at
        http://www.atozedsoftware.com/
    * More Demos
    * Articles
    * Commercial Support

Posted by ELKNews 1.0.4-B
Empower your News Reader! http://www.atozedsoftware.com

Re:knowing if pop3 email has attachment without retrieve it?


Kudzu,

Quote
> Doesnt surprise me. We've had to add so many "hacks" for Exchanges
POP3. It
> completely violates the RFCs in several places.

Quite possible, but that's what most of us have to live with.
Would be nice to have world changed by rewriting RFC <g> ....

Alex

Re:knowing if pop3 email has attachment without retrieve it?


"Alex Brainman" <brain...@sussan.com.au> wrote in news:3d1ac148$1_2@dnews:

Quote
> Quite possible, but that's what most of us have to live with.
> Would be nice to have world changed by rewriting RFC <g> ....

It'd be more appropriate for MS just to conform to the standard like everyone
else. :)

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
      "Programming is an art form that fights back"

   Want more Indy stuff? Try the Atozed Indy Portal at
        http://www.atozedsoftware.com/
    * More Demos
    * Articles
    * Commercial Support

Posted by ELKNews 1.0.4-B
Empower your News Reader! http://www.atozedsoftware.com

Re:knowing if pop3 email has attachment without retrieve it?


Kudzu,

Quote
> It'd be more appropriate for MS just to conform to the standard like
everyone
> else. :)

Should we vote for it here or it'll just go away <g> ...

Alex

Re:knowing if pop3 email has attachment without retrieve it?


"Alex Brainman" <brain...@sussan.com.au> wrote in news:3d1bba74_2@dnews:

Quote
>> It'd be more appropriate for MS just to conform to the standard like
>> everyone else. :)

> Should we vote for it here or it'll just go away <g> ...

In more recent versions of Exchange MS has been getting better. :)

The older ones are REALLY bad.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
      "Programming is an art form that fights back"

   Want more Indy stuff? Try the Atozed Indy Portal at
        http://www.atozedsoftware.com/
    * More Demos
    * Articles
    * Commercial Support

Posted by ELKNews 1.0.4-B
Empower your News Reader! http://www.atozedsoftware.com

Re:knowing if pop3 email has attachment without retrieve it?


Kudzu,

Quote
> Doesnt surprise me. We've had to add so many "hacks" for Exchanges
POP3. It
> completely violates the RFCs in several places.

Quite possible, but that's what most of us have to live with.
Would be nice to have world changed by rewriting RFC <g> ....

Alex

Re:knowing if pop3 email has attachment without retrieve it?


Kudzu,

Quote
> It'd be more appropriate for MS just to conform to the standard like
everyone
> else. :)

Should we vote for it here or it'll just go away <g> ...

Alex

Go to page: [1] [2]

Other Threads