Commit Graph

52 Commits

Author SHA1 Message Date
Guilherme Rugai Freire
b5f2e37ff8
update golang and deps 2025-08-28 10:13:19 -03:00
Guilherme Rugai Freire
a8860ea560
add support for cc and bcc
now it can handle when mails are carbon-copied
fixes #1 fixes #2
2025-08-28 09:46:20 -03:00
Guilherme Rugai Freire
f3d8e7052f
bump golang.org/x/net version to 0.33.0 2024-12-26 17:40:57 -03:00
Guilherme Rugai Freire
d385bbf906
only allow mails to addresses that contain the mail server domain
there were some mails coming in that was not for any temp mail addr,
it was like spam@otherdomain.com, but still reaching the database. This
should prevent this.
2024-07-21 20:15:25 -03:00
Guilherme Rugai Freire
7fe3ed30aa
use mail header from_addr to store in db 2024-07-21 02:39:17 -03:00
Guilherme Rugai Freire
6a523addb8
remove server restart TODO
if either the web server or mail server cannot handle an error and
returns it, the whole process will stop. If you start the container
with --restart=always the server will get back up after crashing
2024-07-21 02:29:32 -03:00
Guilherme Rugai Freire
c9f73e4a98
make mail responsive 2024-07-21 02:14:16 -03:00
Guilherme Rugai Freire
661922ce35
inbox: show mails in descending order 2024-07-21 02:06:54 -03:00
Guilherme Rugai Freire
9c600d863e
update footer position: use dvh not vh for body 2024-07-21 01:45:24 -03:00
Guilherme Rugai Freire
0027dcbc79
remove testing green background 2024-07-21 01:37:42 -03:00
Guilherme Rugai Freire
f6586852d6
make inbox responsive 2024-07-21 01:37:11 -03:00
Guilherme Rugai Freire
e9cb98eb50
make nthmail a link and addr copiable 2024-07-21 01:07:50 -03:00
Guilherme Rugai Freire
20842416b8
make index responsive 2024-07-21 00:56:37 -03:00
Guilherme Rugai Freire
9ec0af6278
add footer 2024-07-20 20:52:49 -03:00
Guilherme Rugai Freire
2ff5817490
add an optinal rcpt_addr to not delete mails 2024-07-20 00:26:12 -03:00
Guilherme Rugai Freire
a88e5e90dc
parse mail subject when receiving and saving to db
this way, when the inbox route is called, there is no need to parse all
mails neither request them from db just so it can have their subject
2024-07-18 22:10:35 -03:00
Guilherme Rugai Freire
b01e6776dc
docs: remove mail rendering problem TODO 2024-07-18 12:40:21 -03:00
Guilherme Rugai Freire
30b727b9ce
parse mail content-enconding on text/* mails
before, if the mail content-type was text, it would not consider the
content encoding, only if it was multipart.

now this step on the mail parsing is performed both on multipart mails
and in text mails
2024-07-18 12:37:19 -03:00
Guilherme Rugai Freire
444e3d877e
fix plain txt mails not parsing the mail body
the problem was that it was declared a byte array (txt) with
essentially size 0 and calling Read(txt). Since Read reads n
bytes up to sizeof(txt), nothing was being read.
2024-07-17 11:27:02 -03:00
Guilherme Rugai Freire
269c7614e1
add TODO for some mails failing to parse 2024-07-11 00:52:52 -03:00
Guilherme Rugai Freire
7999d35a32
return 404 not found on email not found, not 500 2024-07-10 23:33:10 -03:00
Guilherme Rugai Freire
117766dd64
update delete_old_mail.sh to use DB_PATH var 2024-07-10 23:22:37 -03:00
Guilherme Rugai Freire
a4efa6a35f
add dockerfile 2024-07-10 22:15:18 -03:00
Guilherme Rugai Freire
5d5ee9c531
add attachments todo 2024-07-10 19:30:19 -03:00
Guilherme Rugai Freire
2cbbc67467
update getting started docs 2024-07-10 19:19:09 -03:00
Guilherme Rugai Freire
0fcd8083ff
add todo restart server 2024-07-10 19:10:43 -03:00
Guilherme Rugai Freire
4fec4e8bd0
remove logs when receiving mails 2024-07-10 19:09:54 -03:00
Guilherme Rugai Freire
e211834d39
enable wal mode 2024-07-10 19:07:24 -03:00
Guilherme Rugai Freire
fc899da74c
add go fmt format.sh script 2024-07-10 19:01:31 -03:00
Guilherme Rugai Freire
8ef8cf75ef
sanitize html with bluemonday 2024-07-10 17:31:09 -03:00
Guilherme Rugai Freire
36f8ff684a
remove todo: "Use an DB other than sqlite"
for a small project, sqlite is a good fit
2024-07-10 17:00:16 -03:00
Guilherme Rugai Freire
48e7b5a9a5
integrate web and mail server
now, there is only one binary that starts both servers,
making them use the same SQL connection.

this commit also added some `defer tx.Commit()` to ensure
all the transactions were closed
2024-07-10 16:56:46 -03:00
Guilherme Rugai Freire
52b3fa61ca
style web pages 2024-07-10 16:02:03 -03:00
Guilherme Rugai Freire
f1190e9892
fix run-web.sh to not leave any process hanging 2024-03-19 11:47:39 -03:00
Guilherme Rugai Freire
bf21d05b6d
refactor web_server code
- Move mail functions to its own packages;
- Move bigger router functions to its own functions, and separate
  router creation from main function;
- Edit the algorithm that choses the format will be chosen with
  regards to format preference to a simples one.
2024-03-19 11:30:25 -03:00
Guilherme Rugai Freire
f547eb161e
change run-web.sh to restart to pkg/ changes 2024-03-19 11:30:10 -03:00
Guilherme Rugai Freire
5e0e362e47
add TODOs 2024-03-19 10:37:55 -03:00
Guilherme Rugai Freire
ddcf9dea62
add separate page for viewing the email 2024-03-18 15:47:15 -03:00
Guilherme Rugai Freire
3d33831803
url param to set mail format 2024-03-18 15:12:45 -03:00
Guilherme Rugai Freire
b2a85dd3f8
add MIME email rendering
This commits adds support for rendering email in text/html,
text/markdown and text/plain inside a MIME/multipart mail.

Bluemonday was added as a dependency and initialized but it is still not
used because the styling of the email is "discarted" too much. But this
needs to be fixed before going to production.
2024-03-16 18:12:06 -03:00
Guilherme Rugai Freire
f4407d71f8
render inbox as html instead of json 2024-02-20 18:02:30 -03:00
Guilherme Rugai Freire
95252f12f5
add index page and button to generate random inbox 2024-02-20 17:59:47 -03:00
Guilherme Rugai Freire
c0c1ba4c08
add to end webserver process to run-web.sh 2024-02-20 17:55:37 -03:00
Guilherme Rugai Freire
40900f3112
add templ and initial frontend code 2024-02-20 16:13:44 -03:00
Guilherme Rugai Freire
e07aeea312
add Makefile 2024-02-20 14:22:11 -03:00
Guilherme Rugai Freire
ed82c38af4
add script to delete old mail
currently, the script is hardcoded for emails older than 1 day

this is a script because it is a simple operation and probably will be
called by a cronjob
2024-02-20 02:09:46 -03:00
Guilherme Rugai Freire
4ed9c46923
add route to list rcpt_addr's mails as json 2024-02-20 01:56:39 -03:00
Guilherme Rugai Freire
43a8d7addf
remove useless port checking from mail server 2024-02-20 01:08:39 -03:00
Guilherme Rugai Freire
5767f9d594
add simple web server 2024-02-20 01:08:13 -03:00
Guilherme Rugai Freire
6e0e577916
make mail server addr and port dinamically via env 2024-02-20 00:45:32 -03:00