Changeset 401 for foomailer


Ignore:
Timestamp:
Dec 24, 2015, 8:14:42 PM (9 years ago)
Author:
Rick van der Zwet
Message:

Typo fixes and tracer function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foomailer/foomail.py

    r400 r401  
    3232
    3333try:
    34     opts, args = getopt.getopt(sys.argv[1:], "f:r:s:dp:",
    35                  ["from=","force","recipient=","server=","spam","port=","virus","files=","dry-run","message=","subject=","to=","cc="])
     34    opts, args = getopt.getopt(sys.argv[1:], "f:r:s:dp:t",
     35                 ["from=","force","recipient=","server=","spam","port=","virus","files=","dry-run","message=","subject=","to=","trace","cc="])
    3636except getopt.GetoptError:
    3737    usage()
     
    4141virus = False
    4242server = False
    43 port = 25
     43port = "25"
     44trace = False
    4445recipient = False
    4546sender = False
     
    6364    elif o in ("-s", "--server"):
    6465        server = a
    65     elif o in ("-p", "--portr"):
     66    elif o in ("-p", "--port"):
    6667        port = a
     68    elif o == "--trace":
     69        trace = True
    6770    elif o == "--spam":
    6871        spam = True
     
    200203    mark = time.time()
    201204    server = smtplib.SMTP(server, port)
     205    server.set_debuglevel(trace)
    202206    server.helo(hostname)
    203207    server.ehlo(hostname)
    204     server.set_debuglevel(0)
    205208    server.sendmail(sender, recipient, email.as_string())
    206209    server.quit()
Note: See TracChangeset for help on using the changeset viewer.