RHEL8/CentOS8の標準samba 4.12では新規Active Directoryサーバの構築は非サポート?

RHEL8/CentOS8/Oracle Linux 8で用意されているsambaパッケージを使ってActive Direcotryサーバを立てることができるか確認してみた。

公式資料:[Red Hat Enterprise Linux 8 にさまざまな種類のサーバーをデプロイするためのガイド]-[第3章 SAMBA をサーバーとして使用]

まずは、パッケージのインストール

# yum install samba
<略>
# rpm -qa|grep samba
samba-libs-4.12.3-12.el8.3.x86_64
samba-common-4.12.3-12.el8.3.noarch
samba-client-libs-4.12.3-12.el8.3.x86_64
samba-common-tools-4.12.3-12.el8.3.x86_64
samba-common-libs-4.12.3-12.el8.3.x86_64
samba-4.12.3-12.el8.3.x86_64
#

で、RHEL8/CentOS8での特徴の1つ、「samba-toolが無い」問題。

じゃぁ、どうするの?と前出のマニュアル見てみれば手動で /etc/samba/smb.conf を編集している。

初期状態でどんな設定になるのか

[root@samba48 ~]# ls -l /etc/samba/
合計 20
-rw-r--r--. 1 root root    20  8月 18 05:50 lmhosts
-rw-r--r--. 1 root root   706  8月 18 05:50 smb.conf
-rw-r--r--. 1 root root 11327  8月 18 05:50 smb.conf.example
[root@samba48 ~]# cat /etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
        workgroup = SAMBA
        security = user

        passdb backend = tdbsam

        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes

[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @printadmin root
        force group = @printadmin
        create mask = 0664
        directory mask = 0775
[root@samba48 ~]#

参考まで、samba-toolsで作った場合のsmb.confは下記の様になっている。

# Global parameters
[global]
        dns forwarder = 上DNSサーバIPアドレス
        netbios name = samba48
        realm = testad2.local
        server role = active directory domain controller
        workgroup = TESTAD2
        idmap_ldb:use rfc2307 = yes
        allow dns updates = nonsecure
server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbindd, ntp_signd, kcc, dnsupdate dns
        ldap server require strong auth = no

[netlogon]
        path = /usr/local/samba/var/locks/sysvol/testad2.local/scripts
        read only = No

[sysvol]
        path = /usr/local/samba/var/locks/sysvol
        read only = No

で、[第3章 SAMBA をサーバーとして使用]を見ると、「スタンドアローンサーバとして単独WORKGROUPをたてる場合」と「既存Active Directory環境にメンバーサーバとして参加する場合」しか用意されておらず、「新規Active Directory環境を作る場合」というものが無い。

samba-toolコマンドを使用しない場合のActive Directory構築手順も見当たらないため、RHEL8/CentOS8が標準で用意しているsambaパッケージを使用しての構築はできないようだ。


CentOS8の場合「yum search samba」でパッケージ検索すると、「centos-releae-samba41?」といった追加レポジトリが出てくる。

[root@samba48 ~]# yum search samba
メタデータの期限切れの最終確認: 0:30:30 時間前の 2021年01月21日 09時31分03秒 に実施しました。
==================================== 名前 完全一致: samba ====================================
samba.x86_64 : Server and Client software to interoperate with Windows machines
================================== 名前 & 概要 一致: samba ===================================
centos-release-samba411.noarch : Samba 4.11 packages from the CentOS Storage SIG repository
centos-release-samba412.noarch : Samba 4.12 packages from the CentOS Storage SIG repository
centos-release-samba413.noarch : Samba 4.13 packages from the CentOS Storage SIG repository
ipa-client-samba.x86_64 : Tools to configure Samba on IPA client
pcp-pmda-samba.x86_64 : Performance Co-Pilot (PCP) metrics for Samba
python3-samba.i686 : Samba Python3 libraries
python3-samba.x86_64 : Samba Python3 libraries
python3-samba-test.x86_64 : Samba Python libraries
samba-client.x86_64 : Samba client programs
samba-client-libs.x86_64 : Samba client libraries
samba-client-libs.i686 : Samba client libraries
samba-common.noarch : Files used by both Samba servers and clients
samba-common-libs.x86_64 : Libraries used by both Samba servers and clients
samba-common-tools.x86_64 : Tools for Samba servers and clients
samba-krb5-printing.x86_64 : Samba CUPS backend for printing with Kerberos
samba-libs.x86_64 : Samba libraries
samba-libs.i686 : Samba libraries
samba-test.x86_64 : Testing tools for Samba servers and clients
samba-test-libs.x86_64 : Libraries need by the testing tools for Samba servers and clients
samba-winbind.x86_64 : Samba winbind
samba-winbind-clients.x86_64 : Samba winbind clients
samba-winbind-krb5-locator.x86_64 : Samba winbind krb5 locator
samba-winbind-modules.i686 : Samba winbind modules
samba-winbind-modules.x86_64 : Samba winbind modules
====================================== 名前 一致: samba ======================================
samba-pidl.noarch : Perl IDL compiler
====================================== 概要 一致: samba ======================================
ctdb.x86_64 : A Clustered Database based on Samba's Trivial Database (TDB)
[root@samba48 ~]#

centos-release-samba413をインストールしてみる

[root@samba48 ~]# yum install centos-release-samba413
メタデータの期限切れの最終確認: 1:32:19 時間前の 2021年01月21日 09時31分03秒 に実施しました。
依存関係が解決しました。
==============================================================================================
 パッケージ                            Arch           バージョン         リポジトリー   サイズ
==============================================================================================
インストール:
 centos-release-samba413               noarch         1.0-1.el8          extras         8.8 k
依存関係のインストール:
 centos-release-storage-common         noarch         2-2.el8            extras         9.4 k

トランザクションの概要
==============================================================================================
インストール  2 パッケージ

ダウンロードサイズの合計: 18 k
インストール済みのサイズ: 2.0 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/2): centos-release-samba413-1.0-1.el8.noarch.rpm           231 kB/s | 8.8 kB     00:00
(2/2): centos-release-storage-common-2-2.el8.noarch.rpm       252 kB/s | 9.4 kB     00:00
----------------------------------------------------------------------------------------------
合計                                                           31 kB/s |  18 kB     00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                      1/1
  インストール     : centos-release-storage-common-2-2.el8.noarch                         1/2
  インストール     : centos-release-samba413-1.0-1.el8.noarch                             2/2
  scriptletの実行中: centos-release-samba413-1.0-1.el8.noarch                             2/2
  検証             : centos-release-samba413-1.0-1.el8.noarch                             1/2
  検証             : centos-release-storage-common-2-2.el8.noarch                         2/2

