linuxラーニング-mailメール送信(mailはメールできません)


ホスト:centos 7,
sendmailをインストールしてsendmailを起動して、普通はできて、しかし一部の学友はどうしてだめで、起動して次のような情況が現れません!では、今どうやって解決しますか.
yum install sendmail
systemctl start sendmail.service
systemctl status sendmail.service
● sendmail.service - Sendmail Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2016-05-08 12:22:58 CST; 1min 33s ago
  Process: 9727 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
  Process: 9722 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
  Process: 9720 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
 Main PID: 9730 (sendmail)
   CGroup: /system.slice/sendmail.service
           └─9730 sendmail: accepting connection

May 08 12:21:58 iZ28xev9g2sZ systemd[1]: Starting Sendmail Mail Transport Agent...
May 08 12:21:58 iZ28xev9g2sZ sendmail[9727]: My unqualified host name (iZ28xev9g2sZ) unknown; sleeping for retry
May 08 12:22:58 iZ28xev9g2sZ sendmail[9727]: unable to qualify my own domain name (iZ28xev9g2sZ) -- using short name
May 08 12:22:58 iZ28xev9g2sZ systemd[1]: PID file /run/sendmail.pid not readable (yet?) after start.
May 08 12:22:58 iZ28xev9g2sZ sendmail[9730]: starting daemon (8.14.7): SMTP+queueing@01:00:00
May 08 12:22:58 iZ28xev9g2sZ systemd[1]: Started Sendmail Mail Transport Agent.
解決方法:ホストにhostnameが設定されていません
mailはメールを送信し、デフォルトではsendmail、sendmailはメールを送信し、hostnameを設定しなければならないが、hostnameは文字列ではなく、mailなどのフォーマットの正しいドメイン名でなければならない.tome178.com
だから私たちの解決策はhostnameを修正することです.1つは一時的で、1つは永久的です.
一般的には一時的な
hostname mail.tome178.com

永続的な変更/etc/sysconfig/network
hostname=mail.tome178.com //   (    ?        ) 
実行
hostname mail.tome178.com
それからsendmailを再起動してメールを送ることができます
● sendmail.service - Sendmail Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2016-05-08 12:39:48 CST; 16min ago
  Process: 9939 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
  Process: 9933 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
  Process: 9932 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
 Main PID: 9942 (sendmail)
   CGroup: /system.slice/sendmail.service
           └─9942 sendmail: accepting connections

May 08 12:41:12 mail.tome178.com sendmail[9965]: u484fBCq009965: from=<[email protected]>, si....1]
May 08 12:41:13 mail.tome178.com sendmail[9967]: STARTTLS=client, relay=163mx01.mxmail.netease.co...256
May 08 12:41:14 mail.tome178.com sendmail[9967]: STARTTLS=client, relay=163mx03.mxmail.netease.co...256
May 08 12:41:14 mail.tome178.com sendmail[9967]: u484fBCq009965: to=<[email protected]>, ctladdr=<...74)
May 08 12:41:21 mail.tome178.com sendmail[9971]: u484fKXx009971: from=<[email protected]>, si....1]
May 08 12:41:21 mail.tome178.com sendmail[9973]: STARTTLS=client, relay=mx3.qq.com., version=TLSv...128
May 08 12:41:24 mail.tome178.com sendmail[9973]: u484fKXx009971: to=<[email protected]>, ctladdr=<r...s )
May 08 12:54:08 mail.tome178.com sendmail[9988]: u484s8IS009988: from=<[email protected]>, si....1]
May 08 12:54:09 mail.tome178.com sendmail[9990]: STARTTLS=client, relay=mx3.qq.com., version=TLSv...128
May 08 12:54:09 mail.tome178.com sendmail[9990]: u484s8IS009988: to=<[email protected]>, ctladdr=<r...s )
Hint: Some lines were ellipsized, use -l to show in full.