Alias patch for ZCP 7.2.0
This commit is contained in:
parent
4d336b7d8d
commit
961eb228fa
780
alias_patch.diff
780
alias_patch.diff
@ -1,395 +1,385 @@
|
|||||||
diff -ruN --exclude=.svn spooler/alias.cpp ZARAFA_SPOOLER/alias.cpp
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/alias.cpp zarafa-7.2.0/spooler/alias.cpp
|
||||||
--- spooler/alias.cpp 1970-01-01 01:00:00.000000000 +0100
|
--- orig/zarafa-7.2.0/spooler/alias.cpp 1969-12-31 19:00:00.000000000 -0500
|
||||||
+++ ZARAFA_SPOOLER/alias.cpp 2013-05-03 00:48:14.339367400 +0200
|
+++ zarafa-7.2.0/spooler/alias.cpp 2015-03-09 13:16:49.487933628 -0400
|
||||||
@@ -0,0 +1,150 @@
|
@@ -0,0 +1,150 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright 2013 Christoph Haas <christoph.h@sprinternet.at>
|
+ * Copyright 2015 Christoph Haas <christoph.h@sprinternet.at>
|
||||||
+ *
|
+ *
|
||||||
+ * This program is free software: you can redistribute it and/or modify
|
+ * This program is free software: you can redistribute it and/or modify
|
||||||
+ * it under the terms of the GNU General Public License as published by
|
+ * it under the terms of the GNU General Public License as published by
|
||||||
+ * the Free Software Foundation, either version 3 of the License, or
|
+ * the Free Software Foundation, either version 3 of the License, or
|
||||||
+ * (at your option) any later version.
|
+ * (at your option) any later version.
|
||||||
+ *
|
+ *
|
||||||
+ * This program is distributed in the hope that it will be useful,
|
+ * This program is distributed in the hope that it will be useful,
|
||||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
+ * GNU General Public License for more details.
|
+ * GNU General Public License for more details.
|
||||||
+ *
|
+ *
|
||||||
+ * You should have received a copy of the GNU General Public License
|
+ * You should have received a copy of the GNU General Public License
|
||||||
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
+ *
|
+ *
|
||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
+#include "alias.h"
|
+#include "alias.h"
|
||||||
+
|
+
|
||||||
+using namespace std;
|
+using namespace std;
|
||||||
+
|
+
|
||||||
+extern ECLogger *g_lpLogger;
|
+extern ECLogger *g_lpLogger;
|
||||||
+
|
+
|
||||||
+Alias::Alias(){
|
+Alias::Alias(){
|
||||||
+ aliasFound = false;
|
+ aliasFound = false;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
+/*
|
+/*
|
||||||
+ * trim a string
|
+ * trim a string
|
||||||
+ */
|
+ */
|
||||||
+string Alias::trim(const string &strInput, const string &strTrim) {
|
+string Alias::trim(const string &strInput, const string &strTrim) {
|
||||||
+ string s = strInput;
|
+ string s = strInput;
|
||||||
+ size_t pos;
|
+ size_t pos;
|
||||||
+
|
+
|
||||||
+ if (s.empty())
|
+ if (s.empty())
|
||||||
+ return s;
|
+ return s;
|
||||||
+
|
+
|
||||||
+ pos = s.find_first_not_of(strTrim);
|
+ pos = s.find_first_not_of(strTrim);
|
||||||
+ s.erase(0, pos);
|
+ s.erase(0, pos);
|
||||||
+
|
+
|
||||||
+ pos = s.find_last_not_of(strTrim);
|
+ pos = s.find_last_not_of(strTrim);
|
||||||
+ if (pos != std::string::npos)
|
+ if (pos != std::string::npos)
|
||||||
+ s.erase(pos + 1, std::string::npos);
|
+ s.erase(pos + 1, std::string::npos);
|
||||||
+
|
+
|
||||||
+ return s;
|
+ return s;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/*
|
+/*
|
||||||
+ * Initializes the multimap
|
+ * Initializes the multimap
|
||||||
+ * Reads all rules from a space sepereated string
|
+ * Reads all rules from a space sepereated string
|
||||||
+ * e.g:
|
+ * e.g:
|
||||||
+ * 1@1.de 2@2.de
|
+ * 1@1.de 2@2.de
|
||||||
+ * 1@1.de alias1@1.de
|
+ * 1@1.de alias1@1.de
|
||||||
+ */
|
+ */
|
||||||
+void Alias::init(char *filename) {
|
+void Alias::init(char *filename) {
|
||||||
+ alias_file.open(filename);
|
+ alias_file.open(filename);
|
||||||
+
|
+
|
||||||
+ if(alias_file.is_open()) {
|
+ if(alias_file.is_open()) {
|
||||||
+ string sLine;
|
+ string sLine;
|
||||||
+ while (getline(alias_file, sLine)) {
|
+ while (getline(alias_file, sLine)) {
|
||||||
+ istringstream ssLine(sLine);
|
+ istringstream ssLine(sLine);
|
||||||
+ string sPart;
|
+ string sPart;
|
||||||
+ string sKey;
|
+ string sKey;
|
||||||
+ AliasData data;
|
+ AliasData data;
|
||||||
+ int count = 0;
|
+ int count = 0;
|
||||||
+
|
+
|
||||||
+ while ( getline(ssLine, sPart, ';') ) {
|
+ while ( getline(ssLine, sPart, ';') ) {
|
||||||
+ sPart = trim(sPart, " \t\r\n");
|
+ sPart = trim(sPart, " \t\r\n");
|
||||||
+
|
+
|
||||||
+ if(count == 0) {
|
+ if(count == 0) {
|
||||||
+ sKey = sPart;
|
+ sKey = sPart;
|
||||||
+ data.ownerMailAddress = sPart;
|
+ data.ownerMailAddress = sPart;
|
||||||
+ } else if(count == 1) {
|
+ } else if(count == 1) {
|
||||||
+ remove(sPart.begin(), sPart.end(), ' ');
|
+ remove(sPart.begin(), sPart.end(), ' ');
|
||||||
+ data.aliasMailAddress = sPart;
|
+ data.aliasMailAddress = sPart;
|
||||||
+ } else if(count == 2) {
|
+ } else if(count == 2) {
|
||||||
+ data.aliasName = sPart;
|
+ data.aliasName = sPart;
|
||||||
+ }
|
+ }
|
||||||
+ count++;
|
+ count++;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if(count == 3) {
|
+ if(count == 3) {
|
||||||
+ acl.insert(pair<string, AliasData>(sKey, data));
|
+ acl.insert(pair<string, AliasData>(sKey, data));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ } else {
|
+ } else {
|
||||||
+ // the file could not be read
|
+ // the file could not be read
|
||||||
+ g_lpLogger->Log(EC_LOGLEVEL_FATAL, "Aliasfile could not be read! (%s)", filename);
|
+ g_lpLogger->Log(EC_LOGLEVEL_FATAL, "Aliasfile could not be read! (%s)", filename);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/*
|
+/*
|
||||||
+ * check if our acl is empty
|
+ * check if our acl is empty
|
||||||
+ */
|
+ */
|
||||||
+bool Alias::isInitialized(void) {
|
+bool Alias::isInitialized(void) {
|
||||||
+ return !acl.empty(); // if there is no entry in our accesslist we do not have to check anything...
|
+ return !acl.empty(); // if there is no entry in our accesslist we do not have to check anything...
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/*
|
+/*
|
||||||
+ * check if we have found an alias
|
+ * check if we have found an alias
|
||||||
+ */
|
+ */
|
||||||
+bool Alias::foundAlias(void) {
|
+bool Alias::foundAlias(void) {
|
||||||
+ return aliasFound;
|
+ return aliasFound;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/*
|
+/*
|
||||||
+ * try to compare the given mail addresses with our acl
|
+ * try to compare the given mail addresses with our acl
|
||||||
+ * FIXME: aliasing would not work with unicode mailaddresses!
|
+ * FIXME: aliasing would not work with unicode mailaddresses!
|
||||||
+ */
|
+ */
|
||||||
+bool Alias::check_mail(wchar_t *e1, wchar_t *e2) {
|
+bool Alias::check_mail(wchar_t *e1, wchar_t *e2) {
|
||||||
+ wstring wE1 = wstring(e1);
|
+ wstring wE1 = wstring(e1);
|
||||||
+ wstring wE2 = wstring(e2);
|
+ wstring wE2 = wstring(e2);
|
||||||
+ string sE1(wE1.begin(), wE1.end());
|
+ string sE1(wE1.begin(), wE1.end());
|
||||||
+ string sE2(wE2.begin(), wE2.end());
|
+ string sE2(wE2.begin(), wE2.end());
|
||||||
+
|
+
|
||||||
+ multimap<string, AliasData>::iterator mmIterator;
|
+ multimap<string, AliasData>::iterator mmIterator;
|
||||||
+
|
+
|
||||||
+ if(isInitialized()) {
|
+ if(isInitialized()) {
|
||||||
+ mmIterator = acl.find(sE1);
|
+ mmIterator = acl.find(sE1);
|
||||||
+ if(mmIterator != acl.end()) {
|
+ if(mmIterator != acl.end()) {
|
||||||
+ do {
|
+ do {
|
||||||
+ if(mmIterator->second.aliasMailAddress.compare(sE2) == 0) {
|
+ if(mmIterator->second.aliasMailAddress.compare(sE2) == 0) {
|
||||||
+ // found positive match in acl
|
+ // found positive match in acl
|
||||||
+ aliasFound = true;
|
+ aliasFound = true;
|
||||||
+ aliasFoundData = mmIterator->second;
|
+ aliasFoundData = mmIterator->second;
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ mmIterator++;
|
+ mmIterator++;
|
||||||
+ } while(mmIterator != acl.upper_bound(sE1));
|
+ } while(mmIterator != acl.upper_bound(sE1));
|
||||||
+ } else {
|
+ } else {
|
||||||
+ // found noting...
|
+ // found noting...
|
||||||
+ aliasFound = false;
|
+ aliasFound = false;
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return false;
|
+ return false;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+wstring Alias::getAliasName() {
|
+wstring Alias::getAliasName() {
|
||||||
+ wstring name( L"" ); // default will be a empty string
|
+ wstring name( L"" ); // default will be a empty string
|
||||||
+
|
+
|
||||||
+ if(foundAlias()) {
|
+ if(foundAlias()) {
|
||||||
+ name.assign(aliasFoundData.aliasName.begin(), aliasFoundData.aliasName.end()); // works for ascii only
|
+ name.assign(aliasFoundData.aliasName.begin(), aliasFoundData.aliasName.end()); // works for ascii only
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return name;
|
+ return name;
|
||||||
+}
|
+}
|
||||||
\ No newline at end of file
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/alias.h zarafa-7.2.0/spooler/alias.h
|
||||||
diff -ruN --exclude=.svn spooler/alias.h ZARAFA_SPOOLER/alias.h
|
--- orig/zarafa-7.2.0/spooler/alias.h 1969-12-31 19:00:00.000000000 -0500
|
||||||
--- spooler/alias.h 1970-01-01 01:00:00.000000000 +0100
|
+++ zarafa-7.2.0/spooler/alias.h 2015-03-09 13:13:50.543932736 -0400
|
||||||
+++ ZARAFA_SPOOLER/alias.h 2013-04-27 20:54:19.619037700 +0200
|
@@ -0,0 +1,52 @@
|
||||||
@@ -0,0 +1,52 @@
|
+/*
|
||||||
+/*
|
+ * Copyright 2015 Christoph Haas <christoph.h@sprinternet.at>
|
||||||
+ * Copyright 2013 Christoph Haas <christoph.h@sprinternet.at>
|
+ *
|
||||||
+ *
|
+ * This program is free software: you can redistribute it and/or modify
|
||||||
+ * This program is free software: you can redistribute it and/or modify
|
+ * it under the terms of the GNU General Public License as published by
|
||||||
+ * it under the terms of the GNU General Public License as published by
|
+ * the Free Software Foundation, either version 3 of the License, or
|
||||||
+ * the Free Software Foundation, either version 3 of the License, or
|
+ * (at your option) any later version.
|
||||||
+ * (at your option) any later version.
|
+ *
|
||||||
+ *
|
+ * This program is distributed in the hope that it will be useful,
|
||||||
+ * This program is distributed in the hope that it will be useful,
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
+ * GNU General Public License for more details.
|
||||||
+ * GNU General Public License for more details.
|
+ *
|
||||||
+ *
|
+ * You should have received a copy of the GNU General Public License
|
||||||
+ * You should have received a copy of the GNU General Public License
|
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
+ *
|
||||||
+ *
|
+ */
|
||||||
+ */
|
+
|
||||||
+
|
+#include <fstream>
|
||||||
+#include <fstream>
|
+#include <sstream>
|
||||||
+#include <sstream>
|
+#include <string>
|
||||||
+#include <string>
|
+#include <cstring>
|
||||||
+#include <cstring>
|
+#include <algorithm>
|
||||||
+#include <algorithm>
|
+#include <map>
|
||||||
+#include <map>
|
+
|
||||||
+
|
+#include "ECLogger.h"
|
||||||
+#include "ECLogger.h"
|
+
|
||||||
+
|
+using namespace std;
|
||||||
+using namespace std;
|
+extern ECLogger *g_lpLogger;
|
||||||
+extern ECLogger *g_lpLogger;
|
+
|
||||||
+
|
+struct AliasData {
|
||||||
+struct AliasData {
|
+ string ownerMailAddress;
|
||||||
+ string ownerMailAddress;
|
+ string aliasMailAddress;
|
||||||
+ string aliasMailAddress;
|
+ string aliasName;
|
||||||
+ string aliasName;
|
+};
|
||||||
+};
|
+
|
||||||
+
|
+class Alias {
|
||||||
+class Alias {
|
+ private:
|
||||||
+ private:
|
+ ifstream alias_file;
|
||||||
+ ifstream alias_file;
|
+ multimap<string, AliasData> acl;
|
||||||
+ multimap<string, AliasData> acl;
|
+ bool aliasFound;
|
||||||
+ bool aliasFound;
|
+ AliasData aliasFoundData;
|
||||||
+ AliasData aliasFoundData;
|
+
|
||||||
+
|
+ string trim(const string &strInput, const string &strTrim = " ");
|
||||||
+ string trim(const string &strInput, const string &strTrim = " ");
|
+ bool isInitialized (void);
|
||||||
+ bool isInitialized (void);
|
+ public:
|
||||||
+ public:
|
+ Alias();
|
||||||
+ Alias();
|
+ void init (char *filename);
|
||||||
+ void init (char *filename);
|
+ bool foundAlias (void);
|
||||||
+ bool foundAlias (void);
|
+ wstring getAliasName (void);
|
||||||
+ wstring getAliasName (void);
|
+ bool check_mail (wchar_t *e1, wchar_t *e2);
|
||||||
+ bool check_mail (wchar_t *e1, wchar_t *e2);
|
+};
|
||||||
+};
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/mailer.cpp zarafa-7.2.0/spooler/mailer.cpp
|
||||||
diff -ruN --exclude=.svn spooler/mailer.cpp ZARAFA_SPOOLER/mailer.cpp
|
--- orig/zarafa-7.2.0/spooler/mailer.cpp 2015-03-05 10:54:04.000000000 -0500
|
||||||
--- spooler/mailer.cpp 2013-02-28 17:13:18.000000000 +0100
|
+++ zarafa-7.2.0/spooler/mailer.cpp 2015-03-09 13:39:14.851941692 -0400
|
||||||
+++ ZARAFA_SPOOLER/mailer.cpp 2013-05-03 10:14:51.555584600 +0200
|
@@ -45,6 +45,7 @@
|
||||||
@@ -50,6 +50,7 @@
|
#include "platform.h"
|
||||||
#include "platform.h"
|
#include "mailer.h"
|
||||||
#include "mailer.h"
|
#include "archive.h"
|
||||||
#include "archive.h"
|
+#include "alias.h"
|
||||||
+#include "alias.h"
|
|
||||||
|
#include <mapitags.h>
|
||||||
#include <mapitags.h>
|
#include <mapiext.h>
|
||||||
#include <mapiext.h>
|
@@ -1839,7 +1840,7 @@
|
||||||
@@ -82,6 +83,7 @@
|
*/
|
||||||
|
HRESULT CheckSendAs(IAddrBook *lpAddrBook, IMsgStore *lpUserStore, IMAPISession *lpAdminSession, ECSender *lpMailer,
|
||||||
#include <list>
|
ULONG ulOwnerCB, LPENTRYID lpOwnerEID, ULONG ulRepresentCB, LPENTRYID lpRepresentEID,
|
||||||
#include <algorithm>
|
- bool *lpbAllowed, LPMDB *lppRepStore)
|
||||||
+
|
+ bool *lpbAllowed, LPMDB *lppRepStore, Alias *aliasCheck)
|
||||||
using namespace std;
|
{
|
||||||
|
HRESULT hr = hrSuccess;
|
||||||
extern ECConfig *g_lpConfig;
|
bool bAllowed = false;
|
||||||
@@ -1758,7 +1760,7 @@
|
@@ -1851,7 +1852,7 @@
|
||||||
*/
|
LPSPropValue lpRepresentProps = NULL;
|
||||||
HRESULT CheckSendAs(IAddrBook *lpAddrBook, IMsgStore *lpUserStore, IMAPISession *lpAdminSession, ECSender *lpMailer,
|
SPropValue sSpoofEID = {0};
|
||||||
ULONG ulOwnerCB, LPENTRYID lpOwnerEID, ULONG ulRepresentCB, LPENTRYID lpRepresentEID,
|
ULONG ulCmpRes = 0;
|
||||||
- bool *lpbAllowed, LPMDB *lppRepStore)
|
- SizedSPropTagArray(3, sptaIDProps) = { 3, { PR_DISPLAY_NAME_W, PR_EC_SENDAS_USER_ENTRYIDS, PR_DISPLAY_TYPE } };
|
||||||
+ bool *lpbAllowed, LPMDB *lppRepStore, Alias *aliasCheck)
|
+ SizedSPropTagArray(5, sptaIDProps) = { 5, { PR_DISPLAY_NAME_W, PR_EC_SENDAS_USER_ENTRYIDS, PR_DISPLAY_TYPE, PR_SMTP_ADDRESS_W, PR_EMAIL_ADDRESS_W } };
|
||||||
{
|
ULONG cValues = 0;
|
||||||
HRESULT hr = hrSuccess;
|
|
||||||
bool bAllowed = false;
|
|
||||||
@@ -1770,10 +1772,9 @@
|
@@ -1901,7 +1902,19 @@
|
||||||
LPSPropValue lpRepresentProps = NULL;
|
|
||||||
SPropValue sSpoofEID = {0};
|
if (lpRepresentProps[2].ulPropTag != PR_DISPLAY_TYPE) { // Required property for a mailuser object
|
||||||
ULONG ulCmpRes = 0;
|
hr = MAPI_E_NOT_FOUND;
|
||||||
- SizedSPropTagArray(3, sptaIDProps) = { 3, { PR_DISPLAY_NAME_W, PR_EC_SENDAS_USER_ENTRYIDS, PR_DISPLAY_TYPE } };
|
- g_lpLogger->Log(EC_LOGLEVEL_NOTICE, "CheckSendAs(): PR_DISPLAY_TYPE missing %x", hr);
|
||||||
+ SizedSPropTagArray(5, sptaIDProps) = { 5, { PR_DISPLAY_NAME_W, PR_EC_SENDAS_USER_ENTRYIDS, PR_DISPLAY_TYPE, PR_SMTP_ADDRESS_W, PR_EMAIL_ADDRESS_W } };
|
+ // we are checking a simple textfile for matches.
|
||||||
ULONG cValues = 0;
|
+ // if the users smtp-address is matching we allow the sending
|
||||||
|
+ if(strcmp(g_lpConfig->GetSetting("use_alias_file"), "yes") == 0) {
|
||||||
-
|
+ if(aliasCheck->check_mail(lpOwnerProps[3].Value.lpszW, lpRepresentProps[4].Value.lpszW)) {
|
||||||
hr = SMTPToZarafa(lpAddrBook, ulRepresentCB, lpRepresentEID, &sSpoofEID.Value.bin.cb, (LPENTRYID*)&sSpoofEID.Value.bin.lpb);
|
+ g_lpLogger->Log(EC_LOGLEVEL_INFO,"alias found in acl: %ls -> %ls", lpOwnerProps[3].Value.lpszW, lpRepresentProps[4].Value.lpszW);
|
||||||
if (hr != hrSuccess)
|
+ hr = hrSuccess;
|
||||||
hr = ContactToZarafa(lpUserStore, lpAddrBook, ulRepresentCB, lpRepresentEID, &sSpoofEID.Value.bin.cb, (LPENTRYID*)&sSpoofEID.Value.bin.lpb);
|
+ bAllowed = true;
|
||||||
@@ -1810,6 +1811,18 @@
|
+ } else {
|
||||||
|
+ g_lpLogger->Log(EC_LOGLEVEL_ERROR,"alias not found in acl: %ls -> %ls", lpOwnerProps[3].Value.lpszW, lpRepresentProps[4].Value.lpszW);
|
||||||
if (lpRepresentProps[2].ulPropTag != PR_DISPLAY_TYPE) { // Required property for a mailuser object
|
+ }
|
||||||
hr = MAPI_E_NOT_FOUND;
|
+ } else {
|
||||||
+
|
+ g_lpLogger->Log(EC_LOGLEVEL_NOTICE, "CheckSendAs(): PR_DISPLAY_TYPE missing %x", hr);
|
||||||
+ // we are checking a simple textfile for matches.
|
+ }
|
||||||
+ // if the users smtp-address is matching we allow the sending
|
goto exit;
|
||||||
+ if(strcmp(g_lpConfig->GetSetting("use_alias_file"), "yes") == 0) {
|
}
|
||||||
+ if(aliasCheck->check_mail(lpOwnerProps[3].Value.lpszW, lpRepresentProps[4].Value.lpszW)) {
|
|
||||||
+ g_lpLogger->Log(EC_LOGLEVEL_INFO,"alias found in acl: %ls -> %ls", lpOwnerProps[3].Value.lpszW, lpRepresentProps[4].Value.lpszW);
|
@@ -2271,6 +2284,15 @@
|
||||||
+ hr = hrSuccess;
|
|
||||||
+ bAllowed = true;
|
ArchiveResult archiveResult;
|
||||||
+ }else {
|
|
||||||
+ g_lpLogger->Log(EC_LOGLEVEL_ERROR,"alias not found in acl: %ls -> %ls", lpOwnerProps[3].Value.lpszW, lpRepresentProps[4].Value.lpszW);
|
+ Alias aliasCheck;
|
||||||
+ }
|
+
|
||||||
+ }
|
+ if(strcmp(g_lpConfig->GetSetting("use_alias_file"), "yes") == 0) {
|
||||||
goto exit;
|
+ g_lpLogger->Log(EC_LOGLEVEL_INFO,"Alias checking enabled");
|
||||||
}
|
+ aliasCheck.init(g_lpConfig->GetSetting("alias_file"));
|
||||||
bHasStore = (lpRepresentProps[2].Value.l == DT_MAILUSER);
|
+ } else {
|
||||||
@@ -2166,6 +2179,15 @@
|
+ g_lpLogger->Log(EC_LOGLEVEL_INFO,"Alias checking disabled");
|
||||||
ULONG ulResult = 0;
|
+ }
|
||||||
|
+
|
||||||
ArchiveResult archiveResult;
|
sending_options sopt;
|
||||||
+
|
|
||||||
+ Alias aliasCheck;
|
imopt_default_sending_options(&sopt);
|
||||||
+
|
@@ -2438,7 +2460,7 @@
|
||||||
+ if(strcmp(g_lpConfig->GetSetting("use_alias_file"), "yes") == 0) {
|
if (!bAllowDelegate) {
|
||||||
+ g_lpLogger->Log(EC_LOGLEVEL_INFO,"Alias checking enabled");
|
|
||||||
+ aliasCheck.init(g_lpConfig->GetSetting("alias_file"));
|
hr = CheckSendAs(lpAddrBook, lpUserStore, lpAdminSession, lpMailer, lpPropOwner->Value.bin.cb, (LPENTRYID)lpPropOwner->Value.bin.lpb,
|
||||||
+ } else {
|
- lpRepEntryID->Value.bin.cb, (LPENTRYID)lpRepEntryID->Value.bin.lpb, &bAllowSendAs, &lpRepStore);
|
||||||
+ g_lpLogger->Log(EC_LOGLEVEL_INFO,"Alias checking disabled");
|
+ lpRepEntryID->Value.bin.cb, (LPENTRYID)lpRepEntryID->Value.bin.lpb, &bAllowSendAs, &lpRepStore, &aliasCheck);
|
||||||
+ }
|
if (hr != hrSuccess)
|
||||||
|
goto exit;
|
||||||
sending_options sopt;
|
|
||||||
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/Makefile.am zarafa-7.2.0/spooler/Makefile.am
|
||||||
@@ -2334,7 +2356,7 @@
|
--- orig/zarafa-7.2.0/spooler/Makefile.am 2015-03-05 10:52:42.000000000 -0500
|
||||||
if (!bAllowDelegate) {
|
+++ zarafa-7.2.0/spooler/Makefile.am 2015-03-09 13:40:47.467933464 -0400
|
||||||
|
@@ -28,7 +28,7 @@
|
||||||
hr = CheckSendAs(lpAddrBook, lpUserStore, lpAdminSession, lpMailer, lpPropOwner->Value.bin.cb, (LPENTRYID)lpPropOwner->Value.bin.lpb,
|
$(PROG_LIBS) $(PYTHON_LIBS) $(XML2_LIBS)
|
||||||
- lpRepEntryID->Value.bin.cb, (LPENTRYID)lpRepEntryID->Value.bin.lpb, &bAllowSendAs, &lpRepStore);
|
|
||||||
+ lpRepEntryID->Value.bin.cb, (LPENTRYID)lpRepEntryID->Value.bin.lpb, &bAllowSendAs, &lpRepStore, &aliasCheck);
|
zarafa_dagent_SOURCES = DAgent.cpp rules.cpp rules.h LMTP.cpp LMTP.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
||||||
if (hr != hrSuccess)
|
-zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
||||||
goto exit;
|
+zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h alias.cpp alias.h
|
||||||
|
|
||||||
@@ -2363,7 +2385,6 @@
|
BUILT_SOURCES=PythonSWIGRuntime.h
|
||||||
sPropSender[1].Value.LPSZ = _T("ZARAFA");
|
|
||||||
sPropSender[2].ulPropTag = PR_SENDER_EMAIL_ADDRESS_W;
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/Makefile.in zarafa-7.2.0/spooler/Makefile.in
|
||||||
sPropSender[2].Value.LPSZ = lpUser->lpszMailAddress;
|
--- orig/zarafa-7.2.0/spooler/Makefile.in 2015-03-05 10:52:53.000000000 -0500
|
||||||
-
|
+++ zarafa-7.2.0/spooler/Makefile.in 2015-03-09 13:43:20.163932624 -0400
|
||||||
sPropSender[3].ulPropTag = PR_SENDER_ENTRYID;
|
@@ -83,7 +83,7 @@
|
||||||
sPropSender[3].Value.bin.cb = lpUser->sUserId.cb;
|
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||||
sPropSender[3].Value.bin.lpb = lpUser->sUserId.lpb;
|
am__v_lt_0 = --silent
|
||||||
diff -ruN --exclude=.svn spooler/Makefile.am ZARAFA_SPOOLER/Makefile.am
|
am_zarafa_spooler_OBJECTS = Spooler.$(OBJEXT) mailer.$(OBJEXT) \
|
||||||
--- spooler/Makefile.am 2013-02-28 16:11:57.000000000 +0100
|
- archive.$(OBJEXT) PyMapiPlugin.$(OBJEXT)
|
||||||
+++ ZARAFA_SPOOLER/Makefile.am 2013-04-27 13:12:21.888888200 +0200
|
+ archive.$(OBJEXT) PyMapiPlugin.$(OBJEXT) alias.$(OBJEXT)
|
||||||
@@ -28,7 +28,7 @@
|
zarafa_spooler_OBJECTS = $(am_zarafa_spooler_OBJECTS)
|
||||||
$(PROG_LIBS) $(PYTHON_LIBS)
|
zarafa_spooler_DEPENDENCIES = ${top_builddir}/inetmapi/libinetmapi.la \
|
||||||
|
${top_builddir}/mapi4linux/src/libmapi.la \
|
||||||
zarafa_dagent_SOURCES = DAgent.cpp rules.cpp rules.h LMTP.cpp LMTP.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
@@ -410,7 +410,7 @@
|
||||||
-zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
$(PROG_LIBS) $(PYTHON_LIBS) $(XML2_LIBS)
|
||||||
+zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h alias.cpp alias.h
|
|
||||||
|
zarafa_dagent_SOURCES = DAgent.cpp rules.cpp rules.h LMTP.cpp LMTP.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
||||||
BUILT_SOURCES=PythonSWIGRuntime.h
|
-zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
||||||
|
+zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h alias.cpp alias.h
|
||||||
diff -ruN --exclude=.svn spooler/Makefile.in ZARAFA_SPOOLER/Makefile.in
|
BUILT_SOURCES = PythonSWIGRuntime.h
|
||||||
--- spooler/Makefile.in 2013-02-28 16:13:50.000000000 +0100
|
CLEANFILES = PythonSWIGRuntime.h
|
||||||
+++ ZARAFA_SPOOLER/Makefile.in 2013-04-27 13:28:39.964779800 +0200
|
EXTRA_DIST = PythonSWIGRuntime.h
|
||||||
@@ -66,7 +66,7 @@
|
@@ -514,6 +514,7 @@
|
||||||
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Spooler.Po@am__quote@
|
||||||
am__v_lt_0 = --silent
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive.Po@am__quote@
|
||||||
am_zarafa_spooler_OBJECTS = Spooler.$(OBJEXT) mailer.$(OBJEXT) \
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mailer.Po@am__quote@
|
||||||
- archive.$(OBJEXT) PyMapiPlugin.$(OBJEXT)
|
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@
|
||||||
+ archive.$(OBJEXT) PyMapiPlugin.$(OBJEXT) alias.$(OBJEXT)
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rules.Po@am__quote@
|
||||||
zarafa_spooler_OBJECTS = $(am_zarafa_spooler_OBJECTS)
|
|
||||||
zarafa_spooler_DEPENDENCIES = ${top_builddir}/inetmapi/libinetmapi.la \
|
.cpp.o:
|
||||||
${top_builddir}/mapi4linux/src/libmapi.la \
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/README.txt zarafa-7.2.0/spooler/README.txt
|
||||||
@@ -391,7 +391,7 @@
|
--- orig/zarafa-7.2.0/spooler/README.txt 1969-12-31 19:00:00.000000000 -0500
|
||||||
$(PROG_LIBS) $(PYTHON_LIBS)
|
+++ zarafa-7.2.0/spooler/README.txt 2015-03-09 13:58:45.579943321 -0400
|
||||||
|
@@ -0,0 +1,74 @@
|
||||||
zarafa_dagent_SOURCES = DAgent.cpp rules.cpp rules.h LMTP.cpp LMTP.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
+README for the alias extension:
|
||||||
-zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h
|
+
|
||||||
+zarafa_spooler_SOURCES = Spooler.cpp mailer.cpp mailer.h archive.cpp archive.h PyMapiPlugin.cpp PyMapiPlugin.h PythonSWIGRuntime.h alias.cpp alias.h
|
+___PREPARATION___:
|
||||||
BUILT_SOURCES = PythonSWIGRuntime.h
|
+
|
||||||
CLEANFILES = PythonSWIGRuntime.h
|
+First read: http://www.zarafa.com/wiki/index.php/Compiling_source_code
|
||||||
EXTRA_DIST = PythonSWIGRuntime.h
|
+
|
||||||
@@ -492,6 +492,7 @@
|
+For Debian 7 and ZCP 7.2 you can read my blog post: https://blog.sprinternet.at/2015/03/zarafa-zcp-7-2-auf-debian-wheezy-kompilieren/
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Spooler.Po@am__quote@
|
+
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive.Po@am__quote@
|
+
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mailer.Po@am__quote@
|
+___BUILDING___:
|
||||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@
|
+
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rules.Po@am__quote@
|
+cd path/to/zarafa-source
|
||||||
|
+./configure --enable-unicode --enable-release --enable-python --prefix=/usr --with-gsoap-prefix=/opt/zarafa/ --with-ical-prefix=/opt/zarafa/ --with-vmime-prefix=/opt/zarafa/
|
||||||
.cpp.o:
|
+make
|
||||||
diff -ruN --exclude=.svn spooler/README.txt ZARAFA_SPOOLER/README.txt
|
+checkinstall
|
||||||
--- spooler/README.txt 1970-01-01 01:00:00.000000000 +0100
|
+
|
||||||
+++ ZARAFA_SPOOLER/README.txt 2013-04-28 01:20:13.946002000 +0200
|
+
|
||||||
@@ -0,0 +1,26 @@
|
+___GENERAL___:
|
||||||
+README for the alias extension:
|
+
|
||||||
+
|
+The alias checking reads its rules from an ansi textfile.
|
||||||
+___BUILDING___:
|
+Each rule needs to be on a new line. The sender mailaddress, alias mailaddress and alias display name are seperated by a semicolon
|
||||||
+First read: http://www.zarafa.com/wiki/index.php/Compiling_source_code
|
+
|
||||||
+
|
+E.g:
|
||||||
+cd path/to/zarafa-source
|
+
|
||||||
+./configure --enable-release --disable-static --with-userscript-prefix=/etc/zarafa/userscripts --with-quotatemplate-prefix=/etc/zarafa/quotamails --enable-python --enable-unicode --disable-swig --disable-tcmalloc
|
+user@zarafa.de;aliasforuser@zarafa.de;Alias Username
|
||||||
+make
|
+user2@zarafa.com;aliasforuser2@zarafa.de;Alias2 Displayname
|
||||||
+checkinstall
|
+
|
||||||
+
|
+Changes to this file would be applied immediately.
|
||||||
+___GENERAL___:
|
+Info: Display name is currentl not in use.
|
||||||
+
|
+
|
||||||
+The alias checking reads its rules from an ansi textfile.
|
+
|
||||||
+Each rule needs to be on a new line. The sender mailaddress, alias mailaddress and alias display name are seperated by a semicolon
|
+___CONFIGURATION___:
|
||||||
+E.g:
|
+
|
||||||
+
|
+The default path for the rule file is: /etc/zarafa/alias.txt
|
||||||
+user@zarafa.de;aliasforuser@zarafa.de;Alias Username
|
+You can enable/disable the extension in the spooler.cfg file.
|
||||||
+user2@zarafa.com;aliasforuser2@zarafa.de;Alias2 Displayname
|
+
|
||||||
+
|
+WARNING: you have to restart the patched/recompiled spooler version once before you add the new config parameters!
|
||||||
+Changes to this file would be applied immediately.
|
+
|
||||||
+
|
+New configuration parameters:
|
||||||
+
|
+
|
||||||
+
|
+use_alias_file (Values: yes, no ; Default: yes)
|
||||||
+___CONFIGURATION___:
|
+alias_file (Values: Path to alias file ; Default: /etc/zarafa/alias.txt)
|
||||||
+
|
diff -ruN '--exclude=.svn' orig/zarafa-7.2.0/spooler/Spooler.cpp zarafa-7.2.0/spooler/Spooler.cpp
|
||||||
+The default path for the rule file is: /etc/zarafa/alias.txt
|
--- orig/zarafa-7.2.0/spooler/Spooler.cpp 2015-03-05 10:54:04.000000000 -0500
|
||||||
+
|
+++ zarafa-7.2.0/spooler/Spooler.cpp 2015-03-09 13:48:39.411933242 -0400
|
||||||
+You can enable/disable the extension in the spooler.cfg file.
|
@@ -1147,6 +1147,8 @@
|
||||||
+WARNING: you have to restart the patched/recompiled spooler version once before you add the new config parameters!
|
{ "plugin_enabled", "yes" },
|
||||||
+
|
{ "plugin_path", "/var/lib/zarafa/spooler/plugins" },
|
||||||
+New configuration parameters:
|
{ "plugin_manager_path", "/usr/share/zarafa-spooler/python" },
|
||||||
+
|
+ { "use_alias_file", "yes", CONFIGSETTING_RELOADABLE },
|
||||||
+use_alias_file (Values: yes, no ; Default: yes)
|
+ { "alias_file", "/etc/zarafa/alias.txt", CONFIGSETTING_RELOADABLE },
|
||||||
+alias_file (Values: Path to alias file ; Default: /etc/zarafa/alias.txt)
|
{ NULL, NULL },
|
||||||
\ No newline at end of file
|
};
|
||||||
diff -ruN --exclude=.svn spooler/Spooler.cpp ZARAFA_SPOOLER/Spooler.cpp
|
// SIGSEGV backtrace support
|
||||||
--- spooler/Spooler.cpp 2013-02-28 17:13:18.000000000 +0100
|
|
||||||
+++ ZARAFA_SPOOLER/Spooler.cpp 2013-04-27 13:15:02.096661200 +0200
|
|
||||||
@@ -1142,6 +1142,8 @@
|
|
||||||
{ "plugin_enabled", "yes" },
|
|
||||||
{ "plugin_path", "/var/lib/zarafa/spooler/plugins" },
|
|
||||||
{ "plugin_manager_path", "/usr/share/zarafa-spooler/python" },
|
|
||||||
+ { "use_alias_file", "yes", CONFIGSETTING_RELOADABLE },
|
|
||||||
+ { "alias_file", "/etc/zarafa/alias.txt", CONFIGSETTING_RELOADABLE },
|
|
||||||
{ NULL, NULL },
|
|
||||||
};
|
|
||||||
// SIGSEGV backtrace support
|
|
||||||
|
Loading…
Reference in New Issue
Block a user