[Zope] MailHost Question

Michael michael@exasource.com
Wed, 16 Jan 2002 14:31:07 -0700


On Wed, 16 Jan 2002, Dieter Maurer contacted me regarding: Re: [Zope] MailHost Question

> Hm.
>
> Your problem is difficult to understand:

Sorry I didn't explain it well. I'm having trouble understanding it myself.

>   Usually "getId" i callable by "Anonymous". Why are you worried?

It doesn't for me, see below:

>   Usually, using a "MailHost" is protected quite heavily.
>   You either must relax the protection (making your site open
>   for email abuse) or use a Proxy role. 

I have the proxy set to Manager

> So, what does not work?

For example, If I have a job posting board and you want to reply to a job which is 
posted on the site, and you use my mailform as is, the email would be sent, the 
attachment would be sent, but when the recipient sees the attachment, it will only 
say:   [] Attachment: 1,  no file name or type.  This make it difficult for them to 
save it since they don't even know what type it is.

<dtml-boundary type="application/octet-stream" disposition="attachment" 
encode="base64" filename_expr="resume_file.getId()"> <dtml-var 
expr="resume_file.read()"></dtml-mime>

Does not work, I get an Attribute Error, "file upload instance has no attribute'getID'
I then added an additional field to my form: doc_name, and changed the code to:

<dtml-boundary type="application/octet-stream" disposition="attachment" 
encode="base64" filename_expr="doc_name"><dtml-var 
expr="resume_file.read()"></dtml-mime>

This does work as long as the user manually enters the filename and type into the 
"doc_name" field on the form.  My question is, is there any way to get the filename 
and type to appear on the recipients email without having to manually enter it?
-- 
Michael Lewis

       "Linux - The final solution"