<commit_before># Copyright © 2017 Feature.su. All rights reserved. 
# Licensed under the Apache License, Version 2.0 

# /etc/postfix/mydomains.list - list mail domains
# /etc/postfix/virtual - list map mail->user

if [ ! -f /etc/postfix/mydomains.list ]; then
    yum -y install postfix
    sed -i "s/\#myhostname = host.domain.tld/myhostname = `hostname`/g" /etc/postfix/main.cf
    sed -i "s/inet_interfaces = localhost/inet_interfaces = all/g" /etc/postfix/main.cf
    sed -i "s/mydestination = \$myhostname, localhost.\$mydomain, localhost/mydestination = \$myhostname, localhost/g" /etc/postfix/main.cf
    sed -i "s/\#home_mailbox = Maildir\//home_mailbox = Maildir\//g" /etc/postfix/main.cf
    sed -i "s/\#mynetworks = 192.168.127.12\/28, 127.0.0.0\/8/mynetworks = 127.0.0.0\/8/g" /etc/postfix/main.cf
    echo "" >> /etc/postfix/main.cf
    echo "message_size_limit = 10485760" >> /etc/postfix/main.cf
    echo "mailbox_size_limit = 1073741824" >> /etc/postfix/main.cf
    echo "smtpd_sasl_type = dovecot" >> /etc/postfix/main.cf
    echo "smtpd_sasl_path = private/auth" >> /etc/postfix/main.cf
    echo "smtpd_sasl_auth_enable = yes" >> /etc/postfix/main.cf
    echo "smtpd_sasl_security_options = noanonymous" >> /etc/postfix/main.cf
    echo "smtpd_sasl_local_domain = \$myhostname" >> /etc/postfix/main.cf
    echo "smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject" >> /etc/postfix/main.cf
    echo -n "" > /etc/postfix/mydomains.list
    chmod 600 /etc/postfix/mydomains.list
    postmap /etc/postfix/virtual
    echo "virtual_alias_domains = /etc/postfix/mydomains.list" >> /etc/postfix/main.cf
    echo "virtual_alias_maps = hash:/etc/postfix/virtual" >> /etc/postfix/main.cf
    systemctl restart postfix
    systemctl enable postfix
    
    yum -y install dovecot
    sed -i "s/\#protocols = imap pop3 lmtp/protocols = imap pop3 lmtp/g" /etc/dovecot/dovecot.conf
    sed -i "s/\#listen = \*, \:\:/listen = */g" /etc/dovecot/dovecot.conf
    sed -i "s/\#disable_plaintext_auth = yes/disable_plaintext_auth = no/g" /etc/dovecot/conf.d/10-auth.conf
    sed -i "s/auth_mechanisms = plain/auth_mechanisms = plain login/g" /etc/dovecot/conf.d/10-auth.conf
    sed -i "s/\#mail_location = /mail_location = maildir:\~\/Maildir/g" /etc/dovecot/conf.d/10-mail.conf
    sed -i "s/\# Postfix smtp-auth/\# Postfix smtp-auth\nunix_listener \/var\/spool\/postfix\/private\/auth \{\nmode = 0666\nuser = postfix\ngroup = postfix\n\}\n/g" /etc/dovecot/conf.d/10-master.conf
    systemctl restart dovecot
    systemctl enable dovecot
    
    firewall-cmd --zone=public --permanent --add-service=smtp
    firewall-cmd --zone=public --permanent --add-service=imap
    firewall-cmd --reload
    
    echo "[postfix]" >>  /etc/fail2ban/jail.d/customisation.local
    echo "enabled = true" >>  /etc/fail2ban/jail.d/customisation.local<commit_msg>Add smtps<commit_after># Copyright © 2017 Feature.su. All rights reserved. 
# Licensed under the Apache License, Version 2.0 

# /etc/postfix/mydomains.list - list mail domains
# /etc/postfix/virtual - list map mail->user

if [ ! -f /etc/postfix/mydomains.list ]; then
    yum -y install postfix
    sed -i "s/\#myhostname = host.domain.tld/myhostname = `hostname`/g" /etc/postfix/main.cf
    sed -i "s/inet_interfaces = localhost/inet_interfaces = all/g" /etc/postfix/main.cf
    sed -i "s/mydestination = \$myhostname, localhost.\$mydomain, localhost/mydestination = \$myhostname, localhost/g" /etc/postfix/main.cf
    sed -i "s/\#home_mailbox = Maildir\//home_mailbox = Maildir\//g" /etc/postfix/main.cf
    sed -i "s/\#mynetworks = 192.168.127.12\/28, 127.0.0.0\/8/mynetworks = 127.0.0.0\/8/g" /etc/postfix/main.cf
    echo "" >> /etc/postfix/main.cf
    echo "message_size_limit = 10485760" >> /etc/postfix/main.cf
    echo "mailbox_size_limit = 1073741824" >> /etc/postfix/main.cf
    echo "smtpd_sasl_type = dovecot" >> /etc/postfix/main.cf
    echo "smtpd_sasl_path = private/auth" >> /etc/postfix/main.cf
    echo "smtpd_sasl_auth_enable = yes" >> /etc/postfix/main.cf
    echo "smtpd_sasl_security_options = noanonymous" >> /etc/postfix/main.cf
    echo "smtpd_sasl_local_domain = \$myhostname" >> /etc/postfix/main.cf
    echo "smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject" >> /etc/postfix/main.cf
    echo -n "" > /etc/postfix/mydomains.list
    chmod 600 /etc/postfix/mydomains.list
    postmap /etc/postfix/virtual
    echo "virtual_alias_domains = /etc/postfix/mydomains.list" >> /etc/postfix/main.cf
    echo "virtual_alias_maps = hash:/etc/postfix/virtual" >> /etc/postfix/main.cf
    sed -i "s/#smtps/smtps/g" /etc/postfix/master.cf
    systemctl restart postfix
    systemctl enable postfix
    
    yum -y install dovecot
    sed -i "s/\#protocols = imap pop3 lmtp/protocols = imap pop3 lmtp/g" /etc/dovecot/dovecot.conf
    sed -i "s/\#listen = \*, \:\:/listen = */g" /etc/dovecot/dovecot.conf
    sed -i "s/\#disable_plaintext_auth = yes/disable_plaintext_auth = no/g" /etc/dovecot/conf.d/10-auth.conf
    sed -i "s/auth_mechanisms = plain/auth_mechanisms = plain login/g" /etc/dovecot/conf.d/10-auth.conf
    sed -i "s/\#mail_location = /mail_location = maildir:\~\/Maildir/g" /etc/dovecot/conf.d/10-mail.conf
    sed -i "s/\# Postfix smtp-auth/\# Postfix smtp-auth\nunix_listener \/var\/spool\/postfix\/private\/auth \{\nmode = 0666\nuser = postfix\ngroup = postfix\n\}\n/g" /etc/dovecot/conf.d/10-master.conf
    systemctl restart dovecot
    systemctl enable dovecot
    
    firewall-cmd --zone=public --permanent --add-service=smtp
    firewall-cmd --zone=public --permanent --add-service=smtps
    firewall-cmd --zone=public --permanent --add-service=imaps
    firewall-cmd --reload
    
    echo "[postfix]" >>  /etc/fail2ban/jail.d/customisation.local
    echo "enabled = true" >>  /etc/fail2ban/jail.d/customisation.local
{'fraction_non_alphanumeric': 0.15232459847844462, 'fraction_numerical': 0.023668639053254437, 'mean_word_length': 3.1486676016830293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6261668', 'n_tokens_mistral': 2411, 'n_tokens_neox': 2276, 'n_words': 400}