sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
windandwaves's Avatar

MIME_BASE64_TEXT


Question posted by: windandwaves (Guest) on November 10th, 2005 11:45 PM
Hi Folk

Is there anyway in avoiding the Spam Assassin tag:
MIME_BASE64_TEXT: Message text disguised using base64 encoding

when sending email using the mail() function?



- Nicolaas






6 Answers Posted
Andy Hassall's Avatar
Guest - n/a Posts
#2: Re: MIME_BASE64_TEXT

On Fri, 11 Nov 2005 12:33:30 +1300, "windandwaves" <winandwaves@coldmail.com>
wrote:
[color=blue]
>Is there anyway in avoiding the Spam Assassin tag:
>MIME_BASE64_TEXT: Message text disguised using base64 encoding
>
>when sending email using the mail() function?[/color]

Don't disguise your message text using base64 encoding would be the obvious
answer? Are you saying you're getting false positives despite not
base64-encoding?
--
Andy Hassall :: Join Bytes! :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
windandwaves's Avatar
Guest - n/a Posts
#3: Re: MIME_BASE64_TEXT

Andy Hassall wrote:[color=blue]
> On Fri, 11 Nov 2005 12:33:30 +1300, "windandwaves"
> <winandwaves@coldmail.com> wrote:
>[color=green]
>> Is there anyway in avoiding the Spam Assassin tag:
>> MIME_BASE64_TEXT: Message text disguised using base64 encoding
>>
>> when sending email using the mail() function?[/color]
>
> Don't disguise your message text using base64 encoding would be the
> obvious answer? Are you saying you're getting false positives despite
> not base64-encoding?[/color]

My messages are 64 encoded. If you dont do this (they are html), then you
get nonsense!

Basically, I am wondering if anyone out there has a basic PHP mailing
function that is similar to the one below, but reduces spam levels.


function SendMail($From,$FromName,$To , $ToName,$Subject,$Text,$Html,
$returnaddress){
//die("from ".$From." From Name: ".$FromName." to mail: ".$To." to Name:
".$ToName." subject: ".$Subject." text: ".$Text." html: ".$Html."
returnaddress: ".$returnaddress);
$OB="----=_OuterBoundary_000";
$IB="----=_InnerBoundery_001";
$From or die("sender address missing");
$To or die("recipient address missing");
$headers ="MIME-Version: 1.0\r\n";
$headers.="From: ".$FromName." <".$From.">\n";
$headers.="To: ".$ToName." <".$To.">\n";
$headers.="Reply-To: ".$FromName." <".$From.">\n";
$headers.="Content-Type: multipart/mixed;\n boundary=\"".$OB."\"\n";
//Messages start with text/html alternatives in OB
$Msg ="This is a multi-part message in MIME format.\n";
$Msg.="\n--".$OB."\n";
$Msg.="Content-Type: multipart/alternative;\n boundary=\"".$IB."\"\n\n";
//plaintext section
$Msg.="\n--".$IB."\n";
$Msg.="Content-Type: text/plain;\n charset=\"iso-8859-1\"\n";
$Msg.="Content-Transfer-Encoding: quoted-printable\n\n";
$Msg.=$Text."\n\n";
// html section
$Msg.="\n--".$IB."\n";
$Msg.="Content-Type: text/html;\n charset=\"iso-8859-1\"\n";
$Msg.="Content-Transfer-Encoding: base64\n\n";
$Html =stripslashes($Html);
$Msg.=chunk_split(base64_encode($Html))."\n\n";
// end of IB
$Msg.="\n--".$IB."--\n";
//message ends
$Msg.="\n--".$OB."--\n";
if(!$subject or $subject = "") {
$subject = "message from ".$FromName;
}
if($returnaddress) {
$returnaddress = '-f'.$returnaddress;
}
mail($To,$Subject,$Msg,$headers, $returnaddress);
syslog(LOG_INFO,"Mail: Message sent to $ToName <$To>");
return 1;
}

TIA

- Nicolaas


