Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Used as a testing sendmail replacement for use in programs
like mutt as an MTA.  It reads the email to send on the stdin
and then delivers it based on the port and host settings.

lamson sendmail -port 8825 -host 127.0.0.1 -debug 0 -- [recipients]

        def sendmail_command(port=8825, host='127.0.0.1', debug=0, TRAILING=None):
    """
    Used as a testing sendmail replacement for use in programs
    like mutt as an MTA.  It reads the email to send on the stdin
    and then delivers it based on the port and host settings.

    lamson sendmail -port 8825 -host 127.0.0.1 -debug 0 -- [recipients]
    """
    relay = server.Relay(host, port=port,
                           debug=debug)
    data = sys.stdin.read()
    msg = mail.MailRequest(Peer=None, From=None, To=None, Data=data)
    relay.deliver(msg, To=TRAILING)
        


src/l/a/lamson-1.3.4/tests/lamson_tests/command_tests.py   lamson(Download)
                            Subject="Hello", Body="Test body.")
    sys.stdin.read.return_value = str(msg)
    commands.sendmail_command(port=8899)
 
@patch('sys.exit', new=Mock())

src/l/a/lamson-HEAD/tests/lamson_tests/command_tests.py   lamson(Download)
                            Subject="Hello", Body="Test body.")
    sys.stdin.read.return_value = str(msg)
    commands.sendmail_command(port=8899)
 
@patch('sys.exit', new=Mock())