aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/smtp.php
diff options
context:
space:
mode:
authornatec <natec@users.sourceforge.net>2001-11-26 00:50:03 +0000
committernatec <natec@users.sourceforge.net>2001-11-26 00:50:03 +0000
commitadb6ff9f58ad59bbd04ab455f322d439cf0621c5 (patch)
treeb93d36046f35b1ef5badc8b2be2d533434548770 /phpBB/includes/smtp.php
parent67aae81a93249395bceed79762ea93f40b6bdbaa (diff)
downloadforums-adb6ff9f58ad59bbd04ab455f322d439cf0621c5.tar
forums-adb6ff9f58ad59bbd04ab455f322d439cf0621c5.tar.gz
forums-adb6ff9f58ad59bbd04ab455f322d439cf0621c5.tar.bz2
forums-adb6ff9f58ad59bbd04ab455f322d439cf0621c5.tar.xz
forums-adb6ff9f58ad59bbd04ab455f322d439cf0621c5.zip
Fixed bug 481943. Regexp that normalized linebreaks to \r\n was fucked, so it was changing (char)\n to \r\n and dropping (char). Hence we lost the char before every single linebreak in every email sent thru SMTP. yay. ALso fixed so it gets the FROM address from the right place.
git-svn-id: file:///svn/phpbb/trunk@1443 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/smtp.php')
-rw-r--r--phpBB/includes/smtp.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/includes/smtp.php b/phpBB/includes/smtp.php
index d508031582..13c90e7e80 100644
--- a/phpBB/includes/smtp.php
+++ b/phpBB/includes/smtp.php
@@ -41,7 +41,7 @@ function server_parse($socket, $response)
}
if(!(substr($server_response, 0, 3) == $response))
{
- message_die(GENERAL_ERROR, "Ran into problems sending Mail", "", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Ran into problems sending Mail. Response: $server_response", "", __LINE__, __FILE__);
}
}
@@ -63,7 +63,7 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
//
// Fix any bare linefeeds in the message to make it RFC821 Compliant.
//
- $message = ereg_replace("[^\r]\n", "\r\n", $message);
+ $message = preg_replace("/(?<!\r)\n/si", "\r\n", $message);
if ($headers != "")
{
@@ -81,7 +81,7 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
$headers = chop($headers);
// Make sure there are no bare linefeeds in the headers
- $headers = ereg_replace("[^\r]\n", "\r\n", $headers);
+ $headers = preg_replace("/(?<!\r)\n/si", "\r\n", $headers);
}
if(trim($mail_to) == "")
{
@@ -114,7 +114,7 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
server_parse($socket, "250");
// Specify who the mail is from....
- fputs($socket, "MAIL FROM: $email_from\r\n");
+ fputs($socket, "MAIL FROM: " . $board_config['board_email'] . "\r\n");
server_parse($socket, "250");
// Specify each user to send to and build to header.