switched from substr() to rtrim() in _write_headers() so that the last $this->newline is fully stripped when the "mail" protocol is used, regardless of whether \r, \n, or \r\n is used.

http://codeigniter.com/bug_tracker/bug/6669/
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 7539fe5..f863d41 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -956,7 +956,7 @@
 
 		if ($this->_get_protocol() == 'mail')
 		{
-			$this->_header_str = substr($this->_header_str, 0, -1);
+			$this->_header_str = rtrim($this->_header_str);
 		}
 	}