void EmailAccountSettingsModel::init()
{
    mAccounts.clear();
    mAccountConfigs.clear();
    QMailStore *mailstore = QMailStore::instance();
    QMailAccountIdList idlist = mailstore->queryAccounts(QMailAccountKey::messageType(QMailMessage::Email));
    QMailAccountId id;
    foreach (id, idlist) {
        mAccounts.append(mailstore->account(id));
        mAccountConfigs.append(mailstore->accountConfiguration(id));
    }
void SmsInit::setupAccount()
{
    QMailStore *mailstore = QMailStore::instance();
    if (!startMessageServer()) {
        qCritical("Could not start messageserver");
    }

    QMailAccountIdList accountids = mailstore->queryAccounts();
    QMailAccountId accountid;
    bool found = false;
    foreach (accountid, accountids) {
        QMailAccount account = QMailAccount(accountid);
        if (account.messageSources().contains("sms", Qt::CaseInsensitive)) {
            found = true;
            break;
        }
    }