Debian

debian buster exim4 主機名 –fqdn 沒有返回完全限定名稱

  • November 29, 2021

我正在執行 debian buster,並讓 exim4 從 apt-listchanges 傳遞本地郵件。這有效,但我得到了錯誤

alex@Taomon:~$ LANG=C
alex@Taomon:~$ systemctl status exim4
* exim4.service - LSB: exim Mail Transport Agent
  Loaded: loaded (/etc/init.d/exim4; generated)
  Active: active (running) since Mon 2021-11-29 10:51:40 CET; 5h 36min ago
    Docs: man:systemd-sysv-generator(8)
 Process: 1299 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS)
   Tasks: 1 (limit: 4340)
  Memory: 5.7M
  CGroup: /system.slice/exim4.service
          `-1571 /usr/sbin/exim4 -bd -q30m

Nov 29 10:51:40 Taomon systemd[1]: Starting LSB: exim Mail Transport Agent...
Nov 29 10:51:40 Taomon exim4[1299]: Starting MTA:hostname --fqdn did not return a fully qualified name, dc_minimaldns will not
Nov 29 10:51:40 Taomon exim4[1299]: work. Please fix your /etc/hosts setup.
Nov 29 10:51:40 Taomon exim4[1299]:  exim4.
Nov 29 10:51:40 Taomon systemd[1]: Started LSB: exim Mail Transport Agent.
alex@Taomon:~$ 

多年來,我閱讀了一些方面,但從未理解解決它。我試過不止一次

dpkg-reconfigure exim4-config 

一些我希望相關資訊

alex@Taomon:~$ cat /etc/hostname 
Taomon
alex@Taomon:~$ 

   root@Taomon:~# hostnamectl status
      Static hostname: Taomon
            Icon name: computer-laptop
              Chassis: laptop
           Machine ID: 84876d350fa0dd8b520fd47e0000000b
              Boot ID: 0144c780c7d747de92e1fbb41b1b506e
     Operating System: Debian GNU/Linux 10 (buster)
               Kernel: Linux 4.19.0-18-amd64
         Architecture: x86-64
   root@Taomon:~# 

在地址測試模式下,Exim 在這裡很長

注意 exim 正確發送了我的郵件。但是這個錯誤讓我很緊張。差點忘了

root@Taomon:~# cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   Taomon

#PS4 einbinden

#172.16.0.2      PS4

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
root@Taomon:~# 

你必須更換線路

127.0.1.1   Taomon

/etc/hosts

127.0.1.1  taomon.example.com taomon

從手冊頁

設置 FQDN 的推薦方法是使用 /etc/hosts、DNS 或 NIS 使主機名成為完全限定名稱的別名。例如,如果主機名是“ursula”,則可能在 /etc/hosts 中有一行內容為

          127.0.1.1    ursula.example.com ursula

引用自:https://unix.stackexchange.com/questions/679534