Please try
if (opts.starttls) or (port in (25, 587, 110, 143, 21)):
Convert it to tuple.
solved Invalid syntax error in Python HeartBleed script
Please try
if (opts.starttls) or (port in (25, 587, 110, 143, 21)):
Convert it to tuple.
solved Invalid syntax error in Python HeartBleed script