void SmtpSendMailCommand::RunImpl() { try { if (m_session.HasError()) { if (m_session.GetError().errorOnEmail) { // this doesn't make any sense, but if we don't mark the mail as bad, someone // is going to loop... m_error = m_session.GetError(); MojLogInfo(m_log, "SendMail dying off, marking mail as bad ..."); UpdateSendStatus(); } else { MojLogInfo(m_log, "SendMail dying off, due to session error state ..."); m_doneSignal.fire(m_session.GetError()); Complete(); } return; } MojString json; m_emailId.toJson(json); MojLogInfo(m_log, "running sendMail id=%s", json.data()); GetEmail(); } catch (const std::exception& e) { HandleException(e, __func__, __FILE__, __LINE__); } catch (...) { HandleUnknownException(); } }
NS_IMETHODIMP nsMsgIdentity::GetDoBccList(nsACString& aValue) { if (!mPrefBranch) return NS_ERROR_NOT_INITIALIZED; nsCString val; nsresult rv = mPrefBranch->GetCharPref("doBccList", getter_Copies(val)); aValue = val; if (NS_SUCCEEDED(rv)) return rv; bool bccSelf = false; rv = GetBccSelf(&bccSelf); NS_ENSURE_SUCCESS(rv,rv); if (bccSelf) GetEmail(aValue); bool bccOthers = false; rv = GetBccOthers(&bccOthers); NS_ENSURE_SUCCESS(rv,rv); nsCString others; rv = GetBccList(others); NS_ENSURE_SUCCESS(rv,rv); if (bccOthers && !others.IsEmpty()) { if (bccSelf) aValue.AppendLiteral(","); aValue.Append(others); } return SetDoBccList(aValue); }
bool AccountMgr::CheckEmail(uint32 accountId, std::string newEmail) { std::string oldEmail; // We simply return false for a non-existing email if (!GetEmail(accountId, oldEmail)) return false; normalizeString(oldEmail); normalizeString(newEmail); if (strcmp(oldEmail.c_str(), newEmail.c_str()) == 0) return true; return false; }
bool AccountMgr::CheckEmail(uint32 accountId, std::string newEmail) { std::string oldEmail; // We simply return false for a non-existing email if (!GetEmail(accountId, oldEmail)) return false; Utf8ToUpperOnlyLatin(oldEmail); Utf8ToUpperOnlyLatin(newEmail); if (strcmp(oldEmail.c_str(), newEmail.c_str()) == 0) return true; return false; }
void LoginForm::SaveSettings() { QSettings settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_profileName, "mrimsettings"); QStringList accounts = settings.value("accounts/list").toStringList(); QString email = GetEmail(), pass = GetPass(); if( !accounts.contains(email) ) { accounts<<email; accounts.sort(); settings.setValue("accounts/list", accounts); } QSettings account_settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_profileName+"/mrim."+email, "accountsettings"); account_settings.setValue("main/login", email); account_settings.setValue("main/password", pass); }
String MAPIContact::GetEmailDisplayAs(int nIndex) { String strDisplayAs; #ifdef _WIN32_WCE return GetEmail(strDisplayAs, nIndex); #else ULONG nID = GetOutlookEmailID(nIndex); if(!nID) return String(); LPSPropValue pProp; if(GetOutlookProperty(OUTLOOK_DATA1, nID-3, pProp)) { strDisplayAs = MAPIEx::GetValidString(*pProp); MAPIFreeBuffer(pProp); return strDisplayAs; } return String(); #endif }
/************************************************************** 功能:分析网页 ***************************************************************/ void AnalyzePage(WEBNODE * node) { int fd; int flength = 0; fd = open(node->file, O_RDONLY); if(fd == -1) goto __AnalyzeDone; flength = lseek(fd, 1, SEEK_END); write(fd, "\0", 1); lseek(fd, 0, SEEK_SET); mapped_mem = mmap(0, flength, PROT_READ, MAP_PRIVATE, fd, 0); GetEmail(mapped_mem); GetLink(mapped_mem); close(fd); munmap(mapped_mem, flength); __AnalyzeDone: close(fd); node->IsHandled = 1; remove(node->file); }
nsresult nsMsgIdentity::GetIdentityName(nsAString& idName) { nsresult rv = GetUnicharAttribute("identityName", idName); if (NS_FAILED(rv)) return rv; if (idName.IsEmpty()) { nsString fullName; rv = GetFullName(fullName); if (NS_FAILED(rv)) return rv; nsCString email; rv = GetEmail(email); if (NS_FAILED(rv)) return rv; idName.Assign(fullName); idName.AppendLiteral(" <"); idName.Append(NS_ConvertASCIItoUTF16(email)); idName.AppendLiteral(">"); } return rv; }
status_t ConnectView::Connect() { if (IsServerNeeded()) { // Demandons au serveur l'adresse de l'usager choisi // On demande en premier avec l'email : GetEmail(). // Si ca ne fonctionne pas, on demande avec le nom: GetFirstName() & GetLastName(). char* ip = TClient::Instance()->GetIPByEmail(GetEmail()); if (!strcmp(ip, "null")) { ip = TClient::Instance()->GetIPByName(GetLastName(), GetFirstName()); if (!strcmp(ip, "null")) { BAlert *myAlert = new BAlert( "Error", "User not found (maybe not online).\n Please try again later.", "Ok", NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_STOP_ALERT); myAlert->Go(); return false; } } /* WaitWindow* waitWindow = new WaitWindow; waitWindow->Show(); waitWindow->SetText(ip);*/ Output::Instance()->Network("Attempting servered Connection\n"); // OliverESP CNetwork::Instance()->SetView(this); // OliverESP SetEnabled(false); // OliverESP //return CNetwork::Instance()->ConnectFromUI(inet_addr(ip)); return CNetwork::Instance()->ConnectFromUI(GetIP()); } else { if (!strlen(GetIP())) { Field_error(_T("Please type some host or IP address")); BMessenger(this->Window()).SendMessage(new BMessage(MSG_NOT_CONNECTED)); SetEnabled(true); return B_ERROR; } WaitWindow* waitWindow = new WaitWindow; waitWindow->Show(); waitWindow->SetText(GetIP()); // On demande directement au reseau de nous connecter avec l'adresse dans GetIP(). // ulong RemoteAddress; OliverESP :not needed status_t err; Output::Instance()->Network("Attempting direct Connection\n"); // OliverESP CNetwork::Instance()->SetView(this); // OliverESP inform to enable later SetEnabled(false); // OliverESP diasabling // return CNetwork::Instance()->ConnectFromUI(inet_addr(GetIP())); // OliverESP error control err = CNetwork::Instance()->ConnectFromUI(GetIP()); switch (err){ case EHOSTUNREACH: Field_error(_T("It doesn´t look a valid host address")); BMessenger(this->Window()).SendMessage(new BMessage(MSG_NOT_CONNECTED)); SetEnabled(true); break; case B_ERROR: Field_error("Unable to comunicate sRTCP thread"); BMessenger(this->Window()).SendMessage(new BMessage(MSG_NOT_CONNECTED)); SetEnabled(true); break; case B_OK: Output::Instance()->Network("Awaiting response from remote...\n"); //Field_error("Trying connection..."); <-- this is blocking //return err; break; default: Field_error("Unable spawn threads!"); BMessenger(this->Window()).SendMessage(new BMessage(MSG_NOT_CONNECTED)); SetEnabled(true); break; } // waitWindow->QuitRequested(); //OliverESP: this method is provided no way to use it waitWindow->Lock(); waitWindow->Quit(); //OliverESP: if we dont Quit() it, it will acumulate with anothers return err; } return true; // temporaire }