SMTP AUTH ERROR: garbled Base64 data (solved)

General question about the package, problems, solutions
SJV
Posts: 2
Joined: Wed Jan 20, 2010 9:40 am

SMTP AUTH ERROR: garbled Base64 data (solved)

Postby SJV » Thu Jan 21, 2010 2:46 am

Hi, Pavel!

Thank you for the brilliant work!

I have found one problem when using a SMTP authentication.
Sometimes an email can't be sent with a diagnostic message "SMTP MAIL ERROR (From Address): Authentication required".
In this case the 'email_login' and 'email_password' properties have to be set. However, this did not solve the problem because of a new error message: "SMTP AUTH ERROR: garbled Base64 data".

I've found that problem is in the sub EN_auth_login of your package in line:
"$login_inf[$i] = MIME::Base64::encode_base64(EN_removeCR(EN_GetProperty($properties[$i])));"

This is quotation of Base64.pm:
The following functions are provided:

=over 4

=item encode_base64($str)

=item encode_base64($str, $eol);

Encode data by calling the encode_base64() function. The first
argument is the string to encode. The second argument is the
line-ending sequence to use. It is optional and defaults to "\n".


So, the above line shold be changed to "$login_inf[$i] = MIME::Base64::encode_base64(EN_removeCR(EN_GetProperty($properties[$i])), "");"

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: SMTP AUTH ERROR: garbled Base64 data (solved)

Postby Pavel » Thu Jan 21, 2010 9:09 am

Good catch! I have never seen this error before, while we have been using SMTP authentication for many years.
Apparently, you were using so long user name or password that encoded string exceeded 76 characters.

Thank you,
Pavel

SJV
Posts: 2
Joined: Wed Jan 20, 2010 9:40 am

Re: SMTP AUTH ERROR: garbled Base64 data (solved)

Postby SJV » Thu Jan 21, 2010 10:24 am

Pavel wrote:I have never seen this error before, while we have been using SMTP authentication for many years. Apparently, you were using so long user name or password that encoded string exceeded 76 characters.

Less than 10.
If I understand description correctly, encode_base64($str) always returns "\n" as the line end irrespective of $str length.

Probably it depends on SMTP server itself.


Return to “Email Notification Package Q&A”

Who is online

Users browsing this forum: No registered users and 1 guest

cron