[Zope] error trying to import smtplib (unauthorized)

Chris Withers chris at simplistix.co.uk
Thu Oct 13 10:21:32 EDT 2005


Nicolas Georgakopoulos wrote:
> Trying to execute the following code from a python script
> 
> from smtplib import SMTP
> from email.MIMEText import MIMEText
> 
> I get a error:
> 
> *Error Type: ImportError*
> *Error Value: import of "SMTP" from "smtplib" is unauthorized. You are 
> not allowed to access 'SMTP' in this context
> *
> Why I can't access SMTP if I am a user manager with all the access 
> enabled for managers in the current context ?

*continues banging head against brick wall*

Because it has no security declarations. If you bothered to install 
VerboseSecurity it would have told you this...

MailHosts are how you send mail in Zope...

MailTemplates are what you want to use, I still don't understand why 
you're having so many problems, I simply cannot reproduce what you're 
seeing...

Start with a fresh, clean Zope instance and tell me the steps you go 
(every single one of them!) through to get to the point where you can 
try the python script and get the errors you were complaining about 
before...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list