Skip to content

Instantly share code, notes, and snippets.

@cheald
Last active December 14, 2015 15:49
Show Gist options
  • Save cheald/5110319 to your computer and use it in GitHub Desktop.
Save cheald/5110319 to your computer and use it in GitHub Desktop.
# Used to talk to your "relay server" or smart host.
# It supports a few simple operations for sending mail, replying, and can
# log the protocol it uses to stderr if you set debug=1 on __init__.
class Relay
# Public: Set up a new relay
# host - the host to connect to. May accept an IP address or hostname
# port - the port to connect to
# username - optional username to authorize with
# password - optional password to authorize with
# ssl - Flag to toggle SSL usage
# starttls - Use TLS. If set, the `ssl` flag is ignored.
# debug - Debug level to use
def initialize(host = '127.0.0.1', port = 25, username = nil, password = nil, ssl = False, starttls = False, debug = 0)
@hostname = host
@port = port
@debug = debug
@username = username
@password = password
@ssl = ssl
@starttls = starttls
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment