Skip to content

Instantly share code, notes, and snippets.

@NIXKnight
Last active November 7, 2018 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NIXKnight/234f53dae3d9180ab6bb229bab11b248 to your computer and use it in GitHub Desktop.
Save NIXKnight/234f53dae3d9180ab6bb229bab11b248 to your computer and use it in GitHub Desktop.
Generate PostfixAdmin Compatible MD5 Password Hash
from passlib.hash import md5_crypt
# Suppose that password hash for PostfixAdmin admin user is $1$deceb114$ABCDefghIJKLmN09Q4sTn/
# The salt will be the part between $1$ and $. Hence:
salt = 'deceb114'
# The print command below will generate a PostfixAdmin compatible MD5 hash of the password (which is KNIGHT)
print md5_crypt.using(salt=salt).hash('KNIGHT')
@NIXKnight
Copy link
Author

Thanks to @asamolion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment