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.
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
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
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.
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
- 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.
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.
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
there is no current need to have a separate table for keeping track of
the inboxes, since all emails are getting stored upon arrival and anyone
can access all mails from any rcpt address.
also, added a arrived_at column, as a utc unix timestamp. This serves
the obvious reason to have a ts on an email, but also allows this
service to delete old mail.