summaryrefslogtreecommitdiff
path: root/indra/llmessage/llmail.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
commit9db949eec327df4173fde3de934a87bedb0db13c (patch)
treeaeffa0f0e68b1d2ceb74d460cbbd22652c9cd159 /indra/llmessage/llmail.cpp
parent419e13d0acaabf5e1e02e9b64a07648bce822b2f (diff)
svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated for-fucks-sake-whats-with-these-commit-markers
Diffstat (limited to 'indra/llmessage/llmail.cpp')
-rw-r--r--indra/llmessage/llmail.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index ac0ee66e41..1a076b7281 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -42,10 +42,9 @@
#include <string>
#include <sstream>
-#include <boost/regex.hpp>
-#include "apr-1/apr_pools.h"
-#include "apr-1/apr_network_io.h"
+#include "apr_pools.h"
+#include "apr_network_io.h"
#include "llapr.h"
#include "llbase32.h" // IM-to-email address
@@ -66,8 +65,6 @@ static apr_pool_t* gMailPool;
static apr_sockaddr_t* gSockAddr;
static apr_socket_t* gMailSocket;
-// According to RFC2822
-static const boost::regex valid_subject_chars("[\\x1-\\x9\\xb\\xc\\xe-\\x7f]*");
bool connect_smtp();
void disconnect_smtp();
@@ -173,6 +170,22 @@ void LLMail::enable(bool mail_enabled)
gMailEnabled = mail_enabled;
}
+// Test a subject line for RFC2822 compliance.
+static bool valid_subject_chars(const char *subject)
+{
+ for (; *subject != '\0'; subject++)
+ {
+ unsigned char c = *subject;
+
+ if (c == '\xa' || c == '\xd' || c > '\x7f')
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
// static
std::string LLMail::buildSMTPTransaction(
const char* from_name,
@@ -187,7 +200,7 @@ std::string LLMail::buildSMTPTransaction(
<< " from address." << llendl;
return std::string();
}
- if(! boost::regex_match(subject, valid_subject_chars))
+ if(!valid_subject_chars(subject))
{
llinfos << "send_mail build_smtp_transaction reject: bad subject header: "
<< "to=<" << to_address