Support MAILFROMADDRESS, per longstanding user requests. Documented in twconfig man page.
This commit is contained in:
parent
c136c5b398
commit
12cef61f40
|
@ -274,6 +274,11 @@ However, mailing no violations reports will increase the amount of data
|
||||||
that must be processed.
|
that must be processed.
|
||||||
.br
|
.br
|
||||||
Initial value: \fItrue\fR
|
Initial value: \fItrue\fR
|
||||||
|
.IP \f(CWMAILFROMADDRESS\fP
|
||||||
|
Specifies the value of the "From:" field in email reports.
|
||||||
|
.br
|
||||||
|
Initial value: \fItripwire@hostname\fP, where 'hostname' is the local
|
||||||
|
machine name.
|
||||||
.SH VERSION INFORMATION
|
.SH VERSION INFORMATION
|
||||||
This man page describes
|
This man page describes
|
||||||
.IR "Tripwire 2.4" "."
|
.IR "Tripwire 2.4" "."
|
||||||
|
|
|
@ -409,6 +409,9 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf)
|
||||||
else
|
else
|
||||||
pModeInfo->mMailNoViolations = true; // MAILPROGRAM is not required to be specified
|
pModeInfo->mMailNoViolations = true; // MAILPROGRAM is not required to be specified
|
||||||
|
|
||||||
|
if(cf.Lookup(TSTRING(_T("MAILFROMADDRESS")), str))
|
||||||
|
pModeInfo->mMailFrom = str;
|
||||||
|
|
||||||
// SYSLOG reporting
|
// SYSLOG reporting
|
||||||
if(cf.Lookup(TSTRING(_T("SYSLOGREPORTING")), str))
|
if(cf.Lookup(TSTRING(_T("SYSLOGREPORTING")), str))
|
||||||
{
|
{
|
||||||
|
|
|
@ -181,6 +181,7 @@ class cTWModeCommon
|
||||||
unsigned short mSmtpPort; // port number of that SMTP host
|
unsigned short mSmtpPort; // port number of that SMTP host
|
||||||
TSTRING mMailProgram; // full path to executable to use for piped mail
|
TSTRING mMailProgram; // full path to executable to use for piped mail
|
||||||
bool mMailNoViolations; // Email out reports with no violations?
|
bool mMailNoViolations; // Email out reports with no violations?
|
||||||
|
TSTRING mMailFrom;
|
||||||
|
|
||||||
cTWModeCommon() : mVerbosity(1),
|
cTWModeCommon() : mVerbosity(1),
|
||||||
mLocalProvided(false),
|
mLocalProvided(false),
|
||||||
|
|
|
@ -590,9 +590,15 @@ static bool EmailReportTo(const TSTRING &toAddress, const cFCOReportHeader& head
|
||||||
cDisplayEncoder::EncodeInline( toAddress ).c_str());
|
cDisplayEncoder::EncodeInline( toAddress ).c_str());
|
||||||
reportMail->AddRecipient(toAddress);
|
reportMail->AddRecipient(toAddress);
|
||||||
|
|
||||||
TSTRING machineName;
|
if (!modeCommon->mMailFrom.empty())
|
||||||
iFSServices::GetInstance()->GetMachineNameFullyQualified(machineName);
|
reportMail->SetFrom(modeCommon->mMailFrom);
|
||||||
reportMail->SetFrom(TSS_GetString( cTripwire, tripwire::STR_EMAIL_FROM) + machineName);
|
else
|
||||||
|
{
|
||||||
|
TSTRING machineName;
|
||||||
|
iFSServices::GetInstance()->GetMachineNameFullyQualified(machineName);
|
||||||
|
reportMail->SetFrom(TSS_GetString( cTripwire, tripwire::STR_EMAIL_FROM) + machineName);
|
||||||
|
}
|
||||||
|
|
||||||
reportMail->SetFromName(TSS_GetString(cTW, tw::STR_TSS_PRODUCT_NAME));
|
reportMail->SetFromName(TSS_GetString(cTW, tw::STR_TSS_PRODUCT_NAME));
|
||||||
|
|
||||||
reportMail->SetSubject( trv.SingleLineReport() );
|
reportMail->SetSubject( trv.SingleLineReport() );
|
||||||
|
@ -729,17 +735,23 @@ bool cTWCmdLineUtil::SendEmailTestMessage(const TSTRING &mAddress, const cTWMode
|
||||||
// send the report
|
// send the report
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// set up the cMailMessage class, and send it
|
// set up the cMailMessage class, and send it
|
||||||
reportMail->AddRecipient(mAddress);
|
reportMail->AddRecipient(mAddress);
|
||||||
|
|
||||||
TSTRING machineName;
|
if (!modeCommon->mMailFrom.empty())
|
||||||
iFSServices::GetInstance()->GetMachineNameFullyQualified(machineName);
|
reportMail->SetFrom(modeCommon->mMailFrom);
|
||||||
reportMail->SetFrom(TSS_GetString( cTripwire, tripwire::STR_EMAIL_FROM) + machineName);
|
else
|
||||||
reportMail->SetFromName(TSS_GetString(cTW, tw::STR_TSS_PRODUCT_NAME));
|
{
|
||||||
|
TSTRING machineName;
|
||||||
|
iFSServices::GetInstance()->GetMachineNameFullyQualified(machineName);
|
||||||
|
reportMail->SetFrom(TSS_GetString( cTripwire, tripwire::STR_EMAIL_FROM) + machineName);
|
||||||
|
}
|
||||||
|
|
||||||
|
reportMail->SetFromName(TSS_GetString(cTW, tw::STR_TSS_PRODUCT_NAME));
|
||||||
|
|
||||||
reportMail->SetSubject (TSS_GetString( cTripwire, tripwire::STR_TEST_EMAIL_SUBJECT));
|
reportMail->SetSubject (TSS_GetString( cTripwire, tripwire::STR_TEST_EMAIL_SUBJECT));
|
||||||
reportMail->SetBody (TSS_GetString( cTripwire, tripwire::STR_TEST_EMAIL_BODY));
|
reportMail->SetBody (TSS_GetString( cTripwire, tripwire::STR_TEST_EMAIL_BODY));
|
||||||
reportMail->Send();
|
reportMail->Send();
|
||||||
}
|
}
|
||||||
catch(eError& e)
|
catch(eError& e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue