Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
f4fa9c93
Commit
f4fa9c93
authored
Mar 29, 2015
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #366 from hnk/hnk-patch-read_password
Change read_password() logic to catch short passwords
parents
3d21f222
6c64723d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
mail.py
tools/mail.py
+11
-7
No files found.
tools/mail.py
View file @
f4fa9c93
...
@@ -28,13 +28,17 @@ def mgmt(cmd, data=None, is_json=False):
...
@@ -28,13 +28,17 @@ def mgmt(cmd, data=None, is_json=False):
return
resp
return
resp
def
read_password
():
def
read_password
():
first
=
getpass
.
getpass
(
'password: '
)
while
True
:
second
=
getpass
.
getpass
(
' (again): '
)
first
=
getpass
.
getpass
(
'password: '
)
while
first
!=
second
:
if
len
(
first
)
<
4
:
print
(
'Passwords not the same. Try again.'
)
print
(
'Passwords must be at least four characters.'
)
first
=
getpass
.
getpass
(
'password: '
)
continue
second
=
getpass
.
getpass
(
' (again): '
)
second
=
getpass
.
getpass
(
' (again): '
)
return
first
if
first
!=
second
:
print
(
'Passwords not the same. Try again.'
)
continue
break
return
first
def
setup_key_auth
(
mgmt_uri
):
def
setup_key_auth
(
mgmt_uri
):
key
=
open
(
'/var/lib/mailinabox/api.key'
)
.
read
()
.
strip
()
key
=
open
(
'/var/lib/mailinabox/api.key'
)
.
read
()
.
strip
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment