|
|
@@ -26,9 +26,6 @@ |
|
|
|
// Configuration. ////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
const std::string SnfMilterMainCfSearchString("unix:/var/snf-milter/socket");
|
|
|
|
|
|
|
|
const std::string SnfMilterMainCfMilterSpec("unix:/var/snf-milter/socket");
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// End of configuration. /////////////////////////////////////////////////////////////////////////////////
|
|
|
@@ -41,30 +38,40 @@ PostfixIntegrate::SetOperatingSystem(std::string OperatingSystemType) { |
|
|
|
|
|
|
|
if ("OpenBSD" == OperatingSystemType) {
|
|
|
|
|
|
|
|
PostfixDefaultIsChrooted = true;
|
|
|
|
PostfixSocketSpec = "unix:/snf-milter/socket";
|
|
|
|
PostfixMainCfPath = "/etc/postfix/main.cf";
|
|
|
|
PostfixMasterCfPath = "/etc/postfix/master.cf";
|
|
|
|
ReloadMtaCommand = "/usr/local/sbin/postfix reload";
|
|
|
|
|
|
|
|
} else if ("FreeBSD" == OperatingSystemType) {
|
|
|
|
|
|
|
|
PostfixDefaultIsChrooted = false;
|
|
|
|
PostfixSocketSpec = "unix:/var/snf-milter/socket";
|
|
|
|
PostfixMainCfPath = "/usr/local/etc/postfix/main.cf";
|
|
|
|
PostfixMasterCfPath = "/usr/local/etc/postfix/master.cf";
|
|
|
|
ReloadMtaCommand = "/usr/local/sbin/postfix reload";
|
|
|
|
|
|
|
|
} else if ("Ubuntu" == OperatingSystemType) {
|
|
|
|
|
|
|
|
PostfixDefaultIsChrooted = true;
|
|
|
|
PostfixSocketSpec = "unix:/snf-milter/socket";
|
|
|
|
PostfixMainCfPath = "/etc/postfix/main.cf";
|
|
|
|
PostfixMasterCfPath = "/etc/postfix/master.cf";
|
|
|
|
ReloadMtaCommand = "/usr/sbin/postfix reload";
|
|
|
|
|
|
|
|
} else if ("RedHat" == OperatingSystemType) {
|
|
|
|
|
|
|
|
PostfixDefaultIsChrooted = false;
|
|
|
|
PostfixSocketSpec = "unix:/var/snf-milter/socket";
|
|
|
|
PostfixMainCfPath = "/etc/postfix/main.cf";
|
|
|
|
PostfixMasterCfPath = "/etc/postfix/master.cf";
|
|
|
|
ReloadMtaCommand = "/usr/sbin/postfix reload";
|
|
|
|
|
|
|
|
} else if ("Suse" == OperatingSystemType) {
|
|
|
|
|
|
|
|
PostfixDefaultIsChrooted = false;
|
|
|
|
PostfixSocketSpec = "unix:/var/snf-milter/socket";
|
|
|
|
PostfixMainCfPath = "/etc/postfix/main.cf";
|
|
|
|
PostfixMasterCfPath = "/etc/postfix/master.cf";
|
|
|
|
ReloadMtaCommand = "/usr/sbin/postfix reload";
|
|
|
@@ -117,7 +124,7 @@ PostfixIntegrate::Integrate(FileBackup *SaveFile) { |
|
|
|
std::string Line;
|
|
|
|
bool ModifiedLine = false;
|
|
|
|
|
|
|
|
PostfixMilterConf MilterConf; // Object to update the config line.
|
|
|
|
PostfixMilterConf MilterConf(PostfixSocketSpec); // Object to update the config line.
|
|
|
|
|
|
|
|
while (getline(Input, Line)) {
|
|
|
|
|
|
|
@@ -260,15 +267,15 @@ PostfixIntegrate::Unintegrate(FileBackup *SaveFile) { |
|
|
|
std::string Content;
|
|
|
|
std::string Line;
|
|
|
|
|
|
|
|
PostfixMilterConf MilterConf; // Object to update the config line.
|
|
|
|
PostfixMilterConf MilterConf(PostfixSocketSpec); // Object to update the config line.
|
|
|
|
|
|
|
|
while (getline(Input, Line)) {
|
|
|
|
|
|
|
|
MilterConf.ConfLine(Line); // Load the object with the line.
|
|
|
|
MilterConf.ConfLine(Line); // Load the object with the line.
|
|
|
|
|
|
|
|
if (MilterConf.IsIntegrated()) { // Check for integration.
|
|
|
|
if (MilterConf.IsIntegrated()) { // Check for integration.
|
|
|
|
|
|
|
|
MilterConf.RemoveIntegration(); // Integrated. Remove the milter spec.
|
|
|
|
MilterConf.RemoveIntegration(); // Integrated. Remove the milter spec.
|
|
|
|
|
|
|
|
if (Verbose()) {
|
|
|
|
|
|
|
@@ -457,7 +464,7 @@ PostfixIntegrate::IsIntegrated() { |
|
|
|
throw std::runtime_error(Temp);
|
|
|
|
}
|
|
|
|
|
|
|
|
PostfixMilterConf MilterConf; // Object to update the config line.
|
|
|
|
PostfixMilterConf MilterConf(PostfixSocketSpec); // Object to update the config line.
|
|
|
|
std::string Line;
|
|
|
|
|
|
|
|
while (getline(Input, Line)) {
|