I just spent too much time banging my head against the SMTP server because he did not like the base64 encoded credentials I used. It turns out that when I chose NOT to use perl, as it requires a lot of instructions on the Internet, I made a big mistake. Why is this? I thought base64 was the only standard.
Consider:
$ perl -MMIME::Base64 -e 'print encode_base64("ASDF1234asdf")'
QVNERjEyMzRhc2Rm
$ base64 <<<"ASDF1234asdf"
QVNERjEyMzRhc2RmCg==
$ python3.6 -m base64 <<<"ASDF1234asdf"
QVNERjEyMzRhc2RmCg==
$ python2.7 -m base64 <<<"ASDF1234asdf"
QVNERjEyMzRhc2RmCg==
$ perl -MMIME::Base64 -e "print encode_base64('my_user_name@my_domain.com')"
bXlfdXNlcl9uYW1lQG15X2RvbWFpbi5jb20=
$ base64 <<<"my_user_name@my_domain.com"
bXlfdXNlcl9uYW1lQG15X2RvbWFpbi5jb20K
It is thus perlunique in its output, and my server requires it.
Why am I getting different results?
How do you get MIME / SMTP friendly output with something other than perl?
source
share