Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

Spamassassin about SS-Emails

Go to End

2 Posts   1401 Views


Community Member, 83 Posts

28 August 2009 at 8:53am

I have some problems with the email-class.

$subject = strip_tags($data["Betreff"]);
$email = new Email($from, $to, $subject, $body);

1.) Problems with special chars in subject
Because I am german, the subject can contain letters like ä,ü,ß,...
These characters are shown corretly in Outlook.
But Spamassassin says SUBJ_ILLEGAL_CHARS
I tried
$subject = strip_tags(utf8_decode($data["Betreff"]))
but then these letters are missing in outlook.
How can i use these letters in a correct way?

2.) Problem boundary
Spamassassin additionaly doesnt like MIME_BOUND_NEXTPART.
In sapphire/email/Mailer.php there is

$separator = "----=_NextPart_" . ereg_replace('[^0-9]','',rand() * 10000000000);

If I just edit this to
$separator = "----=_NexxtPart_" . ereg_replace('[^0-9]','',rand() * 10000000000);

I dont get this spamassassin-message any more.

Without this fix my email gets (in combination with 1.), spam-level: mid.
So with the fix it has spam-level: low.
But I would like send mails that are not considered as spam.

3.) if i only want to send plain-emails, i use

$subject = strip_tags($data["Betreff"]);
$email = new Email($from, $to, $subject, $body);

If i check the Header in Outlook i see:

Content-Type: multipart/mixed; boundary="----=_NextPart_204854279719"
Content-Transfer-Encoding: 7bit

Is this the right Content-Type for a message that consists only of Plain Text?

Many Questions at once.
Thanks for every help.

(see for meaning of messages)


Community Member, 83 Posts

11 September 2009 at 9:29pm

Ok, the following 2 changes helped me.
I am working with 2.3.1.
So maybe in 2.3.3 the problems do not occur.

1) In sapphire/email/mailer.php

line 254 : $separator = "----=_NexxtPart_" . ereg_replace('[^0-9]','',rand() * 10000000000);
(any change should do it)

2) If your subject might contain special Chars (deutsche Umlaute)

$subject = '=?UTF-8?B?'.base64_encode($subject).'?=';
$email = new Email($from, $to, $subject, $body);

As you can see , spamassassin likes it.

Attached Files