small cleanup
This commit is contained in:
parent
f4676e2685
commit
13cc794880
|
@ -176,13 +176,19 @@ class bitmessagePOP3Connection(asyncore.dispatcher):
|
||||||
shared.printLock.release()
|
shared.printLock.release()
|
||||||
raise Exception("Invalid Bitmessage address: {}".format(self.address))
|
raise Exception("Invalid Bitmessage address: {}".format(self.address))
|
||||||
|
|
||||||
|
self.address = addBMIfNotPresent(self.address)
|
||||||
|
|
||||||
# Each identity must be enabled independly by setting the smtppop3password for the identity
|
# Each identity must be enabled independly by setting the smtppop3password for the identity
|
||||||
# If no password is set, then the identity is not available for SMTP/POP3 access.
|
# If no password is set, then the identity is not available for SMTP/POP3 access.
|
||||||
try:
|
try:
|
||||||
self.pw = shared.config.get(addBMIfNotPresent(self.address), "smtppop3password")
|
if shared.config.getboolean(self.address, "enabled"):
|
||||||
|
self.pw = shared.config.get(self.address, "smtppop3password")
|
||||||
yield "+OK user accepted"
|
yield "+OK user accepted"
|
||||||
|
return
|
||||||
except:
|
except:
|
||||||
yield "-ERR account not available"
|
pass
|
||||||
|
|
||||||
|
yield "-ERR access denied"
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def handlePass(self, data):
|
def handlePass(self, data):
|
||||||
|
|
|
@ -147,16 +147,20 @@ class bitmessageSMTPChannel(asynchat.async_chat):
|
||||||
shared.printLock.release()
|
shared.printLock.release()
|
||||||
raise Exception("Invalid Bitmessage address: {}".format(self.address))
|
raise Exception("Invalid Bitmessage address: {}".format(self.address))
|
||||||
|
|
||||||
|
self.address = addBMIfNotPresent(self.address)
|
||||||
|
|
||||||
# Each identity must be enabled independly by setting the smtppop3password for the identity
|
# Each identity must be enabled independly by setting the smtppop3password for the identity
|
||||||
# If no password is set, then the identity is not available for SMTP/POP3 access.
|
# If no password is set, then the identity is not available for SMTP/POP3 access.
|
||||||
try:
|
try:
|
||||||
self.pw = shared.config.get(addBMIfNotPresent(self.address), "smtppop3password")
|
if shared.config.getboolean(self.address, "enabled"):
|
||||||
|
self.pw = shared.config.get(self.address, "smtppop3password")
|
||||||
if pw == self.pw:
|
if pw == self.pw:
|
||||||
self.push('235 Authentication successful. Proceed.')
|
self.push('235 Authentication successful. Proceed.')
|
||||||
self.logged_in = True
|
self.logged_in = True
|
||||||
return
|
return
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.push('530 Access denied.')
|
self.push('530 Access denied.')
|
||||||
self.close_when_done()
|
self.close_when_done()
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user