[Buildbot-devel] Restricting failure emails

Benoît Allard benoit at aeteurope.nl
Mon Mar 11 08:58:06 UTC 2013


I'm setting the `lookup` parameter to this class in order to filter out email addresses based on their domain::

    class emailLookup(util.ComparableMixin):
        implements(interfaces.IEmailLookup)
        compare_attrs = ["homedomain"]

        def __init__(self, homedomain):
            self.homedomain = homedomain

        def getAddress(self, name):
            if '@%s' % self.homedomain in name:
                return name.encode('utf-8')
            log.msg("Not sending an email to '%s', he is an extern." % name)
            return None

Used like that::

    mail.MailNotifier(...
                      lookup = emailLookup(cfg.MAIL_LOOKUP)
                      ...
                     )

Regards,
Benoît.

> -----Original Message-----
> From: Evan Driscoll [mailto:driscoll at cs.wisc.edu]
> Sent: Saturday, March 09, 2013 6:15 PM
> To: buildbot-devel at lists.sourceforge.net
> Subject: [Buildbot-devel] Restricting failure emails
> 
> I'm using the MailNotifier to send emails.
> 
> Is it possible to send emails to the "interested users" *except* for a
> particular address? E.g. suppose Joe makes only very occasional commits
> and it's easier to just bug him in person. Can I say something like
> MailNotifier(... excludeAddresses="joe at example.com")?
> 
> Evan
> 
> 
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel




More information about the devel mailing list