インストール済み:
  centos-release-samba413-1.0-1.el8.noarch    centos-release-storage-common-2-2.el8.noarch

完了しました!
[root@samba48 ~]#

そうすると、インストールされていたsmba 4.12がアップデートできるようになりました

[root@samba48 ~]# yum check-update
メタデータの期限切れの最終確認: 0:02:42 時間前の 2021年01月21日 11時03分56秒 に実施しました。

libwbclient.x86_64                            4.13.3-1.el8                     centos-samba413
samba.x86_64                                  4.13.3-1.el8                     centos-samba413
samba-client-libs.x86_64                      4.13.3-1.el8                     centos-samba413
samba-common.noarch                           4.13.3-1.el8                     centos-samba413
samba-common-libs.x86_64                      4.13.3-1.el8                     centos-samba413
samba-common-tools.x86_64                     4.13.3-1.el8                     centos-samba413
samba-libs.x86_64                             4.13.3-1.el8                     centos-samba413
[root@samba48 ~]#

yum updateすると、「/sbin/ldconfig: /lib64/libsmbldap.so.2 はシンボリックリンクではありません」って出てるけど、これは大丈夫なんだろうか….

[root@samba48 ~]# yum update -y
メタデータの期限切れの最終確認: 0:03:30 時間前の 2021年01月21日 11時03分56秒 に実施しました。
依存関係が解決しました。
==============================================================================================
 パッケージ                Arch    バージョン                          リポジトリー     サイズ
==============================================================================================
アップグレード:
 libwbclient               x86_64  4.13.3-1.el8                        centos-samba413   37 k
 samba                     x86_64  4.13.3-1.el8                        centos-samba413  757 k
 samba-client-libs         x86_64  4.13.3-1.el8                        centos-samba413  5.5 M
 samba-common              noarch  4.13.3-1.el8                        centos-samba413  135 k
 samba-common-libs         x86_64  4.13.3-1.el8                        centos-samba413  124 k
 samba-common-tools        x86_64  4.13.3-1.el8                        centos-samba413  416 k
 samba-libs                x86_64  4.13.3-1.el8                        centos-samba413  110 k
