Continued work.
This commit is contained in:
1 parent
e1f33291f7
commit
8e7834a320
17 files changed
+152
-108
No files matched your search
@@ -0,0 +1,43 @@
|
||||
|
||||
#include "MailFileSystem.h"
|
||||
# include "INotify.h"
|
||||
|
||||
namespace mail {
|
||||
|
||||
MailFileSystem::MailFileSystem(std::string mailPath) : mailPath(mailPath) {}
|
||||
|
||||
bool MailFileSystem::ifMailBoxExists(std::string mailbox) {
|
||||
std::cout << "{" << mailbox << "}" << std::endl;
|
||||
|
||||
if(stat(getMailBoxPath(mailbox).c_str(), &statbuf) != -1)
|
||||
if(S_ISDIR(statbuf.st_mode))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MailFileSystem::ifAliasExists(std::string alias) {
|
||||
if(stat(getMailBoxPath(alias).c_str(), &statbuf) != -1)
|
||||
if(S_ISREG(statbuf.st_mode))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string MailFileSystem::getMailBoxPath(std::string mailbox) {
|
||||
coreutils::ZString email(mailbox);
|
||||
email.split("@", 1);
|
||||
std::cout << email[0] << "-" << email[1] << std::endl;
|
||||
std::string path = mailPath + "/" + email[1].str() + "/" + email[0].str();
|
||||
std::cout << "{" << path << "}" << std::endl;
|
||||
return path;
|
||||
}
|
||||
|
||||
std::vector<std::string> MailFileSystem::getAliasMailboxes(std::string alias) {
|
||||
std::vector<std::string> returnValue;
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
std::string MailFileSystem::getMailPath() {
|
||||
return mailPath;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user