mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
Mail: Add an e-mail application called Mail
This utilises LibIMAP and LibWeb to provide an e-mail client. The only way currently to connect to a server and login is with a config file. This config file should be stored in ~/.config/Mail.ini Here is an example config file: ``` [Connection] Server=email.example.com Port=993 TLS=true [User] Username=test@example.com Password=Example!1 ``` Since this is stored in plaintext and uses a less secure login method, I'd recommend not using this on your main accounts :^) This has been tested on Gmail and Outlook. For Gmail, you either have to generate an app password if you have 2FA enabled, or enable access from less secure apps in your account settings.
This commit is contained in:
parent
e80f8746b1
commit
b716e902ba
15 changed files with 1113 additions and 0 deletions
50
Userland/Applications/Mail/InboxModel.cpp
Normal file
50
Userland/Applications/Mail/InboxModel.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "InboxModel.h"
|
||||
|
||||
InboxModel::InboxModel(Vector<InboxEntry> entries)
|
||||
: m_entries(move(entries))
|
||||
{
|
||||
}
|
||||
|
||||
InboxModel::~InboxModel()
|
||||
{
|
||||
}
|
||||
|
||||
int InboxModel::row_count(GUI::ModelIndex const&) const
|
||||
{
|
||||
return m_entries.size();
|
||||
}
|
||||
|
||||
String InboxModel::column_name(int column_index) const
|
||||
{
|
||||
switch (column_index) {
|
||||
case Column::From:
|
||||
return "From";
|
||||
case Subject:
|
||||
return "Subject";
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
GUI::Variant InboxModel::data(GUI::ModelIndex const& index, GUI::ModelRole role) const
|
||||
{
|
||||
auto& value = m_entries[index.row()];
|
||||
if (role == GUI::ModelRole::Display) {
|
||||
if (index.column() == Column::From)
|
||||
return value.from;
|
||||
if (index.column() == Column::Subject)
|
||||
return value.subject;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void InboxModel::update()
|
||||
{
|
||||
did_update();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue