[Twisted-Python] Help with SMTP Proxy - correction

Jan Van Uytven wyvern at crm3.com
Mon Apr 25 12:35:04 MDT 2005


Thanks Eugene! I'll see if I can rewrite my code to use this concept :)

Cheers,

Jan

Eugene Coetzee wrote:

> Eugene Coetzee wrote:
>
>>>
>>>      smtpServerFactory = ESMTPFactory()
>>> smtpClientFactory = SMTPClientFactory()
>>> smtpServerService = internet.TCPServer(2025, smtpServerFactory)
>>> smtpServerService.setServiceParent(application)
>>>
>>> I've left out actually forwarding the message for now, I just want 
>>> to forward a test e-mail upon receipt of the message. The whole 
>>> structure of this program doesn't seem right to me. I thought 
>>> initially of trying something like adding this to the eomReceived 
>>> method:
>>>
>>> smtpForwardService = internet.TCPClient('localhost', 2030, 
>>> smtpClientFactory)
>>> smtpForwardService.setServiceParent(application)
>>>
>> This is how I'm doing it.
>>
>> http://twistedmatrix.com/pipermail/twisted-python/2005-March/009888.html
>>
>> Conductor instance registers a reference to both smtpServerService  
>> instance and smtpForwardService instance.
>>
>> I would call something like conductor.write(destination) from within 
>> the smtpServerService instance which would in turn  call  a method on 
>> the reference to smtpForwardService from within conductor.
>>
> <snip>
> Conductor instance registers a reference to both smtpServerService  
> instance and smtpForwardService instance.
>
> I would call something like conductor.write(destination) from within 
> the smtpServerService instance which would in turn  call  a method on 
> the reference to smtpForwardService from within conductor.
>
> </snip>
>
> should in fact read ...
>
> Conductor instance registers a reference to both smtpServerFactory  
> instance and smtpClientFactory instance.
>
> I would call something like conductor.write(destination) from within 
> the smtpServer instance which would in turn  call  a method on the 
> reference to smtpClientFactory from within conductor.
>
> Sorry about that.
>





More information about the Twisted-Python mailing list