<commit_before>#
# Cookbook Name:: postfix-dovecot
# Recipe:: postfix-full
#
# Copyright 2013, Onddo Labs, Sl.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package 'postfix-mysql'

tables_path = "#{node['postfix']['base_dir']}/tables"
# check if we can get the tables path from the postfixadmin cookbook
if node['postfixadmin'] and node['postfixadmin']['map_files'] and node['postfixadmin']['map_files']['path']
  tables_path = node['postfixadmin']['map_files']['path']
end

#
# master.cf
#

#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
node.default['postfix']['master']['inet:submission'] = {
  'command' => 'smtpd',
  'private' => false,
  'args' => [
    '-o syslog_name=postfix/submission',
    '-o smtpd_tls_security_level=encrypt',
    '-o smtpd_sasl_auth_enable=yes',
    '-o smtpd_client_restrictions=permit_sasl_authenticated,reject',
    '-o milter_macro_daemon_name=ORIGINATING'
  ],
}

#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
node.default['postfix']['master']['inet:smtps'] = { 
  'command' => 'smtpd',
  'private' => false,
  'args' => [
    '-o syslog_name=postfix/smtps',
    '-o smtpd_tls_wrappermode=yes',
    '-o smtpd_sasl_auth_enable=yes',
    '-o smtpd_client_restrictions=permit_sasl_authenticated,reject',
    '-o milter_macro_daemon_name=ORIGINATING',
  ],  
}

#dovecot   unix  -       n       n       -       -       pipe
#  flags=DRhu user=vmail:vmail argv=/usr/bin/spamc -e /usr/lib/dovecot/deliver -f {sender} -d ${recipient}
node.default['postfix']['master']['dovecot'] = { 
  'command' => 'pipe',
  'unpriv' => false,
  'chroot' => false,
  'args' => [
    "flags=DRhu user=#{node['postfix-dovecot']['vmail']['user']}:#{node['postfix-dovecot']['vmail']['group']} argv=/usr/bin/spamc -e /usr/lib/dovecot/deliver -f {sender} -d ${recipient}",
  ],  
}

#
# main.cf
#

node.default['postfix']['main']['mynetworks'] = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128'
node.default['postfix']['main']['recipient_delimiter'] = '+'
node.default['postfix']['main']['alias_maps'] = 'hash:/etc/aliases'
node.default['postfix']['main']['alias_database'] = 'hash:/etc/aliases'

node.default['postfix']['main']['smtpd_banner'] = '$myhostname ESMTP $mail_name'
node.default['postfix']['main']['biff'] = false
node.default['postfix']['main']['append_dot_mydomain'] = 'no'
node.default['postfix']['main']['readme_directory'] = false
node.default['postfix']['main']['smtpd_helo_required'] = true
<commit_msg>removed empty whitespaces at the EOL<commit_after>#
# Cookbook Name:: postfix-dovecot
# Recipe:: postfix-full
#
# Copyright 2013, Onddo Labs, Sl.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package 'postfix-mysql'

tables_path = "#{node['postfix']['base_dir']}/tables"
# check if we can get the tables path from the postfixadmin cookbook
if node['postfixadmin'] and node['postfixadmin']['map_files'] and node['postfixadmin']['map_files']['path']
  tables_path = node['postfixadmin']['map_files']['path']
end

#
# master.cf
#

#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
node.default['postfix']['master']['inet:submission'] = {
  'command' => 'smtpd',
  'private' => false,
  'args' => [
    '-o syslog_name=postfix/submission',
    '-o smtpd_tls_security_level=encrypt',
    '-o smtpd_sasl_auth_enable=yes',
    '-o smtpd_client_restrictions=permit_sasl_authenticated,reject',
    '-o milter_macro_daemon_name=ORIGINATING'
  ],
}

#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
node.default['postfix']['master']['inet:smtps'] = {
  'command' => 'smtpd',
  'private' => false,
  'args' => [
    '-o syslog_name=postfix/smtps',
    '-o smtpd_tls_wrappermode=yes',
    '-o smtpd_sasl_auth_enable=yes',
    '-o smtpd_client_restrictions=permit_sasl_authenticated,reject',
    '-o milter_macro_daemon_name=ORIGINATING',
  ],
}

#dovecot   unix  -       n       n       -       -       pipe
#  flags=DRhu user=vmail:vmail argv=/usr/bin/spamc -e /usr/lib/dovecot/deliver -f {sender} -d ${recipient}
node.default['postfix']['master']['dovecot'] = {
  'command' => 'pipe',
  'unpriv' => false,
  'chroot' => false,
  'args' => [
    "flags=DRhu user=#{node['postfix-dovecot']['vmail']['user']}:#{node['postfix-dovecot']['vmail']['group']} argv=/usr/bin/spamc -e /usr/lib/dovecot/deliver -f {sender} -d ${recipient}",
  ],
}

#
# main.cf
#

node.default['postfix']['main']['mynetworks'] = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128'
node.default['postfix']['main']['recipient_delimiter'] = '+'
node.default['postfix']['main']['alias_maps'] = 'hash:/etc/aliases'
node.default['postfix']['main']['alias_database'] = 'hash:/etc/aliases'

node.default['postfix']['main']['smtpd_banner'] = '$myhostname ESMTP $mail_name'
node.default['postfix']['main']['biff'] = false
node.default['postfix']['main']['append_dot_mydomain'] = 'no'
node.default['postfix']['main']['readme_directory'] = false
node.default['postfix']['main']['smtpd_helo_required'] = true

{'fraction_non_alphanumeric': 0.16791869200176757, 'fraction_numerical': 0.008248637501841214, 'mean_word_length': 4.5473856209150325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7185521', 'n_tokens_mistral': 2544, 'n_tokens_neox': 2474, 'n_words': 461}