[Zope] Error with MailHost object

Paolo Dina paolo at php3.it
Wed Nov 26 11:03:48 EST 2003


Sébastien Tessier wrote:
> Hi,
> 
> I am trying to send mails with the mailhost object using the 'send' 
> method and, according to whether the SMTP server I use, sometimes it 
> works and sometimes I have the following error : SMTPRecipientsRefused: 
> {'sebastientessier at bbs-one.fr': (550, 'RCPT 
> TO:<sebastientessier at bbs-one.fr> Relaying not allowed')}
> 
> I use Zope 2.6.2 with windows 2000.
> If someone can explain this to me...

Try this way.

Create a file called popBeforeSmtp inside the folder Extensions ( in 
the root directory of your zope installation ).
Add this content:

import poplib

def popBeforeSmtp():

   M = poplib.POP3('your.mail.server.org')
   M.user('yourUserName')
   M.pass_('yourPassword')

Then instantiate an External Method called mailAuth in your Zope site 
- accessible by the script that sends mail, and root folder is good 
for this purpose - which uses the function popBeforeSmpt.

Before each invocation of send method against mailhost to send mails 
call the external method mailAuth.

Hope this help.
Paolo





More information about the Zope mailing list