プログラミング言語や環境設定を中心としたパソコン関連の技術メモです。
主にシステム開発中に調べたことをメモしています。TIPS的な位置付けで、気が向いたときにちまちま更新していきます。
Linux、「/var/log/maillog」とはなんぞや?
ちょっくらLinuxの基礎を学び直そうと思いましてね。
気になったことを取りとめもなく調べていくことにしました。

次に調べたのが「/var/log/maillog」です。

名前を見た感じ、メール関連のログだとは思いますが、
具体的に何のログなんでしょ(--?
Google先生に訊いてみますかね。

ふむふむ(--)

sendmailとかPostfixの実行ログでした\(--)/
いわゆる「MTA(メール転送エージェント)」と呼ばれているやつのログですね。

私の環境を例に説明しますが、メールの受信操作を行ってみたところ、
こんなログが記録されましたφ(--)

May 9 18:25:13 localhost courier-pop3d: Connection, ip=[::ffff:198.51.100.2]
May 9 18:25:13 localhost courier-pop3d: LOGIN, user=mail@exapmle.com, ip=[::ffff:198.51.100.2], port=[11330]
May 9 18:25:13 localhost courier-pop3d: LOGOUT, user=mail@exapmle.com, ip=[::ffff:198.51.100.2], port=[11330], top=0, retr=0, rcvd=12, sent=39, time=0

また、メールを実際に送信してみたところ、こんなログが記録されましたφ(--)

May 9 18:25:47 localhost postfix/smtpd[29248]: connect from domain.example.com[198.51.100.2]
May 9 18:25:48 localhost postfix/smtpd[29248]: 236C71294074: client=domain.example.com[198.51.100.2], sasl_method=CRAM-MD5, sasl_username=mail_to@example.com
May 9 18:25:48 localhost postfix/cleanup[29252]: 236C71294074: message-id=<20160509182545.00FC.A531EB6D@example.om>
May 9 18:25:48 localhost /usr/lib64/plesk-9.0/psa-pc-remote[1188]: handlers_stderr: SKIP
May 9 18:25:48 localhost /usr/lib64/plesk-9.0/psa-pc-remote[1188]: SKIP during call 'check-quota' handler
May 9 18:25:48 localhost postfix/qmgr[1563]: 236C71294074: from=<mail_from@example.com>, size=863, nrcpt=1 (queue active)
May 9 18:25:48 localhost postfix/smtpd[29248]: disconnect from domain.example.com[198.51.100.2]
May 9 18:25:48 localhost postfix/smtp[29255]: 236C71294074: to=<mail_to@example.com>, relay=none, delay=0.48, delays=0.23/0.01/0.23/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=example.com type=AAAA: Host not found)
May 9 18:25:48 localhost postfix/cleanup[29252]: 917321294278: message-id=<20160509092548.917321294278@example.om>
May 9 18:25:48 localhost postfix/bounce[29256]: 236C71294074: sender non-delivery notification: 917321294278
May 9 18:25:48 localhost postfix/qmgr[1563]: 917321294278: from=<>, size=2757, nrcpt=1 (queue active)
May 9 18:25:48 localhost postfix/qmgr[1563]: 236C71294074: removed
May 9 18:25:48 localhost postfix-local[29258]: postfix-local: from=MAILER-DAEMON, to=mail_to@example.com, dirname=/var/qmail/mailnames
May 9 18:25:48 localhost postfix-local[29258]: Unable to get sender domain by sender mailname
May 9 18:25:48 localhost postfix/pipe[29257]: 917321294278: to=<mail_to@example.com>, relay=plesk_virtual, delay=0.07, delays=0.01/0.01/0/0.04, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
May 9 18:25:48 localhost postfix/qmgr[1563]: 917321294278: removed

ごちゃごちゃと色々書いてありますが、取りあえずメールの送受信を行うと、ログが記録されます。
他にも、例えば、こんなログも記録されていましたφ(--)

Apr 16 12:32:47 localhost postfix/postfix-script[1991]: starting the Postfix mail system
Apr 16 12:32:47 localhost postfix/master[1997]: daemon started -- version 2.10.1, configuration /etc/postfix

見た感じ、Postfixの起動ログっぽいですね。

このように、MTAの実行ログが記録されているのが「/var/log/maillog」です。

そんな感じ\(--)/
スポンサーリンク
 
このエントリーをはてなブックマークに追加 

category:ファイル/ディレクトリ  thema:パソコンな日々 - genre:コンピュータ  Posted by ササキマコト 

  関連記事