/usr/share/pyshared/flufl/bounce/interfaces.py is in python-flufl.bounce 2.2.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | # Copyright (C) 2011-2013 by Barry A. Warsaw
#
# This file is part of flufl.bounce
#
# flufl.bounce is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, version 3 of the License.
#
# flufl.bounce is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with flufl.bounce. If not, see <http://www.gnu.org/licenses/>.
"""Interfaces."""
from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
'IBounceDetector',
'NoFailures',
'NoPermanentFailures',
'NoTemporaryFailures',
]
from zope.interface import Interface
# Constants for improved readability in detector classes. Use these like so:
#
# - to signal that no temporary or permanent failures were found:
# `return NoFailures`
# - to signal that no temporary failures, but some permanent failures were
# found:
# `return NoTemporaryFailures, my_permanent_failures`
# - to signal that some temporary failures, but no permanent failures were
# found:
# `return my_temporary_failures, NoPermanentFailures`
NoTemporaryFailures = NoPermanentFailures = ()
NoFailures = (NoTemporaryFailures, NoPermanentFailures)
class IBounceDetector(Interface):
"""Detect a bounce in an email message."""
def process(self, msg):
"""Scan an email message looking for bounce addresses.
:param msg: An email message.
:type msg: `Message`
:return: A 2-tuple of the detected temporary and permanent bouncing
addresses. Both elements of the tuple are sets of string
email addresses. Not all detectors can tell the difference
between temporary and permanent failures, in which case, the
addresses will be considered to be permanently bouncing.
:rtype: (set of strings, set of string)
"""
|