Skip to content

Commit

Permalink
Removed -e option\nFixes:ASPP#18
Browse files Browse the repository at this point in the history
  • Loading branch information
ASPP Student committed Sep 2, 2019
1 parent 3c22e5c commit 4e2f638
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions massmail
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ Options:
-s SEPARATOR set field separator in parameter file,
default: ";"
-e ENCODING set PARAMETER_FILE *and* BODY character set
encoding, default: "UTF-8". Note that if you fuck
up this one, your email will be full of rubbish:
You have been warned!
-f fake run: don't really send emails, just print to
standard output what would be done. Don't be scared
if you can not read the body: it is base64 encoded
Expand All @@ -85,7 +80,8 @@ Notes:
separated list of email addresses.
Keep in mind shell escaping when setting headers with white spaces or special
characters.
Character set encodings are those supported by python.
Character set encodings are those supported is "UTF-8"
Examples:
Expand Down Expand Up @@ -125,7 +121,7 @@ def parse_command_line_options(arguments):
Arguments are checked for validity.
"""
try:
opts, args = getopt.getopt(arguments, "hfs:F:S:B:C:R:e:u:p:P:z:")
opts, args = getopt.getopt(arguments, "hfs:F:S:B:C:R:u:p:P:z:")
except getopt.GetoptError as err:
error(str(err)+USAGE)

Expand All @@ -137,7 +133,7 @@ def parse_command_line_options(arguments):
'subject': '',
'bcc': '',
'cc': '',
'encoding': 'utf-8',
#'encoding': 'utf-8',
'smtpuser': None,
'smtppassword': None,
'server': None,
Expand All @@ -146,8 +142,6 @@ def parse_command_line_options(arguments):
}

for option, value in opts:
if option == "-e":
options['encoding'] = value
if option == "-s":
options['sep'] = value
elif option == "-F":
Expand Down Expand Up @@ -244,7 +238,7 @@ def create_email_bodies(options, keywords, email_count, body):
lbody = re.sub(r'\$\w+\$', lambda m: keywords[m.group(0)][i], body)

# encode body
lbody = email.mime.text.MIMEText(lbody.encode(options['encoding']), 'plain', options['encoding'])
lbody = email.mime.text.MIMEText(lbody.encode('utf-8'), 'plain', 'utf-8')
msgs[keywords['$EMAIL$'][i]] = lbody

return msgs
Expand Down

0 comments on commit 4e2f638

Please sign in to comment.