CONFIG_PREFIX = / etc / exim
ACL_PREFIX = CONFIG_PREFIX / acls#すべてのACL設定はここに保存されます
DB_PREFIX = / var / spool / exim / db#パフォーマンスを向上させるには、tmpfsを使用することをお勧めします
#テンプレートはEximの強みであり、長い行を短い単語に簡単に置き換えることができます。
#mailmanのテンプレートを定義する
MM_HOME = / var / lib / mailman
MM_UID = mailman
MM_GID =郵便配達員
MM_WRAP = / usr / lib / mailman / mail / mailman
MM_LISTCHK = MM_HOME /リスト/ $ {lc :: $ local_part} /config.pck
ldap_default_servers = /var/run/openldap/slapd.sock:192.168.0.1#ldapサーバーへの接続方法を指定すると、2番目のサーバーがフォールバックとして使用されます。
INTERFACE = your_external_ip#Eximがハングする外部IPを指定します
BASEDN = dc =ドメイン、dc = com#basednサーバーldap
#このセクションでは、Eximロジックを定義する最も重要なテンプレートを示します
#エイリアスアドレスがエイリアスコンテナのメール属性の値と一致する場合、エイリアスをチェックします。エイリアスはVirtualMailAliasクラスにも属し、accountActive属性の値がTRUEである必要があります。
CHECK_1 = $ {lookup ldap {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = aliases、dc = domain、dc = com?Mail? sub?(&(objectClass = VirtualMailAlias)(accountActive = TRUE)(mail = $ {quote_ldap:$ local_part @ $ domain}))}}
#受信者アドレスがピープルコンテナのメール属性の値と一致するかどうかアカウントを確認します。アカウントはVirtualMailAccountクラスにも属し、accountActive属性の値がTRUEである必要があります。
CHECK_2 = $ {lookup ldap {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = people、dc = domain、dc = com?Mail? sub?(&(objectClass = VirtualMailAccount)(accountActive = TRUE)(mail = $ {quote_ldap:$ local_part @ $ domain}))}}
#停止されたアカウントを確認すると、アカウントはメールを受信できませんが、システムに残ります(産休中の従業員に関連)
CHECK_3 = $ {lookup ldap {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = people、dc = domain、dc = com?Mail? sub?(&(objectClass = VirtualMailAccount)(accountActive = TRUE)(accountSuspend = TRUE)(mail = $ {quote_ldap:$ local_part @ $ domain})}}
#メールの転送先のアライアンスメンバーのリスト、maildrop属性の値
CHECK_DATA = $ {lookup ldapm {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = aliases、dc = domain、dc = com?Maildrop? sub?(&(objectClass = VirtualMailAlias)(mail = $ {quote_ldap:$ local_part @ $ domain}))}}
#メールボックスへのパス、メールボックス属性の値
CHECK_MAILDIR = $ {lookup ldap {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = people、dc = domain、dc = com?メールボックス? sub?(&(objectClass = VirtualMailAccount)(accountActive = TRUE)(mail = $ {quote_ldap:$ local_part @ $ domain}))}}
#OoOメッセージのテキスト、vacationInfo属性の値
CHECK_VACATION = $ {lookup ldap {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = people、dc = domain、dc = com?VacationInfo? sub?(&(objectClass = VirtualMailAccount)(vacationActive = TRUE)(mail = $ {quote_ldap:$ local_part @ $ domain}))}}
#OoOメッセージのダブルコンマのハック、Eximのバグ660-修正されていないようです
VACATION = $ {sg {$ {lookup ldap {user = "uid = exim、ou = services、dc = domain、dc = com" pass = *** ldap:/// ou = people、dc = domain、dc = com?vacationInfo?sub?(&(objectClass = VirtualMailAccount)(vacationActive = TRUE)(mail = $ {quote_ldap:$ local_part @ $ domain}))}}} {,,} {、}}
domainlist_cache virt_domains = domain.com#ドメインは1つしかないため、それを示します。 多くのドメインを使用する場合は、データベースからドメインを選択するためのテンプレートを作成する必要があります。
domainlist_cache local_domains = localhost:mail.domain.com
hostlist relay_from_hosts = 127.0.0.1:192.168.0.0/16
アドレスリストnoautoreply_senders = DB_PREFIX / autoreply.noanswer.db
sender_unqualified_hosts = 127.0.0.1:192.168.0.0/16
recipient_unqualified_hosts = 127.0.0.1:192.168.0.0/16
local_interfaces = 0.0.0.0.25:0.0.0.0.26:0.0.0.0.465:0.0.0.0.587:127.0.0.1.10025
tls_on_connect_ports = 465
acl_smtp_connect = acl_check_connect
acl_smtp_helo = acl_check_helo
acl_smtp_mail = acl_check_mail
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
acl_smtp_dkim = acl_check_dkim
accept_8bitmime
auth_advertise_hosts =!127.0.0.1#ローカルホストにSMTP AUTHを提供しない
bounce_message_file = CONFIG_PREFIX / bounce.msg#バウンスメッセージの形式を指定します。これは次のとおりです。
バウンスメッセージ件名:メール配信に失敗しました$ {if eq {$ sender_address} {$ bounce_recipient} {:送信者にメッセージを返す}}
****
このメッセージは、メール配信ソフトウェアによって自動的に作成されました。
メッセージ$ {if eq {$ sender_address} {$ bounce_recipient} {送信した} {送信者
<$ sender_address>
}}をすべての受信者に配信できませんでした。
次のアドレスが失敗しました:
****
配信試行中に次のテキストが生成されました:
****
-これは、すべてのヘッダーを含むメッセージのコピーです。 -****
-メッセージの本文は$ message_size文字長です。 最初だけ
-$ return_size_limit程度がここに含まれています。
****
bounce_return_size_limit = 100K
delay_warning = 15m:1h:99d
deliver_queue_load_max = 40
disable_ipv6
exim_group = vmail#すべてのメールサービス(dovecot、spamassassin、clamavなど)が1つのgidの下で動作することが望ましい
exim_user = vmail#すべてのメールサービス(dovecot、spamassassin、clamavなど)が1つのuidで動作することが望ましい
headers_charset = UTF-8#有効にすることをお勧めします
ignore_bounce_errors_after = 0s
local_scan_timeout = 0s
message_size_limit = 50M
never_users = root
no_message_logs
no_smtp_enforce_sync
no_syslog_duplication
primary_hostname = mail.domain.com
qualify_domain = domain.com
queue_only_load = 12
queue_run_max = 5
recipients_max = 500
recipients_max_reject
remote_max_parallel = 2
return_size_limit = 10000
rfc1413_query_timeout = 0s
smtp_accept_max = 500
smtp_accept_max_per_host = 500
smtp_accept_queue = 500
smtp_accept_queue_per_connection = 1000
smtp_accept_reserve = 15
smtp_banner = $ primary_hostname ESMTP ready $ tod_full
smtp_connect_backlog = 40
smtp_load_reserve = 20
smtp_return_error_details
split_spool_directory
strip_excess_angle_brackets
strip_trailing_dot
syslog_facility = mail#ログはsyslogサービスに送信されます
syslog_processname = exim
system_filter = DB_PREFIX / exim.filter#グローバルeximフィルター、ほとんど使用しません
timeout_frozen_after = 7d
tls_advertise_hosts =!127.0.0.1#localhostにTLSを提供しない
#証明書パスを指定する
tls_certificate = /etc/exim/ssl/mail_crt_new.pem
tls_privatekey = /etc/exim/ssl/mail_key_new.pem
tls_verify_certificates = /etc/exim/ssl/ca.pem
#メールヘッダーの形式を定義する
received_header_text = "受信済み:\
$ {def def:sender_rcvhost {from INTERFACE \ n \ t} \
{$ {if def:sender_ident {from relay}} \
$ {if def:sender_helo_name {(helo = $ {sender_helo_name})\ n \ t}}}} \
$ {qualify_domain}によって\
id $ {message_id} \
$ {if def:received_for {\ n \ tfor <$ received_for>}} "
#ここではLDAPは使用されないため、ウイルス対策とスパム対策を直接接続します。すべてが標準であるため、設定を省略します。
#av_scanner = clamd:/ tmp / clamd
#spamd_address = 127.0.0.1 783
ACLを開始
#ACL設定を接続します(以下を参照)
.include ACL_PREFIX / acl_smtp
#ルーターを作成します
ルーターを開始
#送信メール用のルーター
dnslookup:
ドライバー= dnslookup
domains =!+ local_domains :! + virt_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0:127.0.0.0/8
no_more
#着信ルーター
#amavisの個人輸送(真珠の例外を1つ作成します:))
#amavis:
#ドライバー=手動ルート
#条件= $ {ifまたは{\
#{eq {$ interface_port} {10025}} \
#{eq {$ received_protocol} {spam-scanned}} \
#{eq {$ sender_address} {}} \
#{eq {$ sender_address_domain} {domain.com}} \
#{eq {$ sender_address_domain} {kaspersky.com}} \
#{eq {$ {lc:$ dkim_verify_status}} {pass}} \
#{match {$ sender_address_local_part} {-bounces}} \
#} {0} {1}}
#ドメイン= + virt_domains
#senders =!:!postmaster @ * :! mailer-daemon @ * :! nagios @ * :! monit @ *
#no_verify
#no_expn
#transport = amavis
#route_list = "* localhost byname"
#self =送信
自動応答:
ドライバー=受け入れる
ドメイン= + virt_domains
senders =!:!+ noautoreply_senders#autoreply.noanswer.dbで指定されたローカルホストと送信者に応答しない
条件= $ {ifおよび{\
{!eq {CHECK_VACATION} {}} \#テンプレート
{!match {$ h_precedence:} {junk | bulk | list}} \#ニュースレターに返信しない
{!def:header_Auto-Submitted:} \
{!def:header_List-Id:} \
}}
no_verify
no_expn
見えない
transport = auto_responder
#一時停止されたアカウント、一時停止されたアカウントの受信メールはすべて「ブラックホール」に送信されます
停止中:
ドライバー=リダイレクト
ドメイン= + virt_domains
条件= CHECK_3
forbid_file
forbid_pipe
forbid_filter_reply = true
データ=:ブラックホール:
no_more
#仮想エイリアス
エイリアス:
ドライバー=リダイレクト
ドメイン=!+ local_domains
condition = CHECK_1#ダブルチェック(acl_smtpの最初のチェック)があり、現在のアカウントにもエイリアスがある場合、より良いものは何も見つかりませんでした
forbid_file
forbid_pipe
forbid_filter_reply = true
data = CHECK_DATA#手紙の転送先
allow_fail
allow_defer
mailman_router:
ドライバー=受け入れる
ドメイン= domain.com
require_files = MM_LISTCHK#ファイルをチェックする代わりに、例えばaliasType = DL属性の値を確認できます。
local_part_suffix_optional
local_part_suffix = -admin: \
-bounces: -bounces+*: \
-confirm: -confirm+*: \
-join: -leave: \
-owner: -request: \
-subscribe: -unsubscribe
transport = mailman_transport
system_aliases:
driver = redirect
domains = +local_domains
errors_to =
no_verify
data = ${lookup{$local_part}partial0-dbm{DB_PREFIX/aliases.db}{$value}fail}
file_transport = address_file
pipe_transport = address_pipe
allow_fail
allow_defer
localuser:
driver = accept
domains = +local_domains: +virt_domains
check_local_user
transport = dovecot_lda # dovecot lda
cannot_route_message = Unknown account # Dovecot ,
no_more
###############################################################
begin transports
###############################################################
remote_smtp:
driver = smtp
helo_data = mail.domain.com
max_rcpt = 500
# DKIM
dkim_domain = domain.com
dkim_selector = dkim
dkim_private_key = DB_PREFIX/dkim.private.key
dkim_canon = relaxed
auto_responder:
driver = autoreply
from = "${local_part}@${domain}"
to = "${reply_address}"
once = "/var/spool/exim/autoreply/${local_part}@${domain}"
once_repeat = 1d # , LDAP (. phamm-vacation.schema)
headers = «Content-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit»
subject = ${rfc2047:Auto-Reply: $h_subject:}
text = VACATION # OoO
body_only
no_return_message
# dovecot
dovecot_lda:
driver = pipe
command = /usr/libexec/dovecot/dovecot-lda -f "$sender_address" -d "$local_part@$domain"
home_directory = /home/$local_part
delivery_date_add
envelope_to_add
return_path_add
log_output
log_defer_output
return_fail_output
freeze_exec_fail
temp_errors = 64: 69: 70: 71: 72: 73: 74: 75: 78
address_pipe:
driver = pipe
return_output
address_file:
driver = appendfile
current_directory = SPOOL
home_directory = SPOOL
create_directory
directory_mode = 0700
maildir_format
user = vmail
group = vmail
mode = 0600
no_check_owner
no_mode_fail_narrower
address_reply:
driver = autoreply
maillist_pipe:
driver = pipe
group = mail
return_fail_output
user = vmail
mailman_transport:
driver = pipe
command = MM_WRAP \
'${if def:local_part_suffix \
{${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{
$1}}} \
{post}}' \
$local_part
current_directory = MM_HOME
home_directory = MM_HOME
user = MM_UID
group = MM_GID
#amavis:
# driver = smtp
# port = 10024
# allow_localhost
begin retry
* quota
* rcpt_4xx senders=: F,1h,10m
* * F,2h,10m; G,16h,1h,1.5; F,4d,6h
#
begin rewrite
root@* collector@domain.com Ttbcr
# SMTP AUTH
begin authenticators
plain:
driver = plaintext
public_name = PLAIN
server_prompts =:
server_condition = "${lookup ldap{user=uid=${quote_ldap_dn:$auth2},ou=people,BASEDN pass=${quote:$auth3} \
ldap:///ou=people,BASEDN?uid?sub?(&(uid=$auth2)(objectClass=VirtualMailAccount)(accountActive=TRUE))}{yes}fail}"
server_set_id = $auth2
login:
driver = plaintext
public_name = LOGIN
server_prompts = «Username::: Password::»
server_condition = "${lookup ldap{user=uid=${quote_ldap_dn:$auth1},ou=people,BASEDN pass=${quote:$auth2} \
ldap:///ou=people,BASEDN?uid?sub?(&(uid=$auth1)(objectClass=VirtualMailAccount)(accountActive=TRUE))}{yes}fail}"
server_set_id = $auth1