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 |





3 Responses
Something tells me that second one should use the decode_base64 function. You should try your “solutions” before putting them on the Internet.
Thanks for the correction.
Another funny detail. In the “encode_base64( $bytes, $eol );” $eol defaults to “n” unless specified – say: ‘print encode_base64(“username”, “”);’
See doc: http://perldoc.perl.org/MIME/Base64.html