Extracting attachments from emails

Clovertech Forums Read Only Archives Cloverleaf General Extracting attachments from emails

  • Creator
    Topic
  • #50032
    garry r fisher
    Participant

      Hi,

      A client has asked if I can take attachments from emails and push them through the engine. This looked straightforward so I wrote a script using tcllib pop3 and mime libraries to access a mailbox, pull down the message and using MIME extract the attachment which is a CSV file. For some reason it doesn’t work. I can get the message but it fails to recognise the file as MIME – Even though I know it is and can see the MIME headers etc.

      It looks to me as though I’m missing a step I don’t know what it is. Has anybody else done anything like this and if so can they offer any advice?

      I’ve included the code – it fails at the mime initialise ‘IF’. I’ve also included a sample output from a run. Both emails are MIME and both fail.

      Regards

      Garry

    Viewing 1 reply thread
    • Author
      Replies
      • #64618
        Kevin Kinnell
        Participant

          Garry,

          Have you run this extraction routine outside of Cloverleaf, just to nail that

          part down without the “running in a TPS” distractions?  I’m thinking you may

          discover problems with your mimeutils namespace and load order — it would

          probably be better to make that a package.

        • #64619
          garry r fisher
          Participant

            Hi Kevin,

            I was hoping to get it working first before looking at putting in a package. At the moment it hit’s that first if in the mimeutils that should initialise the part(s) and exits with the error that this file is not mime.

            I’m looking at doing it the long way now and reading the message line by line and extracting the attachment that way.

            If anybody does get this working or has similar code then I’d be interested to know how.

            Regards

            Garry

        Viewing 1 reply thread
        • The forum ‘General’ is closed to new topics and replies.