1821216 Members
3369 Online
109632 Solutions
New Discussion юеВ

Re: base64 decoding

 
Srinivas_9
Occasional Advisor

base64 decoding

Hi guys
I am looking for tools available on the www to decode data sent in mail as attachments using base64.
Just a background, we receive mails with attachments from unix boxes & other mail clients like Lotus notes etc.
The receiving mailbox is on a unix platform, and we have a nice perl script that scans the /var/mail and decodes the attachments. Lately with the new requirements some clients are sending attachments from Lotus Notes etc.

I did find few on the web, some not in its complete form, some are but very clumy to use.
I am looking for your recommendations/suggestions.

Thanks for your valuable time.
Ha Ha
6 REPLIES 6
H.Merijn Brand (procura
Honored Contributor

Re: base64 decoding

It's easy in perl:

#!/usr/bin/perl
use strict;
use warnings;
use MIME::Base64;
my $string = "Hello, world.";
my $encoded = decode_base64 ($string);
my $decoded = decode_base64 ($encoded);

Installing MIME::Base64 also gives you 4 utilities:
decode-base64
decode-qp
encode-base64
encode-qp

Then there are unix utils like uuencode and uudecode

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Peter Godron
Honored Contributor

Re: base64 decoding

Peter Godron
Honored Contributor

Re: base64 decoding

Hi,
did the suggestions help? Have tried them out? Please update or reward solution and close.
Srinivas_9
Occasional Advisor

Re: base64 decoding

Peter
Sorry didnt mean to ignore the help you guys have given. I did try to download the tar file from the link you have provided, I couldnt gunzip the tar I got
gunzip: base64-1.4.tar.gz: invalid compressed data ---crc error
gunzip: base64-1.4.tar.gz: invalid compressed data ---length error

I was trying to install the MIME:Base64 pm and see if that helps.

I will certainly update once i reach a significant milestone.

Thanks for your time
Ha Ha
Arunvijai_4
Honored Contributor

Re: base64 decoding

Hi Srinivas,

Your download is corrupted, You should re download it again. Also, you didn't mention about procura's solution ? Did that work ?

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
H.Merijn Brand (procura
Honored Contributor

Re: base64 decoding

Are you sure it is still gzipped?
Some stupid browsers download files, recognize the format and unzip on the flow, but forget to remove the extension.

# file base64-1.4.tar.gz

will tell you. If it responds with "tar", just curse a few times (or smile and learn), remove the extension

# mv base64-1.4.tar.gz base64-1.4.tar

and then extract

# tar xvf base64-1.4.tar

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn