def validateFrom(helo, origin):
        """
        Validate the address from which the message originates.

        @type helo: 2-L{tuple} of L{bytes} and L{bytes}.
        @param helo: The argument to the HELO command and the client's IP
        address.

        @type origin: L{Address}
        @param origin: The address the message is from

        @rtype: L{Deferred} or L{Address}
        @return: C{origin} or a L{Deferred} whose callback will be
        passed C{origin}.

        @raise SMTPBadSender: Raised of messages from this address are
        not to be accepted.
        """

        Validate the address from which the message originates.

        @type helo: 2-L{tuple} of L{bytes} and L{bytes}.
        @param helo: The argument to the HELO command and the client's IP
        address.

        @type origin: L{Address}
        @param origin: The address the message is from

        @rtype: L{Deferred} or L{Address}
        @return: C{origin} or a L{Deferred} whose callback will be
        passed C{origin}.

        @raise SMTPBadSender: Raised of messages from this address are
        not to be accepted.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/interfaces.py