Commit Graph

33 Commits

Author SHA1 Message Date
9f7ccabfa5 feat(amavis): don't allow user to send banned email
This configuration blocks the user from sending an email that w
would otherwise be blocked. in this instance the user is notified.

MR !9
2022-02-19 12:23:20 +09:30
c3739c4f19 feat(amavis): Don't allow user to send spam/virus
With this configuration if the user attempts to send spam or a
virus, the message will be quarantined and the user will be
notified of the issue.

MR !9
2022-02-19 12:16:20 +09:30
f6b7bae3eb feat(amavis): move policy bank to own config file
MR !9
2022-02-19 12:14:58 +09:30
7ec9750216 feat(amavis): Add received header to message
For tracing purposes, added the amavis received header to the message.

MR !9
2022-02-19 11:47:04 +09:30
e9fb4123e9 fix(dovecot): sieve extensions debug error.
Sieve extensions set to:
    -vacation
        Remove vaction extension as this has the potential to leak to
        external users. this could be re-enabled if it could be blocked
        from leaving the server and only being available within the
        same domain
    -enotify
        Remove enotify extension as this has the potential to leak to
        external users. this could be re-enabled if it could be blocked
        from leaving the server and only being available within the
        same domain
    -editheader
        editheader disabled, as the user should not be able to edit
        message headers as this could remove message validity.
    imap4flags
        Enable imap4flags so that the user can flag messages as they
        desire.

MR !9
2022-02-19 11:02:36 +09:30
2a222df778 feat(ssl_tls): updated dovecot and postfix accepted ciphers
used https://ssl-config.mozilla.org/ to generate recommended
ciphers config for dovecot and postfix.

postfix set to use medium ciphers due to possibility of smtp
servers not being updated to latest.

MR !9
2022-02-19 10:41:53 +09:30
396cb15add feat(dovecot): Disable SSL/TLS protocol logging
Disabled due to no actual output being useful. if required by an
end user, they can enable.

MR !9
2022-02-19 10:16:40 +09:30
e9718c97a6 fix(cron): sa-learn must run as spamd user
MR !9
2022-02-19 10:12:26 +09:30
274ade2d84 feat(dovecot): log SSL/TLS porotocol errors
Visibility is required to view and fault find SSL/TLS errors.

MR !9
2022-02-19 08:50:01 +09:30
478336ca68 feat(dovecot): log failed authentication attempts
Visibility is required for failed authentication attempts. Provides
an ability to use fail2ban and to fault find an end user auth issue.

MR !9
2022-02-19 08:49:06 +09:30
3120ecf2f5 fix(logrotate): ensure log rotate runs
Deleted the standard logrotate job from cron.daily and created
a new cron job to force run logrotate at `00:01`

MR !7
2022-02-18 13:46:27 +09:30
6625d72a48 fix(logrotate): don't specify log extension
MR !7
2022-02-18 13:42:00 +09:30
edadc4779e fix(dovecot): ensure quota syntax is correct
removed extra brace left from previous quota fix commit.

MR !7
2022-02-18 13:15:35 +09:30
b3d80b41ca fix(mailbox_quota): ensure user quota visible.
Mail quota was not visible in Thunderbird. bug was havinf two
`quota =` rules. adjusted to `quota2=` for shared quota to diplay,
however, had no effect in display shared quota.

Disabled shared in the meantime.

MR !7
2022-02-18 13:11:20 +09:30
4c37932bf7 feat(submission): check user quota recipient restriction
Check the users quota before accepting the mail for delivery.
If the user belongs to the server, the user wont send the message,
nor save it for it only to be rejected at a later stage.

Current rules and order as follows:
    1. reject_non_fqdn_recipient
        Require recipient to be in FQDN format so the message can
        be routed.
    2. reject_unknown_recipient_domain
        Prevent mail from being sent to a random location that can't
        be found.
    3. check_policy_service,unix:private/quota
        If the mail is for a local user and their mailbox is full, reject
        the mail.
        This allows the sender not to recieve a bounce message for
        a message that wasn't actually sent.
    4. permit_sasl_authenticated
        A user of the mail server can send E-Mail to anyone as long as
        it passes the filters above.
    5. reject
        Reject any further mail, as they clearly are not a user of the
        mail server.

MR !7
2022-02-18 13:11:20 +09:30
1b168f07d5 feat(postfix): enforce SMTPD recipient restrictions
Filter mail based on recipient restrictions. default is to filter then
reject the remaining.

