Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Spamassassin about SS-Emails

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

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

Page: 1
Go to End
Author Topic: 1157 Views
  • lx
    Avatar
    Community Member
    82 Posts

    Spamassassin about SS-Emails Link to this post

    I have some problems with the email-class.

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

    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);
    $email->sendPlain();


    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 http://mrfoo.de/archiv/447-Spamassassin-Statusmessages.html for meaning of messages)

  • lx
    Avatar
    Community Member
    82 Posts

    Re: Spamassassin about SS-Emails Link to this post

    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
    1157 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.