summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-02-26 15:53:19 +0100
committerZdenek Prikryl <zprikryl@redhat.com>2009-02-26 15:53:19 +0100
commitc9d12659371287fd9893e5492fedb8912a974238 (patch)
tree94129554521616b2e357b53c93dc91671142b43f
parente5d5445e1dd8161cf818d96aea30e51fee846231 (diff)
downloadabrt-c9d12659371287fd9893e5492fedb8912a974238.tar.gz
abrt-c9d12659371287fd9893e5492fedb8912a974238.tar.xz
abrt-c9d12659371287fd9893e5492fedb8912a974238.zip
added new option
-rw-r--r--lib/Plugins/Mailx.conf3
-rw-r--r--lib/Plugins/Mailx.cpp22
-rw-r--r--lib/Plugins/Mailx.h1
3 files changed, 19 insertions, 7 deletions
diff --git a/lib/Plugins/Mailx.conf b/lib/Plugins/Mailx.conf
index bfbbff89..c1bddfff 100644
--- a/lib/Plugins/Mailx.conf
+++ b/lib/Plugins/Mailx.conf
@@ -7,3 +7,6 @@ EmailFrom = user@localhost
# Email To
EmailTo = root@localhost
+
+# Warning! enabling this may cause sending a lot of MB via email
+SendBinaryData = no
diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp
index a320d3e4..0f0922f7 100644
--- a/lib/Plugins/Mailx.cpp
+++ b/lib/Plugins/Mailx.cpp
@@ -31,7 +31,8 @@ CMailx::CMailx() :
m_sEmailFrom("user@localhost"),
m_sEmailTo("root@localhost"),
m_sParameters(""),
- m_sAttachments("")
+ m_sAttachments(""),
+ m_bSendBinaryData(false)
{}
@@ -102,13 +103,16 @@ void CMailx::Report(const crash_report_t& pReport)
ss << "==============" << std::endl;
ss << "See the attachment[s]" << std::endl;
- if (pReport.m_sBinaryData1 != "")
+ if (m_bSendBinaryData)
{
- m_sAttachments = " -a " + pReport.m_sBinaryData1;
- }
- if (pReport.m_sBinaryData2 != "")
- {
- m_sAttachments = " -a " + pReport.m_sBinaryData2;
+ if (pReport.m_sBinaryData1 != "")
+ {
+ m_sAttachments = " -a " + pReport.m_sBinaryData1;
+ }
+ if (pReport.m_sBinaryData2 != "")
+ {
+ m_sAttachments = " -a " + pReport.m_sBinaryData2;
+ }
}
SendEmail(ss.str());
@@ -128,4 +132,8 @@ void CMailx::SetSettings(const map_settings_t& pSettings)
{
m_sParameters = pSettings.find("Parameters")->second;
}
+ if (pSettings.find("SendBinaryData")!= pSettings.end())
+ {
+ m_bSendBinaryData = pSettings.find("SendBinaryData")->second == "yes";
+ }
}
diff --git a/lib/Plugins/Mailx.h b/lib/Plugins/Mailx.h
index ab317eb2..1a644147 100644
--- a/lib/Plugins/Mailx.h
+++ b/lib/Plugins/Mailx.h
@@ -34,6 +34,7 @@ class CMailx : public CReporter
std::string m_sEmailTo;
std::string m_sParameters;
std::string m_sAttachments;
+ bool m_bSendBinaryData;
void SendEmail(const std::string& pText);