[Twisted-Python] Twisted.mail SMTP server question

Stephen Thorne stephen at thorne.id.au
Sun Mar 15 05:37:46 EDT 2009


On 2009-03-12, Kalman KHIRALY wrote:
> Hi!
> 
> I would like to use twisted mail for the following purpose:
> Redirect all incoming myname at mydomain.com mails to a specified gmail address:
> myname at mydomain.com -> myname.mydomain at gmail.com

The easiest way to do this is with a postfix address resolution daemon.
You can just use postfix.PostfixTCPMapServer to do it.

It will be something along the lines of:

class AddressResolverFactory(protocol.ServerFactory):
    protocol = postfix.PostfixTCPMapServer

    def get(self, emailaddress):
        if doesnotmatchpattern(emailaddress):
            return None

        return transform(emailaddress)

reactor.listenTCP(12345, AddressResolverFactory())

Then you just throw all the email addresses at it from postfix like so:

virtual_alias_maps = tcp:127.0.0.1:12345
virtual_mailbox_maps = tcp:127.0.0.1:12345

-- 
Regards,
Stephen Thorne
Development Engineer
NetBox Blue - 1300 737 060

Find out why NetBox Blue's solutions are growing in popularity in 
today's economic environment: http://netboxblue.com/news/creditcrunch 


Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)





More information about the Twisted-Python mailing list