Commit Graph

18 Commits

Author SHA1 Message Date
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
f636c45681 test: add netstat to docker container for debugging
MR !7
2022-02-18 13:11:20 +09:30
f90daea454 feat(postfix): enforce only reaying mail for auth destination
Mail server should only relay mail for domains and users it hosts. default is to reject.

Rules and order as follows:
    1. reject_non_fqdn_recipient
        Require the recipient to be in FQDN format for relaying
        and routing reasons including locating user.
    2. permit_auth_destination
        Only accept mail to be routed if authorized.
    3. reject
        Don't accept any further mail for relaying.

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
58f42a7913 feat(postfix): Enforce SMTPD sender restrictions
Default is to accept all mail from sender after filtering.

smtpd_sender_restrictions rules and order are as follows:
    1. permit_mynetworks
        permit my network (localhost). Placed first as sometimes the
        sender will not be a FQDN sender. (i.e. cron)
    2. reject_non_fqdn_sender
        bounce mail where sender not in format of FQDN.
    3. reject
        Reject all remaining senders

MR !7
2022-02-18 11:58:59 +09:30
8c68163e9d feat(postfix): introduce smtpd helo restrictions
Default is permit.
Rule order as follows:
    1. permit_mynetworks
        My network (localhost) is exempt from restriction
    2. reject_invalid_helo_hostname
        Don't allow a connection from an invalid host.
    3. permit
        Allow the remaining hosts not booted.

MR !7
2022-02-18 11:45:43 +09:30
64258f2cd8 feat(postfix): enforce smtpd client restrictions
Default is reject.
order of rules as follows:
    1. reject_unauth_destination
        if postfix doesn't own the destination, bounce
    2. reject_unauth_pipelining
        not punch through commands.
    3. permit_mynetworks,
        set as rule 3 after the above rejects, so that if a rouge
        process on the server attempts to send, it is blocked.
    4. permit_auth_destination,
        Only accept a connection if the mailserver is the destination.
    5. reject
        Reject all remaining mail as it's clearly not for this host.

MR !7
2022-02-18 11:42:32 +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
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
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
72ee475be7 feat(dkim): Added OpenDKIM to image
OpenDKIM is required to sign the emails.

MR !2
2022-02-16 10:26:50 +09:30
f80c02ba15 ci(build): Added docker container build job
Builds the container and pushes to local gitlab registry

MR !1
2022-02-14 14:30:54 +09:30
3601d90aef fix(script): group-mailbox script must be executable
MR !1
2022-02-14 10:02:38 +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