SiT! Bugs

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000465SiT!triggerspublic2009-02-04 19:472009-02-27 16:25
Reporterkieran 
Assigned Toivan 
PrioritynormalSeverityminorReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version3.45Fixed in Version3.45 
Summary0000465: Too many new lines in trigger emails
DescriptionWe have a too many newliens after Subject: as some hosting inserts their own headers which breaks as there's a space.
Additional InformationDate: Wed, 4 Feb 2009 19:45:12 +0000
Subject: [2] - Blah
 
X-PreventSpam: mmEz1JnJsvGA/nMYD5RNQK7Xq+k6mvJMpx8u0bTCYHRbYMXqsnNZ7EHtlVZ3q4Xa1tHuApt6EhFojSGmP0J6Ohw6n9KlyL3YU1SYSeasgOh3P1KLGFvZZxDQADG1mCDSJVoL8bY/H+Ag6wvRQUAIknicmb4xWb3mnaxQTpc3vjA=

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
User avatar (0000608)
ivan (administrator)
2009-02-10 17:41

Can you try this with the latest svn, r5045 or later. I think these problems might have been caused by a missing newline after the mime-content header, which i have now fixed.
User avatar (0000615)
ivan (administrator)
2009-02-11 17:22

I don't think emails are still right, trying to debug this.
User avatar (0000616)
ivan (administrator)
2009-02-11 17:29

/**
    Send an email from SiT
    * @param string $to. Destination email address
    * @param string $from. Source email address
    * @param string $subject. Email subject line
    * @param string $body. Email body text
    * @param string $replyto. (optional) Address to send reply to
    * @param string $cc. (optional) Carbon copy address
    * @param string $bcc. (optional) Blind carbon copy address
    * @returns The return value from PHP mail() function or TRUE when in Demo mode
    * @note Returns TRUE but does not actually send mail when SiT is in Demo mode
*/
function send_email($to, $from, $subject, $body, $replyto='', $cc='', $bcc='')
{
    global $CONFIG, $application_version_string;

    $crlf = "\r\n";

    if (empty($to)) trigger_error('Empty TO address in email', E_USER_WARNING);

    $extra_headers = '';
    //$extra_headers = "From: {$from}" . $crlf;
    if (!empty($replyto)) $extra_headers .= "Reply-To: {$replyto}" . $crlf;
    if (!empty($email_cc))
    {
        $extra_headers .= "CC: {$cc}" . $crlf;
    }
    if (!empty($email_bcc))
    {
        $extra_headers .= "BCC: {$bcc}" . $crlf;
    }
    if (!empty($CONFIG['support_email']))
    {
        $extra_headers .= "Errors-To: {$CONFIG['support_email']}" . $crlf;
    }
    $extra_headers .= "X-Mailer: {$CONFIG['application_shortname']} {$application_version_string}/PHP " . phpversion() . $crlf;
    $extra_headers .= "X-Originating-IP: {$_SERVER['REMOTE_ADDR']}" . $crlf;
    $extra_headers .= "X-SiT-User: {$_SESSION['username']}" . $crlf;
    $extra_headers .= "MIME-Version: 1.0" . $crlf;
    $extra_headers .= "Content-type: text/plain; charset={$GLOBALS['i18ncharset']}" . $crlf;
// $extra_headers .= "\r\n";

debug_log('Sending email!');


    if ($CONFIG['demo'])
    {
        $rtnvalue = TRUE;
    }
    else
    {
        // actually send the email
        $mime = new MIME_mail($from, $to, html_entity_decode($subject), '', $extra_headers);
        $mime -> attach($bodytext, '', "text-plain; charset={$GLOBALS['i18ncharset']}", 'quoted-printable');

        $rtnvalue = $mime -> send_mail();
        //$rtnvalue = mail($to, $subject, $body, $extra_headers);
    }
    return $rtnvalue;
}
User avatar (0000663)
ivan (administrator)
2009-02-25 17:53

Kieran,

Can you check this one again with the latest svn, r5201 or later and see if it's still a bug, I suspect not.
User avatar (0000676)
ivan (administrator)
2009-02-27 13:49

I can't reproduce this now so marking fixed.

- Issue History
Date Modified Username Field Change
2009-02-04 19:47 kieran New Issue
2009-02-04 19:47 kieran Status new => assigned
2009-02-04 19:47 kieran Assigned To => kieran
2009-02-10 17:41 ivan Note Added: 0000608
2009-02-10 17:41 ivan Status assigned => feedback
2009-02-10 17:41 ivan Resolution open => fixed
2009-02-10 17:41 ivan Fixed in Version => Current SVN
2009-02-11 17:22 ivan Note Added: 0000615
2009-02-11 17:22 ivan Assigned To kieran => ivan
2009-02-11 17:22 ivan Status feedback => assigned
2009-02-11 17:29 ivan Note Added: 0000616
2009-02-25 17:53 ivan Note Added: 0000663
2009-02-25 17:53 ivan Status assigned => feedback
2009-02-27 13:49 ivan Note Added: 0000676
2009-02-27 13:49 ivan Status feedback => resolved
2009-02-27 13:54 ivan Fixed in Version Current SVN => 3.45
2009-02-27 16:25 ivan Status resolved => closed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker