<commit_before>#!/bin/bash

#judgement
if [[ -a /etc/supervisor/conf.d/supervisord.conf ]]; then
  exit 0
fi

#supervisor
cat > /etc/supervisor/conf.d/supervisord.conf <<EOF
[supervisord]
nodaemon=true

[program:postfix]
command=/opt/postfix.sh

[program:cron]
command=/usr/sbin/cron -f

[program:amavisd]
command=/usr/sbin/amavisd-new foreground

[program:spamassassin]
command=/usr/sbin/spamd --create-prefs --max-children 5 --helper-home-dir -d --pidfile=/var/run/spamd.pid

[program:rsyslog]
command=/usr/sbin/rsyslogd -n -c3
EOF

###########################
# spam and virus detection
###########################

if [[ -n "$MAIL_DOMAIN" ]]; then
  cat > /etc/mailname <<EOF
$MAIL_DOMAIN
EOF
fi

cat > /etc/default/spamassassin <<EOF
ENABLED=1
OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
PIDFILE="/var/run/spamd.pid"
CRON=1
EOF

cat > /etc/amavis/conf.d/15-content_filter_mode << EOF
use strict;
@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);

1;
EOF

cat > /etc/amavis/conf.d/50-user << EOF
use strict;
$myhostname = "$MAIL_HOSTNAME";
$final_spam_destiny  = D_PASS;  # (defaults to D_REJECT)
$sa_tag_level_deflt  = -100.0;
$sa_tag2_level_deflt = 5.0;
$sa_kill_level_deflt = 5.0;

1;<commit_msg>proper escape<commit_after>#!/bin/bash

#judgement
if [[ -a /etc/supervisor/conf.d/supervisord.conf ]]; then
  exit 0
fi

#supervisor
cat > /etc/supervisor/conf.d/supervisord.conf <<EOF
[supervisord]
nodaemon=true

[program:postfix]
command=/opt/postfix.sh

[program:cron]
command=/usr/sbin/cron -f

[program:amavisd]
command=/usr/sbin/amavisd-new foreground

[program:spamassassin]
command=/usr/sbin/spamd --create-prefs --max-children 5 --helper-home-dir -d --pidfile=/var/run/spamd.pid

[program:rsyslog]
command=/usr/sbin/rsyslogd -n -c3
EOF

###########################
# spam and virus detection
###########################

if [[ -n "$MAIL_DOMAIN" ]]; then
  cat > /etc/mailname <<EOF
$MAIL_DOMAIN
EOF
fi

cat > /etc/default/spamassassin <<EOF
ENABLED=1
OPTIONS="--create-prefs --max-children 5 --helper-home-dir"
PIDFILE="/var/run/spamd.pid"
CRON=1
EOF

cat > /etc/amavis/conf.d/15-content_filter_mode << EOF
use strict;
@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);

1;
EOF

cat > /etc/amavis/conf.d/50-user << EOF
use strict;
\$myhostname = "$MAIL_HOSTNAME";
\$final_spam_destiny  = D_PASS;  # (defaults to D_REJECT)
\$sa_tag_level_deflt  = -100.0;
\$sa_tag2_level_deflt = 5.0;
\$sa_kill_level_deflt = 5.0;

1;
{'fraction_non_alphanumeric': 0.1899099099099099, 'fraction_numerical': 0.015135135135135135, 'mean_word_length': 4.747412008281573, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1153462', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1160, 'n_words': 190}