Rewrite of the foldLine function in order to fold correctly in case of
[squirrelmail.git] / class / deliver / Deliver_SendMail.class.php
1 <?php
2 /**
3 * Deliver_SendMail.class.php
4 *
5 * Copyright (c) 1999-2003 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * Delivery backend for the Deliver class.
9 *
10 * $Id$
11 */
12
13 require_once(SM_PATH . 'class/deliver/Deliver.class.php');
14
15 class Deliver_SendMail extends Deliver {
16
17 function preWriteToStream(&$s) {
18 if ($s) {
19 $s = str_replace("\r\n", "\n", $s);
20 }
21 }
22
23 function initStream($message, $sendmail_path) {
24 $rfc822_header = $message->rfc822_header;
25 $from = $rfc822_header->from[0];
26 $envelopefrom = $from->mailbox.'@'.$from->host;
27 if (strstr($sendmail_path, "qmail-inject")) {
28 $stream = popen (escapeshellcmd("$sendmail_path -i -f$envelopefrom"), "w");
29 } else {
30 $stream = popen (escapeshellcmd("$sendmail_path -i -t -f$envelopefrom"), "w");
31 }
32 return $stream;
33 }
34
35 function finalizeStream($stream) {
36 pclose($stream);
37 return true;
38 }
39
40 function getBcc() {
41 return true;
42 }
43
44 }
45 ?>