Skip to content

Commit

Permalink
Improve some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin committed Mar 19, 2019
1 parent 2a6bee3 commit 73f29a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
8 changes: 4 additions & 4 deletions nullsmtpd/nullsmtpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


# pylint: disable=too-few-public-methods
class NullSMTPDHandler(object):
class NullSMTPDHandler:
"""
Handler for aiosmtpd module. This handler upon receiving a message will write the message
to a file (as well as potentially logging the message if output_messages is True) instead
Expand All @@ -37,7 +37,7 @@ def __init__(self, logger, mail_dir, output_messages=True):
msg = "Invalid mail_dir variable: {}".format(mail_dir)
self.logger.error(msg)
raise SystemExit(msg)
elif not os.path.isdir(mail_dir):
if not os.path.isdir(mail_dir):
try:
os.mkdir(mail_dir)
except IOError as io_error:
Expand Down Expand Up @@ -111,8 +111,8 @@ def main():

if args.no_fork is not True:
pid = os.fork()
if pid is not 0:
raise SystemExit()
if pid != 0:
raise SystemExit("Could not fork nullsmtpd")

host = args.host
port = args.port
Expand Down
14 changes: 1 addition & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
"""
Setup file for nullsmtpd
"""
import os
import pwd
"""Setup file for nullsmtpd."""
from setuptools import setup
from nullsmtpd.version import __author__, __version__

# If we're not running as root, or the /etc/init.d folder doesn't exist, don't bother copying
# in our services file for NullSMTP
# pylint: disable=invalid-name
#if pwd.getpwnam("root").pw_uid != os.getuid() or not os.path.isdir(os.path.join("etc", "init.d")):
# data_files = []
#else:
# data_files = [('/etc/init.d', ['init.d/nullsmtpd'])]

setup(name='nullsmtpd',
version=__version__,
Expand Down Expand Up @@ -41,5 +30,4 @@
'nullsmtpd = nullsmtpd.nullsmtpd:main',
]
},
# data_files=data_files,
install_requires=['aiosmtpd'])

0 comments on commit 73f29a4

Please sign in to comment.