Beispiel #1
0
void Service::MakeSplitVec(){
    int start = 0, numb;
    Service serv;

    for(unsigned int i = 0;i < service.size();i++)
    {
        start = 0;
        serv.Name = findsubstr(numb,start,i);
        serv.Sex = findsubstr(numb,start,i);
        serv.Byear = findsubstr(numb,start,i);
        serv.Dyear = findsubstr(numb,start,i);
        Persons.push_back(serv);
    }
}
//And this is main filter function.
DWORD WINAPI FilterMail(HACCOUNT Account,DWORD AccountVer,HYAMNMAIL Mail,DWORD MailVer)
{
	struct CMimeItem *Browser;

	if(MailVer!=YAMN_MAILVERSION)	//we test if we work with the right YAMNMAIL
		return 0;
	if(Mail->MailData==NULL)		//MailData should be available
		return 0;

#ifdef DEBUG_FILTER
	DebugLog(FilterFile,"<New mail>\n");
#endif
	if(!(Mail->Flags & YAMN_MSG_VIRTUAL))
		for(Browser=Mail->MailData->TranslatedHeader;Browser!=NULL;Browser=Browser->Next)	//we browse all header stored in Mail->TranslatedHeader
		{
#ifdef DEBUG_FILTER
			DebugLog(FilterFile,"<Testing header item %s: %s>\n",Browser->name,Browser->value);
#endif
			for(int i=0;i<fts;i++)
				if(!lstrcmpi(Browser->name,ft[i].name))
				{
#ifdef DEBUG_FILTER
					DebugLog(FilterFile,"\t\t<Found appropriate selector %s>\n",Browser->name);
#endif
					if(findsubstr(Browser->value,ft[i].value))		//and if we find
					{
						if((ft[i].sl==0) && ((Mail->Flags & YAMN_MSG_SPAMMASK)==0))
						{
							Mail->Flags&=~(YAMN_MSG_POPUP | YAMN_MSG_SYSTRAY | YAMN_MSG_BROWSER | YAMN_MSG_SOUND | YAMN_MSG_APP | YAMN_MSG_NEVENT);
#ifdef DEBUG_FILTER
							DebugLog(FilterFile,"\t\tSetting individual flags not to notify mail, but does not consider as spam.");
#endif
						}
						else if((Mail->Flags & YAMN_MSG_SPAMMASK) < ft[i].sl)			//if some filter plugin set higher level of spam, we do nothing
						{
							Mail->Flags=(Mail->Flags & ~YAMN_MSG_SPAMMASK)+ft[i].sl;	//else we set spam level 2 (clearing spam bits and then settting them to level 2
#ifdef DEBUG_FILTER
							DebugLog(FilterFile,"\t\tMail marked to be spam #%d\n",Mail->Flags & YAMN_MSG_SPAMMASK);
#endif
						}
					}
#ifdef DEBUG_FILTER
					DebugLog(FilterFile,"\t\t</Found appropriate selector>\n");
#endif
				}
#ifdef DEBUG_FILTER
			DebugLog(FilterFile,"</Testing header>\n");
#endif
		}
#ifdef DEBUG_FILTER
	DebugLog(FilterFile,"</New mail>\n\n");
#endif
	return 1;
}
Beispiel #3
0
bool Service::CheckName(string str){
    int start,numb;
    string name;

    for(unsigned int i = 0; i < service.size(); i++){
        start = 0;
        name = findsubstr(numb,start,i);
        if(str == name){
            return false;
        }
    }
    return true;
}