This is a default rule and submission requires it's own rule specified.

rules and order as follows:
    1. permit_mynetworks
        Allow local mail host to send to whomever.
    2. reject_non_fqdn_recipient
        must use a FQDN so that the recipient can be identified.
    3. reject_unknown_recipient_domain
        Only accept mail for the domains we host.
    4. reject_unauth_destination
        reject mail for domains we don't host and before any policy
        checks are done. This prevents additional processes from
        spawning that would otherwise be unused.
    5. check_policy_service,unix:private/policyd-spf
        bounce the mail that fails spf check. likely to be a non-smtp
        server.
    6. check_policy_service unix:private/quota
        Check the recipients quota before delivery. if fails, bounce
        the mail.
    7. permit_auth_destination
        Only accept mail for domains we host. This rule placed after
        the bounces, so that filtering can be done first.
    8. reject
        Hard reject as the recipient doesn't belong to this host.

MR !7
2022-02-18 12:09:20 +09:30
8f938bd3ce feat(quota_status): use a unix socket for postfix
There is no requirement to open an additional port so that postfix can
can check the dovecot quota.

The socket is created in postfix's service directory with dovecot as the
owner and vmail as the group. setting it this way enables ls command to
display who the owner is for debugging purposes.
Postfix is a member of group vmail.

MR !7
2022-02-18 11:35:06 +09:30
Jon
bde6c054bb refactor: conf config values updated
To fail a message for spf policy, `fail` is the value not false.

MR !6
2022-02-17 03:52:02 +00:00
92e4e4b2d5 feat(amavis): added DKIM verification
DKIM varification added to amavis milter.

MR !6
2022-02-17 12:37:12 +09:30
245aa724d2 feat(spf): conduct spf check for inbound smtp
NOTE: currently a failed SPF check does not block the message.
currently set to add header for testing purposes.

MR !6
2022-02-17 12:13:41 +09:30
53e0cdd171 refactor(amavis): move dkim key config to own file
using a seperate file for the DKIM key configuration enables the user
to easily configure with their settings.

MR !4
2022-02-16 14:17:26 +09:30
b795fe5b67 feat(posfix): configure submission to dkim sign
All E-Mail submission (tcp/587) will be dkim signed if the domain is
matched in the amavis config '90-dkim'

MR !2
2022-02-16 10:42:31 +09:30
b9b2527a42 feat(amavis): Configured dkim
Default config is for domain example.org, which
is the testing domain.

User will be required to customise '90-dkim' with thier
own domain configuration, including generating dkim signing certificates.

MR !2
2022-02-16 10:36:47 +09:30
d8e51085a1 refactor(amavis): seperate config for socket
added the socket config to it's own file for clarity and to distinguish
a custom change from default.

MR !2
2022-02-16 10:34:23 +09:30
09aabeb68a refactor(ssl): Moved /ssl to /certs
As this directory not only contains the SSL Certs,
the dkim certs as well, renamed to make more sense.

MR !2
2022-02-16 10:29:21 +09:30
1fe3598a54 fix(fetchmail): fix cron job so it runs
the command was set to echo instead of run.

MR !1
2022-02-14 10:15:08 +09:30
eb43442bb7 refactor: cron out to /dev/null
MR !1
2022-02-14 10:14:32 +09:30
5ec218dad9 feat(sa-learn): Added cron script to learn spam/ham
Script checks user inbox and spam to learn what is/isn't spam.

MR !1
2022-02-14 09:55:19 +09:30
ace2493f66 feat(fetchmail): added fetchmail
cron job to run fetchmail script to get fetchmail config from roundcube
mysql database.

MR !1
2022-02-14 09:53:57 +09:30
a7c1ae052c feat(backup): Added backup cron and helper script.
Backs up all of the data to the /backup dir.

MR !1
2022-02-14 09:51:20 +09:30
4db1b34d38 feat(amavis): added amavis and configured spam
Spamassassin added as spam filter.

MR !1
2022-02-14 09:49:31 +09:30
df8997f07d feat: Added Dovecot and Postfix to container
Initial config also added.

MR !1
2022-02-14 09:45:18 +09:30
ec9e329956 build(docker): base image added
Setup dockerfile with base components.

MR !1
2022-02-14 09:26:19 +09:30