Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

POP CFC
Project Home Known Issues Contact Project

POP CFC Issue: Download attachment with colon (:) in the file name

Name: Download attachment with colon (:) in the file name
ID: 11
Project: POP CFC
Type: Bug
Area: Code
Severity: Normal
Status: Closed
Related URL:
Creator: Mike Furtado
Created: 08/10/14 3:13 PM
Updated: 08/11/14 4:23 AM
Description: I am regularly receiving attachments with a time string delimited by ":" in the file name, these attachments are not downloaded with the getMessages() function.
History: Created by HotrodScamp (Mike Furtado) : 08/10/14 3:13 PM

Comment by newmediadev (Paul Vernon) : 08/11/14 4:22 AM
This isn't a bug in POP CFC, the getMessages function uses cfpop under the hood and as such it restricted to the same functionality of CFPOP.

You should use the other functions within POPCFC to work around the limitations of cfpop.

I suggest that you use code based around this:

   <cfset popAccount = createObject("component", "pop").init(myHostname, myUsername, myPassword)>
   <cfset popAccount.setProperty("separator", "|")>
   <cfset popAccount.setProperty("generateUniqueFilenames", true)>
   <cfif popAccount.hasMail()>
      <cfset myUIDList = popAccount.getUIDList()>
      <cfset msgSrc = popAccount.GetRawMessageByUID(ArrayToList(myUIDList, "|"))>
      <cfset messages = popAccount.parseRawMessage(msgSrc)>
      <cfdump var="#messages#">
   <cfelse>
      <p>Mailbox is empty.</p>
   </cfif>

This code will allow you to process the emails in such a way as to save the attachments with OS friendly filenames (by removing the ':') and also giving you the original filename.

Updated by newmediadev (Paul Vernon) : 08/11/14 4:23 AM
Closed as it's not a bug. See my other comments regarding how to work around the issue.

To add a comment to this bug, please login using the link above.