Philip Ronan's Avatar
Guest - n/a Posts
#4: Re: MIME_BASE64_TEXT

"windandwaves" wrote:
[color=blue]
> My messages are 64 encoded. If you dont do this (they are html), then you
> get nonsense![/color]

.... so your messages were nonsense to start with? :-D

Seriously though, you need to sit down and read RFC2045. There are other
ways of encoding the body of an email besides base64. Try quoted-printable,
for example.

A quick search at Google should provide you with all the information you
need.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/

Tim Roberts's Avatar
Guest - n/a Posts
#5: Re: MIME_BASE64_TEXT

"windandwaves" <winandwaves@coldmail.com> wrote:
[color=blue]
>Andy Hassall wrote:[color=green]
>> On Fri, 11 Nov 2005 12:33:30 +1300, "windandwaves"
>> <winandwaves@coldmail.com> wrote:
>>[color=darkred]
>>> Is there anyway in avoiding the Spam Assassin tag:
>>> MIME_BASE64_TEXT: Message text disguised using base64 encoding
>>>
>>> when sending email using the mail() function?[/color]
>>
>> Don't disguise your message text using base64 encoding would be the
>> obvious answer? Are you saying you're getting false positives despite
>> not base64-encoding?[/color]
>
>My messages are 64 encoded. If you dont do this (they are html), then you
>get nonsense![/color]

That SENTENCE is nonsense. Most text/html sections are sent as
quoted-printable, 8bit, or 7bit. Base64 encoding serves no purpose other
than to increase the size by 25%.
--
- Tim Roberts, Join Bytes!
Providenza & Boekelheide, Inc.
windandwaves's Avatar
Guest - n/a Posts
#6: Re: MIME_BASE64_TEXT

Tim Roberts wrote:[color=blue]
> "windandwaves" <winandwaves@coldmail.com> wrote:
>[color=green]
>> Andy Hassall wrote:[color=darkred]
>>> On Fri, 11 Nov 2005 12:33:30 +1300, "windandwaves"
>>> <winandwaves@coldmail.com> wrote:
>>>
>>>> Is there anyway in avoiding the Spam Assassin tag:
>>>> MIME_BASE64_TEXT: Message text disguised using base64 encoding
>>>>
>>>> when sending email using the mail() function?
>>>
>>> Don't disguise your message text using base64 encoding would be the
>>> obvious answer? Are you saying you're getting false positives
>>> despite not base64-encoding?[/color]
>>
>> My messages are 64 encoded. If you dont do this (they are html),
>> then you get nonsense![/color]
>
> That SENTENCE is nonsense. Most text/html sections are sent as
> quoted-printable, 8bit, or 7bit. Base64 encoding serves no purpose
> other than to increase the size by 25%.[/color]


Hmmm, it is getting difficult. Does anyone have a good send mail function,
which basically extends the mail() function so that you can does pass the
basic variables?

I had a look on the net, but no luck. Im my previous post you can see what
I use now. I also found the function below on the www.php.net website:

function quoted_printable_encode( $sString ) {
$sString = preg_replace( '/[^\x21-\x3C\x3E-\x7E\x09\x20]/e', 'sprintf(
"=%02x", ord ( "$0" ) ) ;', $sString );
preg_match_all( '/.{1,73}([^=]{0,3})?/', $sString, $aMatch );
return implode( '=' . CR, $aMatch[0] );
}



Manuel Lemos's Avatar
Guest - n/a Posts
#7: Re: MIME_BASE64_TEXT

Hello,

on 11/10/2005 09:33 PM windandwaves said the following:[color=blue]
> Hi Folk
>
> Is there anyway in avoiding the Spam Assassin tag:
> MIME_BASE64_TEXT: Message text disguised using base64 encoding
>
> when sending email using the mail() function?[/color]

You should send your message text or HTML encoded with quoted-printable
encoding instead of base64. You may want to try this class that can be
used to encode your message properly and send them with the mail function:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
 
Not the answer you were looking for? Post your question . . .
196,790 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,790 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors