Commit Graph

28 Commits

Author SHA1 Message Date
22a987a513 feat(docker_container): Ensure amavis data is a volume
The amavis data is required to be kept between containers.
set '/var/lib/amavis' as a docker volume.

MR !9
2022-02-19 12:32:50 +09:30
93378dee86 fix(backup): /var/spool/postfix needs to be backed up
As this folder contains the mta folders and queue. It must be
backed up as mail could be lost that is awaiting delivery.

MR !9
2022-02-19 11:29:44 +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
fbdf6efab7 fix(file_permission): set spamd to own spamassassin folder
Folder belongs to spamd user. this was required so that amavis spam bayes learning could read the files.

MR !9
2022-02-19 10:10:46 +09:30
7f7a259a82 fix(local_group): amavis and opendkim added to vmail
users require access to vmail group data.

MR !9
2022-02-19 10:07:41 +09:30
24f10af6d6 feat(postfix): prevent anonymous users on submission
Users are required to login to send an E-Mail. Prevented
anonymous user access

MR !9
2022-02-19 09:00:10 +09:30
Jon
db03fc2efa fix(build): corrected syntax error in dockerfile
MR !8
2022-02-18 05:25:59 +00:00
4554e9e66d feat(postfix): specify my_networks as localhost ONLY
mynetworks set to only be localhost as accepted/trusted.

MR !7
2022-02-18 14:16:28 +09:30
5f7095f274 fix(postfix): only use the servers order of tls ciphers
Don't allow a client to specify which TLS ciphers to use. They may
pick a less secure one.
MR !7
2022-02-18 14:08:38 +09:30
41e03936cc feat(postfix): no compression or renegotiation
Client should not attempt to rengotiation of TLS.
MAN states that compression during tls not nessacarly benificial.

MR !7
2022-02-18 13:49:39 +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
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