Skip to content

Commit

Permalink
Display correct version on client connect
Browse files Browse the repository at this point in the history
IN MASTER
  • Loading branch information
moggers87 committed Sep 5, 2016
1 parent 9674471 commit 45da300
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
1 change: 0 additions & 1 deletion docs/salmon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Submodules
salmon.server
salmon.testing
salmon.utils
salmon.version
salmon.view

Module contents
Expand Down
7 changes: 0 additions & 7 deletions docs/salmon.version.rst

This file was deleted.

1 change: 1 addition & 0 deletions salmon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.99.99"
9 changes: 4 additions & 5 deletions salmon/commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from salmon import server, utils, mail, routing, queue, encoding, version
import salmon

import argparse
import email
import glob
Expand All @@ -10,6 +7,9 @@
import signal
import sys

from salmon import server, utils, mail, routing, queue, encoding
import salmon


COMMANDS = (
("start", "starts aserver"),
Expand All @@ -29,9 +29,8 @@

version_info = """
Salmon-Version: %s
Repository-Revision: %s
Version-File: %s
""" % (version.VERSION['version'], version.VERSION['rev'], version.__file__)
""" % (salmon.__version__, salmon.__file__)

copyright_notice = """
Salmon is Copyright (C) Matt Molyneaux 2014-2015. Licensed GPLv3.
Expand Down
19 changes: 9 additions & 10 deletions salmon/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
The majority of the server related things Salmon needs to run, like receivers,
The majority of the server related things Salmon needs to run, like receivers,
relays, and queue processors.
"""

Expand All @@ -15,13 +15,12 @@
from dns import resolver
import lmtpd

from salmon import queue, mail, routing, version
from salmon import queue, mail, routing, __version__
from salmon.bounce import PRIMARY_STATUS_CODES, SECONDARY_STATUS_CODES, COMBINED_STATUS_CODES


ver = version.VERSION['version'] # yo dawg
smtpd.__version__ = "Salmon Mail router SMTPD, version %s" % ver
lmtpd.__version__ = "Salmon Mail router LMTPD, version %s" % ver
smtpd.__version__ = "Salmon Mail router SMTPD, version %s" % __version__
lmtpd.__version__ = "Salmon Mail router LMTPD, version %s" % __version__


def undeliverable_message(raw_message, failure_type):
Expand Down Expand Up @@ -54,7 +53,7 @@ def __init__(self, code, message=None):

def error_for_code(self, code):
primary, secondary, tertiary = str(code)

primary = PRIMARY_STATUS_CODES.get(primary, "")
secondary = SECONDARY_STATUS_CODES.get(secondary, "")
combined = COMBINED_STATUS_CODES.get(primary + secondary, "")
Expand All @@ -64,7 +63,7 @@ def error_for_code(self, code):

class Relay(object):
"""
Used to talk to your "relay server" or smart host, this is probably the most
Used to talk to your "relay server" or smart host, this is probably the most
important class in the handlers next to the salmon.routing.Router.
It supports a few simple operations for sending mail, replying, and can
log the protocol it uses to stderr if you set debug=1 on __init__.
Expand Down Expand Up @@ -167,7 +166,7 @@ def __init__(self, host='127.0.0.1', port=8825):
in deployment you'd give 0.0.0.0 for "all internet devices" but consult
your operating system.
This uses smtpd.SMTPServer in the __init__, which means that you have to
This uses smtpd.SMTPServer in the __init__, which means that you have to
call this far after you use python-daemonize or else daemonize will
close the socket.
"""
Expand Down Expand Up @@ -217,7 +216,7 @@ def __init__(self, host='127.0.0.1', port=8824, socket=None):
localhost. If socket is not None, it will be assumed to be a path name
and a UNIX socket will be set up instead.
This uses lmtpd.LMTPServer in the __init__, which means that you have to
This uses lmtpd.LMTPServer in the __init__, which means that you have to
call this far after you use python-daemonize or else daemonize will
close the socket.
"""
Expand Down Expand Up @@ -303,7 +302,7 @@ def start(self, one_shot=False):

inq.remove(key)

if one_shot:
if one_shot:
return
else:
time.sleep(self.sleep)
Expand Down
1 change: 0 additions & 1 deletion salmon/version.py

This file was deleted.

0 comments on commit 45da300

Please sign in to comment.