Encode/decode SMTP AUTH username/passwords
When using SMTP AUTH, the username and password are base64 encoded. Here’s a snip of perl that will encode a string:
|
1 |
perl -MMIME::Base64 -e 'print encode_base64("username");' |
This will produce something like this:
|
1 |
dXNlcm5hbWU= |
And here’s the decode:
|
1 |
perl -MMIME::Base64 -e 'print decode_base64("dXNlcm5hbWU=");' |
which of course yields:
|
1 |
username |