Changeset 400 for foomailer


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

Add port to testing submission for example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foomailer/foomail.py

    r383 r400  
    3232
    3333try:
    34     opts, args = getopt.getopt(sys.argv[1:], "f:r:s:d",
    35                  ["from=","force","recipient=","server=","spam","virus","files=","dry-run","message=","subject=","to=","cc="])
     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="])
    3636except getopt.GetoptError:
    3737    usage()
     
    4141virus = False
    4242server = False
     43port = 25
    4344recipient = False
    4445sender = False
     
    6263    elif o in ("-s", "--server"):
    6364        server = a
     65    elif o in ("-p", "--portr"):
     66        port = a
    6467    elif o == "--spam":
    6568        spam = True
     
    120123    email['Cc'] = cc
    121124email['X-Server'] = server
     125email['X-Port'] = port
    122126email['X-Hostname'] = hostname
    123127email['Message-ID' ] = '<' +''.join(random.sample(string.letters +
     
    195199if not dry:
    196200    mark = time.time()
    197     server = smtplib.SMTP(server)
     201    server = smtplib.SMTP(server, port)
    198202    server.helo(hostname)
    199203    server.ehlo(hostname)
Note: See TracChangeset for help on using the changeset viewer.