依存関係のインストール:
 checkpolicy               x86_64  2.9-1.el8                           baseos           348 k
 glusterfs                 x86_64  6.0-37.2.el8                        baseos           662 k
 glusterfs-api             x86_64  6.0-37.2.el8                        appstream         95 k
 glusterfs-client-xlators  x86_64  6.0-37.2.el8                        baseos           870 k
 glusterfs-libs            x86_64  6.0-37.2.el8                        baseos           413 k
 python3-audit             x86_64  3.0-0.17.20191104git1c2f876.el8     baseos            86 k
 python3-libsemanage       x86_64  2.9-3.el8                           baseos           127 k
 python3-policycoreutils   noarch  2.9-9.el8                           baseos           2.2 M
 python3-setools           x86_64  4.3.0-2.el8                         baseos           626 k
 samba-vfs-glusterfs       x86_64  4.13.3-1.el8                        centos-samba413   40 k

トランザクションの概要
==============================================================================================
インストール    10 パッケージ
アップグレード   7 パッケージ

ダウンロードサイズの合計: 12 M
パッケージのダウンロード:
(1/17): glusterfs-api-6.0-37.2.el8.x86_64.rpm                 1.2 MB/s |  95 kB     00:00
(2/17): checkpolicy-2.9-1.el8.x86_64.rpm                      1.4 MB/s | 348 kB     00:00
(3/17): glusterfs-6.0-37.2.el8.x86_64.rpm                     2.4 MB/s | 662 kB     00:00
(4/17): python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64. 3.0 MB/s |  86 kB     00:00
(5/17): python3-libsemanage-2.9-3.el8.x86_64.rpm              3.2 MB/s | 127 kB     00:00
(6/17): glusterfs-libs-6.0-37.2.el8.x86_64.rpm                3.4 MB/s | 413 kB     00:00
(7/17): glusterfs-client-xlators-6.0-37.2.el8.x86_64.rpm      2.5 MB/s | 870 kB     00:00
(8/17): python3-setools-4.3.0-2.el8.x86_64.rpm                4.4 MB/s | 626 kB     00:00
(9/17): samba-vfs-glusterfs-4.13.3-1.el8.x86_64.rpm           253 kB/s |  40 kB     00:00
(10/17): libwbclient-4.13.3-1.el8.x86_64.rpm                  379 kB/s |  37 kB     00:00
(11/17): samba-4.13.3-1.el8.x86_64.rpm                        2.4 MB/s | 757 kB     00:00
(12/17): python3-policycoreutils-2.9-9.el8.noarch.rpm         3.9 MB/s | 2.2 MB     00:00
(13/17): samba-common-4.13.3-1.el8.noarch.rpm                 2.6 MB/s | 135 kB     00:00
(14/17): samba-common-libs-4.13.3-1.el8.x86_64.rpm            1.4 MB/s | 124 kB     00:00
(15/17): samba-common-tools-4.13.3-1.el8.x86_64.rpm           3.2 MB/s | 416 kB     00:00
(16/17): samba-libs-4.13.3-1.el8.x86_64.rpm                   1.4 MB/s | 110 kB     00:00
(17/17): samba-client-libs-4.13.3-1.el8.x86_64.rpm            5.0 MB/s | 5.5 MB     00:01
----------------------------------------------------------------------------------------------
合計                                                          4.2 MB/s |  12 MB     00:02
警告: /var/cache/dnf/centos-samba413-5ae787790677bc21/packages/samba-vfs-glusterfs-4.13.3-1.el8.x86_64.rpm: ヘッダー V4 RSA/SHA1 Signature、鍵 ID e451e5b5: NOKEY
CentOS-8 - Samba 4.13                                         1.0 MB/s | 1.0 kB     00:00
GPG 鍵 0xE451E5B5 をインポート中:
 Userid     : "CentOS Storage SIG (http://wiki.centos.org/SpecialInterestGroup/Storage) <security@centos.org>"
 Fingerprint: 7412 9C0B 173B 071A 3775 951A D4A2 E50B E451 E5B5
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
鍵のインポートに成功しました
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                      1/1
  scriptletの実行中: samba-common-4.13.3-1.el8.noarch                                     1/1
  scriptletの実行中: samba-common-4.13.3-1.el8.noarch                                    1/24
  アップグレード   : samba-common-4.13.3-1.el8.noarch                                    1/24
  scriptletの実行中: samba-common-4.13.3-1.el8.noarch                                    1/24
  アップグレード   : samba-common-libs-4.13.3-1.el8.x86_64                               2/24
  scriptletの実行中: samba-common-libs-4.13.3-1.el8.x86_64                               2/24
  アップグレード   : samba-client-libs-4.13.3-1.el8.x86_64                               3/24
  scriptletの実行中: samba-client-libs-4.13.3-1.el8.x86_64                               3/24
/sbin/ldconfig: /lib64/libsmbldap.so.2 はシンボリックリンクではありません


  アップグレード   : libwbclient-4.13.3-1.el8.x86_64                                     4/24
  アップグレード   : samba-libs-4.13.3-1.el8.x86_64                                      5/24
  scriptletの実行中: samba-libs-4.13.3-1.el8.x86_64                                      5/24
/sbin/ldconfig: /lib64/libsmbldap.so.2 はシンボリックリンクではありません


  インストール     : glusterfs-libs-6.0-37.2.el8.x86_64                                  6/24
  scriptletの実行中: glusterfs-libs-6.0-37.2.el8.x86_64                                  6/24
/sbin/ldconfig: /lib64/libsmbldap.so.2 はシンボリックリンクではありません


  scriptletの実行中: glusterfs-6.0-37.2.el8.x86_64                                       7/24
  インストール     : glusterfs-6.0-37.2.el8.x86_64                                       7/24
  scriptletの実行中: glusterfs-6.0-37.2.el8.x86_64                                       7/24
/sbin/ldconfig: /lib64/libsmbldap.so.2 はシンボリックリンクではありません


  インストール     : glusterfs-client-xlators-6.0-37.2.el8.x86_64                        8/24
  インストール     : glusterfs-api-6.0-37.2.el8.x86_64                                   9/24
  scriptletの実行中: glusterfs-api-6.0-37.2.el8.x86_64                                   9/24
/sbin/ldconfig: /lib64/libsmbldap.so.2 はシンボリックリンクではありません


  アップグレード   : samba-common-tools-4.13.3-1.el8.x86_64                             10/24
  インストール     : python3-setools-4.3.0-2.el8.x86_64                                 11/24
  インストール     : python3-libsemanage-2.9-3.el8.x86_64                               12/24
  インストール     : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64               13/24
  インストール     : checkpolicy-2.9-1.el8.x86_64                                       14/24
  インストール     : python3-policycoreutils-2.9-9.el8.noarch                           15/24
  アップグレード   : samba-4.13.3-1.el8.x86_64                                          16/24
  scriptletの実行中: samba-4.13.3-1.el8.x86_64                                          16/24
  インストール     : samba-vfs-glusterfs-4.13.3-1.el8.x86_64                            17/24
  scriptletの実行中: samba-4.12.3-12.el8.3.x86_64                                       18/24
  整理             : samba-4.12.3-12.el8.3.x86_64                                       18/24
  scriptletの実行中: samba-4.12.3-12.el8.3.x86_64                                       18/24
  整理             : samba-common-tools-4.12.3-12.el8.3.x86_64                          19/24
  整理             : samba-libs-4.12.3-12.el8.3.x86_64                                  20/24
  整理             : samba-common-libs-4.12.3-12.el8.3.x86_64                           21/24
  整理             : samba-client-libs-4.12.3-12.el8.3.x86_64                           22/24
  scriptletの実行中: libwbclient-4.12.3-12.el8.3.x86_64                                 23/24
  整理             : libwbclient-4.12.3-12.el8.3.x86_64                                 23/24
  整理             : samba-common-4.12.3-12.el8.3.noarch                                24/24
  scriptletの実行中: libwbclient-4.13.3-1.el8.x86_64                                    24/24
  scriptletの実行中: samba-vfs-glusterfs-4.13.3-1.el8.x86_64                            24/24
  scriptletの実行中: samba-common-4.12.3-12.el8.3.noarch                                24/24
  検証             : glusterfs-api-6.0-37.2.el8.x86_64                                   1/24
  検証             : checkpolicy-2.9-1.el8.x86_64                                        2/24
  検証             : glusterfs-6.0-37.2.el8.x86_64                                       3/24
  検証             : glusterfs-client-xlators-6.0-37.2.el8.x86_64                        4/24
  検証             : glusterfs-libs-6.0-37.2.el8.x86_64                                  5/24
  検証             : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64                6/24
  検証             : python3-libsemanage-2.9-3.el8.x86_64                                7/24
  検証             : python3-policycoreutils-2.9-9.el8.noarch                            8/24
  検証             : python3-setools-4.3.0-2.el8.x86_64                                  9/24
  検証             : samba-vfs-glusterfs-4.13.3-1.el8.x86_64                            10/24
  検証             : libwbclient-4.13.3-1.el8.x86_64                                    11/24
  検証             : libwbclient-4.12.3-12.el8.3.x86_64                                 12/24
  検証             : samba-4.13.3-1.el8.x86_64                                          13/24
  検証             : samba-4.12.3-12.el8.3.x86_64                                       14/24
  検証             : samba-client-libs-4.13.3-1.el8.x86_64                              15/24
  検証             : samba-client-libs-4.12.3-12.el8.3.x86_64                           16/24
  検証             : samba-common-4.13.3-1.el8.noarch                                   17/24
  検証             : samba-common-4.12.3-12.el8.3.noarch                                18/24
  検証             : samba-common-libs-4.13.3-1.el8.x86_64                              19/24
  検証             : samba-common-libs-4.12.3-12.el8.3.x86_64                           20/24
  検証             : samba-common-tools-4.13.3-1.el8.x86_64                             21/24
  検証             : samba-common-tools-4.12.3-12.el8.3.x86_64                          22/24
  検証             : samba-libs-4.13.3-1.el8.x86_64                                     23/24
  検証             : samba-libs-4.12.3-12.el8.3.x86_64                                  24/24

アップグレード済み:
  libwbclient-4.13.3-1.el8.x86_64               samba-4.13.3-1.el8.x86_64
  samba-client-libs-4.13.3-1.el8.x86_64         samba-common-4.13.3-1.el8.noarch
  samba-common-libs-4.13.3-1.el8.x86_64         samba-common-tools-4.13.3-1.el8.x86_64
  samba-libs-4.13.3-1.el8.x86_64

インストール済み:
  checkpolicy-2.9-1.el8.x86_64          glusterfs-6.0-37.2.el8.x86_64
  glusterfs-api-6.0-37.2.el8.x86_64     glusterfs-client-xlators-6.0-37.2.el8.x86_64
  glusterfs-libs-6.0-37.2.el8.x86_64    python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64
  python3-libsemanage-2.9-3.el8.x86_64  python3-policycoreutils-2.9-9.el8.noarch
  python3-setools-4.3.0-2.el8.x86_64    samba-vfs-glusterfs-4.13.3-1.el8.x86_64

完了しました!
[root@samba48 ~]#

まぁ、アップデート完了してもsamba-tool はいませんでしたけどね

[root@samba48 ~]# which samba-tool
/usr/bin/which: no samba-tool in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
[root@samba48 ~]#

というわけで、おとなしくsambaをソースからコンパイルするしかなさそうです。

Windows Liveメール2012で使えるメールサーバ設定

Windows Live メール2012で使える暗号化形式についてのまとめ

 Windows Liveメール2012Outlook 2019
POP3ポート110、暗号化なし
POP3ポート110、暗号化あり(STARTTLS)××
POP3ポート995、暗号化あり(SSL/TLS)
IMAPポート143、暗号化無し
IMAPポート143、暗号化あり(STARTTLS)×
IMAPポート993、暗号化あり(SSL/TLS)
   
SMTPポート25、暗号化なし△(非推奨)△(非推奨)
SMTPポート587、暗号化なし
SMTPポート587、暗号化STARTTLS×
SMTPポート465、暗号化SSL/TLS

SMTPのポート25は、アクセス回線(プロバイダ)側で接続規制が行われている可能性が高いので通常は使わない(使えないことが多い)
SMTPは、SMTP認証(SMTP AUTH)を有効にすること

「SMTPポート465、暗号化SSL/TLS」はSMTPS(SMTP over SSL)と表現される。最近は「SMTPポート587、暗号化STARTTLS」が主流で、ポート465を使うのは古いOutlookやWindows Liveメールぐらい。ポート465を提供しているメールサーバも徐々に減っているので、新規環境では使用しないことを推奨(ポート587に対応していないWindows Liveメールは捨てろ)

Outlook2019の注意点:暗号化を有効にした場合、サーバ側のSSL証明書の有効期限が切れると接続できなくなる。また、サーバ側のSSL証明書にサーバ名指定で使ったホスト名が登録されていないと接続できない。無視してアクセスするようなオプションがない

WindowsLiveメール/Outlookの注意点: メール送信時、送信者名の欄が空欄だと送信エラーになる。

エラー番号:0x800CCC78 で拒否される場合、サーバ名/ポート番号の指定とかに問題がある。

ありがちなのが、SMTP/IMAPの暗号化あり、設定が「SMTP/IMAPのSSL接続も可能なやつ(STARTTLS)」なのか「SMTPS/IMAPSによるSSL接続」のどちらなのか、という問題。前述のとおりWindows LiveメールやOutlook 2013などはSMTPS/IMAPSなので「SMTPS ポート465」で「IMAPS ポート993」を指定する必要がある。

Windows Live メール 2012で「メッセージを表示できませんでした」となる

注: 必要な作業は「レジストリを設定してOS再起動」です。Liveメールの設定を確認する必要はありません。設定確認はきちんとした原因調査したい場合に行う操作です。

2020/12/23追記

2020年5月リリースのWindows 10 20H2適用後、「0x800c013e 不明なエラー」というエラーで使えなくなる、という件が発生しているようで来訪が多い。

うちのテスト用Windows10はこの記事を書いた10月時点ですでにWindows 10 20H2になっており「0x800c013e 不明なエラー」が発生していました。

そこで、このページのレジストリ設定を行ったところ、Windows Liveメール2012を使ったメール送受信は可能となりました。2020/12/23時点でもIMAP/POP3メール受信,SMTPメール送信ともに出来ています。

また、エラーがでたのでメールアカウントの再設定などを試そうとしている場合の注意点があります。

Windows Liveメールはサポートが切れて数年経ちますので、各メールサーバの設定案内で記述が削除されており、他のメールソフトの設定ページにある設定を利用しているのではないかと思います。

しかし、Windows Liveメールで使えるメールサーバ設定は10年以上前のメールサーバ用の設定であり、2020年のメールサーバが備えてる設定ではアクセスができないものがあります。

詳細については「Windows Liveメール2012で使えるメールサーバ設定」を見てください。

追記終了


メールサーバを管理しているといろんなユーザがいるわけです。

とっくにサポートが切れたWindows Live メール 2012をWindows10上で使っている人、とかね。

そんな人からの問い合わせに対応するために検証用Windows10にWindows Live メールをセットアップしてみたら、メールが表示されない。

「メッセージを表示出来ませんでした」ってなんだ?

いろいろ調査してみると、[オプション]-[メール]-[詳細設定]の「メンテナンス」でどんな状態にあるか確認できるらしい(注:これは調査のための操作なので、特にやる必要はありません)

これの「トラブルシューティング」の「全般」と「メール」にチェックを入れて、「保存先フォルダー」に書かれたディレクトリにあるWindowsLiveMail.log にログが出力されるようになる。

受信トレイのメールをクリックしてみると下記の様な「Zone_MailChk ERROR: (storutil.cpp:3965), failed with 0x800C013E」などのエラーが出力される。

[15:11:00.34] 4138                 Mail:            Zone_MailChk ERROR: (msgfldr.cpp:2741), failed with 0x800C013E  
[15:11:00.34] 4138                 Mail:            Zone_MailChk ERROR: (msgfldr.cpp:905), failed with 0x800C013E  
[15:11:00.34] 4138                 Mail:            Zone_MailChk ERROR: (storutil.cpp:3965), failed with 0x800C013E  

この情報を元に検索したところ、2020/08/26付けの「Windows Live Mail」というマイクロソフトコミュニティの書き込みを発見。

レジストリエディッタで「HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows Live Mail」直下にDWORD(32bit)で3つのキーを値「1」で新規作成して、Windowsを再起動してWindows Liveメールを開き直すとメッセージが読めるようになる、と。

作成するDWORDキー
  RecreateFolderIndex
  RecreateStreamIndex
  RecreateUIDLIndex

(該当する3つのキーの値は1回Windows Liveメールを起動することで「0」に戻ります)

この手順を実施したところ、ちゃんとメッセージが読めるようになりました。

Outlook2019で iredmail(postfix/dovecot)環境を登録しようとするとエラーになる

Becky!やThunderbird、Windows Live 2012では問題なく動いていたのだが、Outlook 2019(およびOffice 365のOutlook)に対してメールを新規登録した場合、うまく動かない、というクレームがあったので調査

姉妹記事:「Windows Liveメール2012で使えるメールサーバ設定」Outlookについての言及もあり

要点

その1: SSL対応するならちゃんとすること

自己署名SSLや、メールサーバとして指定したホスト名がSSL証明書に含まれていないとエラーになる。

Let’s Encryptでやっても良いが、POP3/IMAP/SMTPサーバ名でSSL証明書が発行されていること。

その2: Outlook側の「ユーザー情報」の「名前」が空欄は不許可

ここが空欄になっていると、メール送信がエラー(エラーコード 0x800c8101) になる。

成功例:IMAP設定の場合

上記では送信サーバ(SMTP)のポートが「587」となっているが、プロバイダ側で許可されている場合はポート25でも良い。

成功例:POP3の場合

上記では送信サーバ(SMTP)のポートが「587」となっているが、プロバイダ側で許可されている場合はポート25でも良い。


エラーログ集

SMTPサーバ指定を暗号化なしに設定した場合

使用する暗号化接続の種類を「なし」に設定した場合、エラーになった

Outlook側エラー「テスト電子メール メッセージの送信: このクライアントでサポートされている認証方法が、サーバーでサポートされていません。」

サーバ側のmaillog出力

Oct 13 10:41:28 mailserver postfix/submission/smtpd[16308]: connect from test.example.com[xxx.xxx.xxx.xxx]
Oct 13 10:41:28 mailserver postfix/submission/smtpd[16308]: lost connection after EHLO from test.example.com[xxx.xxx.xxx.xxx]
Oct 13 10:41:28 mailserver postfix/submission/smtpd[16308]: disconnect from test.example.com[xxx.xxx.xxx.xxx]

SMTPサーバ指定をSSL/TLSに設定した場合

送信サーバの使用する暗号化接続の種類を「SSL/TLS」に設定した場合もエラーになった。

Outlook側のエラーメッセージ

テスト電子メール メッセージの送信: このサーバーは、指定した種類の接続暗号化をサポートしていません。暗号化方式を変更してください。詳細については、メール サーバーの管理者かインターネット サービス プロバイダー (ISP) に問い合わせてください。

メールサーバ側maillogのエラーメッセージ

Oct 13 10:46:34 mailserver postfix/submission/smtpd[18081]: connect from test.example.com[xxx.xxx.xxx.xxx]
Oct 13 10:46:34 mailserver postfix/submission/smtpd[18081]: lost connection after UNKNOWN from test.example.com[xxx.xxx.xxx.xxx]
Oct 13 10:46:34 mailserver postfix/submission/smtpd[18081]: disconnect from test.example.com[xxx.xxx.xxx.xxx]

存在しないポートを指定した場合

誤って不適切なポートを指定した場合、下記の様なエラーとなります。

テスト電子メール メッセージの送信: 送信 (SMTP) メール サーバーに接続できません。このメッセージを引き続き受信する場合は、サーバー管理者かインターネット サービス プロバイダー (ISP) に問い合わせてください。

ONTAP 9.5でsambaドメインに参加できない & ONTAP 9.7で失敗

samba 4.11.6で作ったActive DirectoryにONTAP 9.5を参加させようとするとエラーになる。

ONTAP API が失敗しました: Failed to create the Active Directory machine account "ファイルサーバ名". Reason: LDAP Error: Strong authentication is required Details: Error: Machine account creation procedure failed [ 136] Loaded the preliminary configuration. [ 215] Successfully connected to ip ADサーバIP, port 88 using TCP [ 284] Successfully connected to ip ADサーバIP, port 389 using TCP [ 308] Unable to connect to LDAP (Active Directory) service on ADサーバホスト名 (Error: Strong(er) authentication required) **[ 308] FAILURE: Unable to make a connection (LDAP (Active ** Directory):AD名), result: 7609 . (エラー:13001)

調べたところ、sambaのglobal設定で「ldap server require strong auth = no」を設定する、とのこと。

これを設定し、sambaを再起動したところ、参加できた。


ONTAP 9.7にて、上記手順を実施した上で参加を試みたところ「Unable to connect to NetLogon service on」というエラーになった。

netapp::> vserver cifs create -vserver ファイルサーバ名 -cifs-server ファイルサーバ名 -domain AD名 -ou CN=Computers -default-site "" -status-admin up -comment "" -netbios-aliases ファイルサーバ名

In order to create an Active Directory machine account for the CIFS server, you
must supply the name and password of a Windows account with sufficient
privileges to add computers to the "CN=Computers" container within the
"AD名" domain.

Enter the user name: administrator

Enter the password:

Warning: An account by this name already exists in Active Directory at
         CN=ファイルサーバ名,CN=Computers,DC=xx,DC=xx.
         If there is an existing DNS entry for the name ファイルサーバ名, it must be
         removed. Data ONTAP cannot remove such an entry.
         Use an external tool to remove it after this command completes.
         Ok to reuse this account? {y|n}: y

Error: Machine account creation procedure failed
  [    31] Loaded the preliminary configuration.
  [   107] Created a machine account in the domain
  [   108] SID to name translations of Domain Users and Admins
           completed successfully
  [   113] Modified account 'cn=ファイルサーバ名,CN=Computers,dc=xx
           =CO,dc=JP'
  [   114] Successfully connected to ip xx.xx.xx.xx, port 88 using
           TCP
  [   129] Successfully connected to ip xx.xx.xx.xx, port 464
           using TCP
  [   216] Kerberos password set for 'ファイルサーバ名$@AD名'
           succeeded
  [   216] Set initial account password
  [   223] Successfully connected to ip xx.xx.xx.xx, port 445
           using TCP
  [   274] Successfully connected to ip xx.xx.xx.xx, port 88 using
           TCP
  [   297] Successfully authenticated with DC
           adserver.AD名
  [   322] Unable to connect to NetLogon service on
           adserver.AD名 (Error:
           RESULT_ERROR_GENERAL_FAILURE)
**[   322] FAILURE: Unable to make a connection
**         (NetLogon:AD名), result: 3
  [   322] Unable to make a NetLogon connection to
           adserver.AD名 using the new machine account

Error: command failed: Failed to create the Active Directory machine account
       "ファイルサーバ名". Reason: general failure.

netapp::>

このとき「vserver cifs security show -vserver ファイルサーバ名」で確認する「SMB? Enabled for DC Connections」は下記の通り。

netapp::> vserver cifs security show -vserver ファイルサーバ名

Vserver: ファイルサーバ名

                            Kerberos Clock Skew:                   - minutes
                            Kerberos Ticket Age:                   - hours
                           Kerberos Renewal Age:                   - days
                           Kerberos KDC Timeout:                   - seconds
                            Is Signing Required:                   -
                Is Password Complexity Required:                   -
           Use start_tls for AD LDAP connection:               false
                      Is AES Encryption Enabled:               false
                         LM Compatibility Level:  lm-ntlm-ntlmv2-krb
                     Is SMB Encryption Required:                   -
                        Client Session Security:                none
                SMB1 Enabled for DC Connections:               false
                SMB2 Enabled for DC Connections:      system-default
  LDAP Referral Enabled For AD LDAP connections:               false
               Use LDAPS for AD LDAP connection:               false

netapp::>

「SMB1 Enabled for DC Connections」をtrueに変更しても状況は変わらず。

Sambaサーバの /usr/local/samba/var/log.samba を確認すると、以下の出力があった。

[2020/08/07 14:26:55.226653,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:284(dcesrv_netr_ServerAuthenticate3_helper)
  dcesrv_netr_ServerAuthenticate3_helper: schannel required but client failed to offer it. Client was ファイルサーバ名$

「schannel」というオプションが必要らしい。

Netlogon Issue “schannel required”」を参考に設定してみたところ、schannelというオプションはないというエラー…「Bug 13464 – smb.conf-configuration “server schannel = auto” needed in future versions」を見ると「server schannel = auto」が正しい模様。

/usr/local/samba/etc/smb.conf を下記の様に修正して、sambaを再起動したところ、ONTAP 9.7でのActive Directoryの参加が可能になった。

# Global parameters
[global]
        netbios name = ADサーバ名
        realm = AD名
        server role = active directory domain controller
        workgroup = AD名
        idmap_ldb:use rfc2307 = yes
        ldap server require strong auth = no
        server schannel = auto

[netlogon]
        path = /usr/local/samba/var/locks/sysvol/AD名/scripts
        read only = No

[sysvol]
        path = /usr/local/samba/var/locks/sysvol
        read only = No