概要[edit]

リンク[edit]

インストール[edit]

Berkeley DBのコンパイル[edit]

# cd build_unixenter.png
# ../dist/configureenter.png
# makeenter.png

smmspユーザーがいなければ追加する[edit]

smmsp -c 'Sendmail Submission User' -d /var/spool/clientmqueue -s /sbin/nologin

設定[edit]

$ vi devtools/Site/site.config.m4enter.png
APPENDDEF(`confMAPDEF', `-DNEWDB') ←Berkeley DB をサポート
APPENDDEF(`confLIBS', `-L../../../db-2.7.7/build_unix -ldb')
APPENDDEF(`confINCDIRS', `-I/usr/local/include')
APPENDDEF(`confLIBDIRS', `-L/usr/local/lib')

コンパイルとインストール[edit]

$ ./Build -center.png
# ./Build installenter.png

設定[edit]

sendmail.cfの作成[edit]

作成方法[edit]

# cd cf/cfenter.png
# cp generic-linux.mc sendmail.mcenter.png
# vi sendmail.mcenter.png
(編集する)
# ./Build sendmail.cfenter.png sendmail.cfの作成
# ./Build install-cfenter.png sendmail.cfとsubmit.cfを/etc/mailにコピー

プライバシーフラグ[edit]

define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn')dnl
O PrivacyOptions=authwarnings,novrfy,noexpn

全てのメールを特定のSMTPサーバに転送する(local配送は行う)[edit]

define(`SMART_HOST', `point.plala.jp')dnl
DSmmr.point.plala.jp

全てのメールを特定のSMTPサーバに転送する[edit]

FEATURE(`nullclient', `mmr.plala.or.jp')dnl

送信を許可/拒否するIPアドレスを指定する[edit]

FEATURE(`access_db',`hash -o /etc/mail/access.db')dnl
C{Accept}OK RELAY
Kaccess hash -T<TMPF>  -o /etc/mail/access.db

FromのドメインがDNSに登録されていなくても転送を許可[edit]

FEATURE(`accept_unresolvable_domains')dnl

メッセージの最大サイズ[edit]

define(`confMAX_MESSAGE_SIZE',`10485760')dnl
O MaxMessageSize=10485760

ヘッダーの最大サイズ[edit]

define(`confMAX_HEADERS_LENGTH', `32768')dnl
O MaxHeadersLength=32768

リターンメールを返すまでの時間[edit]

define(`confTO_QUEUERETURN', `5d')dnl
O Timeout.queuereturn=5d

警告メールを返すまでの時間[edit]

define(`confTO_QUEUEWARN', `4h')dnl
O Timeout.queuewarn=4h

sendmail.cfの解説[edit]

コマンド意味説明
Vversionsendmailのバージョン
Cclassクラスマクロを定義
Ffileファイルやパイプからのクラスマクロを定義
Dマクロを定義
Ooptionオプションを定義
K
T
H
P
# level 10 config file format
V10/Berkeley バージョン

# override file safeties - setting this option compromises system security,
# addressing the actual file configuration problem is preferred
# need to set this before any file actions are encountered in the cf file
#O DontBlameSendmail=safe

# default LDAP map specification
# need to set this now before any LDAP maps are defined
#O LDAPDefaultSpec=-h localhost

##################
#   local info   #
##################

# my LDAP cluster
# need to set this before any LDAP lookups are done (including classes)
#D{sendmailMTACluster}$m

Cwlocalhost "w"クラスに"localhost"を入れる
# file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names "w"クラスに"/etc/mail/local-host-names"の内容を入れる

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM

# host/domain names ending with a token in class P are canonical
CP.

# "Smart" relay host (may be null)
DS


# operators that cannot be in local usernames (i.e., network indicators)
CO @ % !

# a class with just dot (for identifying canonical names)
C..

# a class with just a left bracket (for identifying domain literals)
C[[

# Resolve map (to check if a host exists in check_mail)
Kresolve host -a<OKR> -T<TEMP>
C{ResOk}OKR "ResOk"クラスに"OKR"を入れる

# Hosts for which relaying is permitted ($=R)
FR-o /etc/mail/relay-domains "R"クラスに"/etc/mail/relay-domains"を入れる?

# arithmetic map
Karith arith

# dequoting map
Kdequote dequote

# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
C{E}root "E"クラスに"root"を入れる

# my name for error messages
DnMAILER-DAEMON "n"マクロに"MAILER-DAEMON"を入れる

CPREDIRECT "P"クラスに"REDIRECT"を入れる

# Configuration version number
DZ8.13.5 "Z"マクロに"8.13.5"を入れる

###############
#   Options   #
###############

# strip message body to 7 bits on input?
O SevenBitInput=False "SevenBitInput"オプションに"False"を入れる

# wait for alias file rebuild (default units: minutes)
O AliasWait=10

# location of alias file
O AliasFile=/etc/mail/aliases

# minimum number of free blocks on filesystem
O MinFreeBlocks=100

# substitution for space (blank) characters
O BlankSub=.

# avoid connecting to "expensive" mailers on initial submission?
O HoldExpensive=False

# default delivery mode
O DeliveryMode=background

# temporary file mode
O TempFileMode=0600

# location of help file
O HelpFile=/etc/mail/helpfile

# deliver MIME-encapsulated error messages?
O SendMimeErrors=True

# Forward file search path
O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward

# open connection cache size
O ConnectionCacheSize=2

# open connection cache timeout
O ConnectionCacheTimeout=5m

# use Errors-To: header?
O UseErrorsTo=False

# log level
O LogLevel=9

# verify RHS in newaliases?
O CheckAliases=False

# default messages to old style headers if no special punctuation?
O OldStyleHeaders=True

# SMTP daemon options
O DaemonPortOptions=Name=MTA
O DaemonPortOptions=Port=587, Name=MSA, M=E

# privacy flags
O PrivacyOptions=authwarnings

# queue directory
O QueueDirectory=/var/spool/mqueue

O Timeout.queuereturn=5d
O Timeout.queuewarn=4h

# queue up everything before forking?
O SuperSafe=True

# status file
O StatusFile=/var/log/sendmail.st

# SMTP initial login message (old $e macro)
O SmtpGreetingMessage=$j Sendmail $v/$Z; $b

# UNIX initial From header format (old $l macro)
O UnixFromLine=From $g $d

# delimiter (operator) characters (old $o macro)
O OperatorChars=.:%@!^/[]+

############################
# QUEUE GROUP DEFINITIONS  #
############################


###########################
#   Message precedences   #
###########################

Pfirst-class=0
Pspecial-delivery=100
Plist=-30
Pbulk=-60
Pjunk=-100

#####################
#   Trusted users   #
#####################

# this is equivalent to setting class "t"
#Ft/etc/mail/trusted-users
Troot
Tdaemon
Tuucp

#########################
#   Format of headers   #
#########################

H?P?Return-Path: <$g>
HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
        $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
        $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
        (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${ve
rify})$.$?u
        for $u; $|;
        $.$b
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: $?x$x <$g>$|$g$.
H?F?From: $?x$x <$g>$|$g$.
H?x?Full-Name: $x
# HPosted-Date: $a
# H?l?Received-Date: $b
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>

設定ファイルの作成[edit]

/etc/mail/local-host-names[edit]

# vi local-host-namesenter.png
point.plala.jp

/etc/mail/aliases.db[edit]

# vi aliasesenter.png
# Basic system aliases -- these MUST be present.
MAILER-DAEMON:  postmaster
postmaster:     root

# General redirections for pseudo accounts.
bin:            root
daemon:         root
games:          root
ingres:         root
nobody:         root
system:         root
toor:           root
uucp:           root

# Well-known aliases.
manager:        root
dumper:         root
operator:       root

# trap decode to catch security attacks
decode:         root

# Person who should get root's mail
root:           ham
# makemap hash aliases < aliasesenter.png

/etc/mail/access.db[edit]

# cd /etc/mailenter.png
# vi accessenter.png
localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
192.168.0                       RELAY
# makemap hash access < accessenter.png

/etc/mail/relay-domains[edit]

Hosts for which relaying is permitted ($=R)



/etc/mail/domaintable[edit]

Domain table (adding domains)



/etc/mail/genericstable[edit]

Generics table (mapping outgoing addresses)



/etc/mail/mailertable[edit]

Mailer table (overriding domains)



/etc/mail/virtusertable[edit]

Virtual user table (maps incoming users)



sendmail[edit]

オプション意味説明
-bmbackground mailメールを配送する、submit.cfを利用(デフォルト)
-bdbackground daemonデーモンモードで起動し、25/tcpをListenする
-bpbackground queueキューのリストを表示する(=mailq)
-q[time]queueキューにあるメッセージを送信する
timeを指定すると一定時間ごとに処理を繰り返す(単位にh,m,sを設定可能)

/var/spool/mail/df*[edit]

/var/spool/mail/qf*[edit]

V8 sendmailのバージョン
T1143325192 キューが生成された時間
K1143451286 最後に処理された時間
N71 試行回数
P6336269 優先度
I116/131078/1486886 dfファイルのiノード
MDeferred: Connection timed out with mail2.6996.jp キューに入った原因
Frs
$_localhost
$r
$slocalhost
${daemon_flags}
SMAILER-DAEMON
MDeferred: Connection timed out with mail2.6996.jp
rRFC822; root@ns.6996.jp
RPF:<root@ns.6996.jp>
H?P?Return-Path: <g> 以下ヘッダ情報
H??Received: from localhost (localhost)
        by ns.6996.jp (8.13.5/8.13.5) id k2PM8KM5053217;
        Sun, 26 Mar 2006 07:19:52 +0900 (JST)
H?D?Date: Sun, 26 Mar 2006 07:19:52 +0900 (JST)
H?F?From: foo@6996.jp
H?M?Message-Id: <200603252219.k2PM8KM5053217@mail.6996.jp>
H??To: <bar@6996.jp>
H??MIME-Version: 1.0
H??Content-Type: text/plain; charset="ISO-2022-JP"
H??Subject: mail subject
. qfファイルのEOFマーク

/var/spool/mail/xf*[edit]


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2020-07-08 (水) 18:10:14