When sendmail is sent on a new server, the system finds that the email is not successfully sent, and checks the log file to find the following error (Notice: due to the involvement of the company server, mailbox, etc, the following hostname, email address, and other information are replaced by xxx)
tail -40 /var/log/maillog
May 15 09:43:38 xxxxx sendmail [9182]: s4F1hcQe009182: from = root, size = 58269, class = 0, nrcpts = 1, msgid = <201405150143. s4F1hcQe009182 @ xxxx>, relay = root @ localhost
May 15 09:43:38 xxxxx sendmail [9182]: s4F1hcQe009182: to = konglb @ xxxx, delay = 00:00:00, mailer = esmtp, pri = 88269, dsn = 4.4.3, stat = queued
May 15 09:43:58 xxxxx sendmail [9186]: NOQUEUE: SYSERR (oracle): can not chdir (/var/spool/mqueue/): Permission denied
This problem occurs because the permission configuration for (/var/spool/mqueue/) is incorrect. sendmail does not have the permission to access this directory. Execute the following command to solve the problem.
Chmod 755/var/spool/mqueue
When testing again, the following error is found, and the mail status is always queued. The error message is as follows:
May 15 10:21:41 xxxxx sendmail[9850]: s4F2LfrT009850: to=<konglb@xxxx>, delay=00:00:00, mailer=esmtp, pri=37549, dsn=4.4.3, stat=queued
This problem occurs because the dns server is incorrectly set. You need to modify the nameserver value in the configuration file/etc/resolv. conf.