exim4 のインストール

Debian LS-AVL/A

残念ながら、Postfix では Debian の Postfix では、gmail を迷惑メールフィルタに使えないので、 次なる候補、sendmail ではできることがわかっていて面白く無いので、 exim4 をインストールしてみる

exim4 のインストール

root@av:~# apt-cache search exim | grep exim
exim4-base - support files for all Exim MTA (v4) packages
exim4-config - configuration for the Exim MTA (v4)
exim4-daemon-heavy-dbg - debugging symbols for the Exim MTA (v4) packages
exim4-daemon-heavy - Exim MTA (v4) daemon with extended features, including exiscan-acl
exim4-daemon-light-dbg - debugging symbols for the Exim MTA (v4) packages
exim4-daemon-light - lightweight Exim MTA (v4) daemon
exim4-dbg - debugging symbols for the Exim MTA (v4) packages
exim4-dev - header files for the Exim MTA (v4) packages
exim4 - metapackage to ease Exim MTA (v4) installation
eximon4 - monitor application for the Exim MTA (v4) (X11 interface)
exim4-doc-html - documentation for the Exim MTA (v4) in html format
exim4-doc-info - documentation for the Exim MTA (v4) in info format
gforge-mta-exim4 - collaborative development tool - mail tools (using Exim 4)
geximon - a monitor for the exim MTA
rexima - a simple ncurses/command-line mixer
sa-exim - SpamAssassin filter for Exim
root@av:~#
ストレートに exim4 をインストールすれば良いかな
root@av:~# apt-get install exim4
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-minimal python ssl-cert openssl
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  exim4-base exim4-config exim4-daemon-light libpcre3
Suggested packages:
  mail-reader eximon4 exim4-doc-html exim4-doc-info spf-tools-perl swaks
The following NEW packages will be installed:
  exim4 exim4-base exim4-config exim4-daemon-light libpcre3
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 2286 kB of archives.
After this operation, 4600 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main exim4-config all 4.72-6+squeeze2 [464 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main exim4-base armel 4.72-6+squeeze2 [1013 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main libpcre3 armel 8.02-1.1 [234 kB]
Get:4 http://ftp.jp.debian.org/debian/ squeeze/main exim4-daemon-light armel 4.72-6+squeeze2 [567 kB]
Get:5 http://ftp.jp.debian.org/debian/ squeeze/main exim4 all 4.72-6+squeeze2 [7810 B]
Fetched 2286 kB in 1s (1287 kB/s)
Preconfiguring packages ...
Selecting previously deselected package exim4-config.
(Reading database ... 12677 files and directories currently installed.)
Unpacking exim4-config (from .../exim4-config_4.72-6+squeeze2_all.deb) ...
Selecting previously deselected package exim4-base.
Unpacking exim4-base (from .../exim4-base_4.72-6+squeeze2_armel.deb) ...
Selecting previously deselected package libpcre3.
Unpacking libpcre3 (from .../libpcre3_8.02-1.1_armel.deb) ...
Selecting previously deselected package exim4-daemon-light.
Unpacking exim4-daemon-light (from .../exim4-daemon-light_4.72-6+squeeze2_armel.deb) ...
Selecting previously deselected package exim4.
Unpacking exim4 (from .../exim4_4.72-6+squeeze2_all.deb) ...
Processing triggers for man-db ...
Setting up exim4-config (4.72-6+squeeze2) ...
Adding system-user for exim (v4)
Setting up exim4-base (4.72-6+squeeze2) ...
Setting up libpcre3 (8.02-1.1) ...
Setting up exim4-daemon-light (4.72-6+squeeze2) ...
Starting MTA: exim4.
ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken ... failed!
Setting up exim4 (4.72-6+squeeze2) ...
!root@av:~#
なんか、panic してるし、、、
/var/log/exim4/paniclog は消しておく。
root@av:~# cat /var/log/exim4/paniclog
2012-02-14 23:12:12 IPv6 socket creation failed: No such file or directory
root@av:~# rm !$
rm /var/log/exim4/paniclog
root@av:~#

aliases

\ が使えるか、マニュアルを見る
root@av:~# man aliases
No manual entry for aliases
root@av:~#
がー。
設定して試してみるしかないか

exim4 の設定

dpkg-reconfigure exim4-config を実行する
root@av:~# dpkg-reconfigure exim4-config

 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Please select the mail server configuration type that best meets your     x
 x needs.                                                                    x
 x                                                                           x
 x Systems with dynamic IP addresses, including dialup systems, should       x
 x generally be configured to send outgoing mail to another machine, called  x
 x a 'smarthost' for delivery because many receiving systems on the          x
 x Internet block incoming mail from dynamic IP addresses as spam            x
 x protection.                                                               x
 x                                                                           x
 x A system with a dynamic IP address can receive its own mail, or local     x
 x delivery can be disabled entirely (except mail for root and postmaster).  x
 x                                                                           x
 x General type of mail configuration:                                       x
 x                                                                           x
 x       internet site; mail is sent and received directly using SMTP        x
 x       mail sent by smarthost; received via SMTP or fetchmail              x
 x       mail sent by smarthost; no local mail                               x
 x       local delivery only; not on a network                               x
 x       no configuration at this time                                       x
 x                                                                           x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

internet site を選択
 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x The 'mail name' is the domain name used to 'qualify' mail addresses       x
 x without a domain name.                                                    x
 x                                                                           x
 x This name will also be used by other programs. It should be the single,   x
 x fully qualified domain name (FQDN).                                       x
 x                                                                           x
 x Thus, if a mail address on the local host is foo@example.org, the         x
 x correct value for this option would be example.org.                       x
 x                                                                           x
 x This name won't appear on From: lines of outgoing messages if rewriting   x
 x is enabled.                                                               x
 x                                                                           x
 x System mail name:                                                         x
 x                                                                           x
 x yamasita.jp______________________________________________________________ x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

もちろん yamasita.jp
 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Please enter a semicolon-separated list of IP addresses. The Exim SMTP    x
 x listener daemon will listen on all IP addresses listed here.              x
 x                                                                           x
 x An empty value will cause Exim to listen for connections on all           x
 x available network interfaces.                                             x
 x                                                                           x
 x If this system only receives mail directly from local services (and not   x
 x from other hosts), it is suggested to prohibit external connections to    x
 x the local Exim daemon. Such services include e-mail programs (MUAs)       x
 x which talk to localhost only as well as fetchmail. External connections   x
 x are impossible when 127.0.0.1 is entered here, as this will disable       x
 x listening on public network interfaces.                                   x
 x                                                                           x
 x IP-addresses to listen on for incoming SMTP connections:                  x
 x                                                                           x
 x _________________________________________________________________________ x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

空白を指定

 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Please enter a semicolon-separated list of recipient domains for which    x
 x this machine should consider itself the final destination. These domains  x
 x are commonly called 'local domains'. The local hostname (av) and          x
 x 'localhost' are always added to the list given here.                      x
 x                                                                           x
 x By default all local domains will be treated identically. If both         x
 x a.example and b.example are local domains, acc@a.example and              x
 x acc@b.example will be delivered to the same final destination. If         x
 x different domain names should be treated differently, it is necessary to  x
 x edit the config files afterwards.                                         x
 x                                                                           x
 x Other destinations for which mail is accepted:                            x
 x                                                                           x
 x yamasita.jp______________________________________________________________ x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

yamasita.jp を指定
lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Please enter a semicolon-separated list of recipient domains for which    x
 x this system will relay mail, for example as a fallback MX or mail         x
 x gateway. This means that this system will accept mail for these domains   x
 x from anywhere on the Internet and deliver them according to local         x
 x delivery rules.                                                           x
 x                                                                           x
 x Do not mention local domains here. Wildcards may be used.                 x
 x                                                                           x
 x Domains to relay mail for:                                                x
 x                                                                           x
 x _________________________________________________________________________ x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

なし
 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Please enter a semicolon-separated list of IP address ranges for which    x
 x this system will unconditionally relay mail, functioning as a smarthost.  x
 x                                                                           x
 x You should use the standard address/prefix format (e.g. 194.222.242.0/24  x
 x or 5f03:1200:836f::/48).                                                  x
 x                                                                           x
 x If this system should not be a smarthost for any other host, leave this   x
 x list blank.                                                               x
 x                                                                           x
 x Machines to relay mail for:                                               x
 x                                                                           x
 x 192.168.0.0/16___________________________________________________________ x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

192.168.0.0/16 を指定
  lqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
  x                                                                          x
  x In normal mode of operation Exim does DNS lookups at startup, and when   x
  x receiving or delivering messages. This is for logging purposes and       x
  x allows keeping down the number of hard-coded values in the               x
  x configuration.                                                           x
  x                                                                          x
  x If this system does not have a DNS full service resolver available at    x
  x all times (for example if its Internet access is a dial-up line using    x
  x dial-on-demand), this might have unwanted consequences. For example,     x
  x starting up Exim or running the queue (even with no messages waiting)    x
  x might trigger a costly dial-up-event.                                    x
  x                                                                          x
  x This option should be selected if this system is using Dial-on-Demand.   x
  x If it has always-on Internet access, this option should be disabled.     x
  x                                                                          x
  x Keep number of DNS-queries minimal (Dial-on-Demand)?                     x
  x                                                                          x
  x                    <Yes>                       <No>                      x
  x                                                                          x
  mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

No を指定
 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Exim is able to store locally delivered email in different formats. The   x
 x most commonly used ones are mbox and Maildir. mbox uses a single file     x
 x for the complete mail folder stored in /var/mail/. With Maildir format    x
 x every single message is stored in a separate file in ~/Maildir/.          x
 x                                                                           x
 x Please note that most mail tools in Debian expect the local delivery      x
 x method to be mbox in their default.                                       x
 x                                                                           x
 x Delivery method for local mail:                                           x
 x                                                                           x
 x                     mbox format in /var/mail/                             x
 x                     Maildir format in home directory                      x
 x                                                                           x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

mbox を選択
 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x                                                                           x
 x The Debian exim4 packages can either use 'unsplit configuration', a       x
 x single monolithic file (/etc/exim4/exim4.conf.template) or 'split         x
 x configuration', where the actual Exim configuration files are built from  x
 x about 50 smaller files in /etc/exim4/conf.d/.                             x
 x                                                                           x
 x Unsplit configuration is better suited for large modifications and is     x
 x generally more stable, whereas split configuration offers a comfortable   x
 x way to make smaller modifications but is more fragile and might break if  x
 x modified carelessly.                                                      x
 x                                                                           x
 x A more detailed discussion of split and unsplit configuration can be      x
 x found in the Debian-specific README files in /usr/share/doc/exim4-base.   x
 x                                                                           x
 x Split configuration into small files?                                     x
 x                                                                           x
 x                    <Yes>                       <No>                       x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

No を指定
 lqqqqqqqqqqqqqqqqqqqqqqqu Mail Server configuration tqqqqqqqqqqqqqqqqqqqqqqqk
 x Mail for the 'postmaster', 'root', and other system accounts needs to be  x
 x redirected to the user account of the actual system administrator.        x
 x                                                                           x
 x If this value is left empty, such mail will be saved in /var/mail/mail,   x
 x which is not recommended.                                                 x
 x                                                                           x
 x Note that postmaster's mail should be read on the system to which it is   x
 x directed, rather than being forwarded elsewhere, so (at least one of)     x
 x the users listed here should not redirect their mail off this machine. A  x
 x 'real-' prefix can be used to force local delivery.                       x
 x                                                                           x
 x Multiple user names need to be separated by spaces.                       x
 x                                                                           x
 x Root and postmaster mail recipient:                                       x
 x                                                                           x
 x yasunari_________________________________________________________________ x
 x                                                                           x
 x                    <Ok>                        <Cancel>                   x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
yasunari を指定
Stopping MTA for restart:.
Restarting MTA: exim4.
root@av:~#

軽くテスト

yasunari@av:~$ Mail yasunari
Subject: test to yasunari
test to yasunari
EOT
yasunari@av:~$
yasunari@av:~$ Mail
Heirloom mailx version 12.4 7/29/08.  Type ? for help.
"/var/mail/yasunari": 1 message 1 new
>N  1 Yasunari Yamashita Tue Feb 14 23:42   20/665   test to yasunari
? 1
Message  1:
From yasunari @ yamasita.jp Tue Feb 14 23:42:27 2012
Return-path: 
Envelope-to: yasunari @ yamasita.jp
Delivery-date: Tue, 14 Feb 2012 23:42:27 +0900
Date: Tue, 14 Feb 2012 23:42:27 +0900
To: yasunari @ yamasita.jp
Subject: test to yasunari
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: Yasunari Yamashita 
Status: R

test to yasunari

? d
? q
yasunari@av:~$
外にも送ってみる
yasunari@av:~$ mail foo@gmail.com
Subject: test to gmail
test to gmail
EOT
yasunari@av:~$
ログは、
root@av:~# cd /var/log/exim4/
root@av:/var/log/exim4# tail mainlog
2012-02-14 23:41:49 End queue run: pid=12581
2012-02-14 23:42:27 1RxJaN-0003H2-G3 <= yasunari @ yamasita.jp U=yasunari P=local S=496
2012-02-14 23:42:27 1RxJaN-0003H2-G3 => yasunari  R=local_user T=mail_spool
2012-02-14 23:42:27 1RxJaN-0003H2-G3 Completed
2012-02-14 23:45:26 1RxJdG-0003HO-Ro <= yasunari @ yamasita.jp U=yasunari P=local S=504
2012-02-14 23:45:29 1RxJdG-0003HO-Ro => foo @ gmail.com R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [74.125.53.27] X=TLS1.0:RSA_ARCFOUR_SHA1:16 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2012-02-14 23:45:29 1RxJdG-0003HO-Ro Completed
2012-02-14 23:46:35 1RxJeM-0003HU-Vj <= yasunari @ yamasita.jp U=yasunari P=local S=504
2012-02-14 23:46:36 1RxJeM-0003HU-Vj => foo @ gmail.com R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [74.125.53.27] X=TLS1.0:RSA_ARCFOUR_SHA1:16 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2012-02-14 23:46:36 1RxJeM-0003HU-Vj Completed
root@av:/var/log/exim4#
行けてそう

aliases の確認

root@av:~# vi /etc/aliases
root@av:~# cat !$
cat /etc/aliases
bin: \root
root: yasunari
root@av:~# newaliases
root@av:~#
この設定で、bin 宛にメールを送ると、 root で止まってくれるといいのだが。。。
yasunari@av:~$ mail bin
Subject: test to bin
test to bin
EOT
yasunari@av:~$ Mail
Heirloom mailx version 12.4 7/29/08.  Type ? for help.
"/var/mail/yasunari": 1 message 1 new
>N  1 Yasunari Yamashita Tue Feb 14 23:52   20/640   test to bin
? 1
Message  1:
From yasunari @ yamasita.jp Tue Feb 14 23:52:13 2012
Return-path: 
Envelope-to: bin @ yamasita.jp
Delivery-date: Tue, 14 Feb 2012 23:52:13 +0900
Date: Tue, 14 Feb 2012 23:52:13 +0900
To: bin @ yamasita.jp
Subject: test to bin
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: Yasunari Yamashita 
Status: R

test to bin

? d
? q
yasunari@av:~$

exim4 よ、お前もか!

exim4 のアンインストール

さいなら
root@av:~# dpkg -P exim4
(Reading database ... 12893 files and directories currently installed.)
Removing exim4 ...
Purging configuration files for exim4 ...
root@av:~# dpkg -l | grep exim
ii  exim4-base                      4.72-6+squeeze2              support files for all Exim MTA (v4) packages
ii  exim4-config                    4.72-6+squeeze2              configuration for the Exim MTA (v4)
ii  exim4-daemon-light              4.72-6+squeeze2              lightweight Exim MTA (v4) daemon
root@av:~# dpkg -P exim4-base exim4-config exim4-daemon-light
(Reading database ... 12890 files and directories currently installed.)
Removing exim4-daemon-light ...
Stopping MTA: exim4_listener.
Purging configuration files for exim4-daemon-light ...
Removing exim4-base ...
Purging configuration files for exim4-base ...
Removing exim4-config ...
Purging configuration files for exim4-config ...
dpkg-statoverride: warning: No override present.
Processing triggers for man-db ...
root@av:~#



LS-AVL/A
楽天市場
Amazon
uWorks
ValuMore
Yahoo!ショッピング


Postfix のアンインストール
ハックの記録
LinkStation/玄箱 をハックしよう

sendmail のインストール

Copyright (C) 2003-2012 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市