1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +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:
Luke 2021-07-22 18:44:59 +01:00 committed by Ali Mohammad Pur
parent e80f8746b1
commit b716e902ba
15 changed files with 1113 additions and 0 deletions

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGUI/Model.h>
#include <LibIMAP/Objects.h>
struct InboxEntry {
String from;
String subject;
};
class InboxModel final : public GUI::Model {
public:
enum Column {
From,
Subject,
__Count
};
static NonnullRefPtr<InboxModel> create(Vector<InboxEntry> inbox_entries)
{
return adopt_ref(*new InboxModel(move(inbox_entries)));
}
virtual ~InboxModel() override;
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
virtual String column_name(int) const override;
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
virtual void update() override;
private:
InboxModel(Vector<InboxEntry>);
Vector<InboxEntry> m_entries;
};