[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Invalid base64 data



Hi,

via a mailing list I received a base64 encoded message with a
signature at the end added by the list software. No multipart!

--- message --- 
[..]
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

U29tZW9uZSBrbm93cyBzb21lIHBhc3N3b3JkCgpPbiBKdW4gNSwgMjAxNCAxOjMzIFBNLCBNYXJ0
[..]
cGQub3JnIAo+Cg==

 
You received this mail because you are subscribed to xxx@yyy
To unsubscribe, send a mail to: xxx+unsubscribe@yyy
--- end ---

Wl fails to display the message with the error:

This entity can't be decoded.  Invalid base64 data

The message displays fine in Gnus. Obviously the fix is in
mm-decode-content-transfer-encoding:

((eq encoding 'base64)
            (base64-decode-region
             (point-min)
             ;; Some mailers insert whitespace
             ;; junk at the end which
             ;; base64-decode-region dislikes.
             ;; Also remove possible junk which could
             ;; have been added by mailing list software.
             (save-excursion
               (goto-char (point-min))
               (while (re-search-forward "^[\t ]*\r?\n" nil t)
                 (delete-region (match-beginning 0) (match-end 0)))
               (goto-char (point-max))
               (when (re-search-backward "^[\t ]*[A-Za-z0-9+/]+=*[\t ]*$"
                                         nil t)
                 (forward-line))
               (point))))

Should wl/flim also handle this case? 

--
Herbert