sendmail 오류 'can not chdir(/var/spool/clientmqueue/): Permission denied' 해결 방법은?
💡 요약 정리
- 센드메일 메일발송 시 /var/log/maillog에 Permission denied 에러가 발생하는 경우가 있습니다
- sendmail.sendmail 파일과 clientmqueue 디렉토리의 권한 설정이 올바르지 않아 발생합니다
- chown과 chmod 명령으로 올바른 소유권과 허가권을 설정하면 해결됩니다
센드메일로 메 일발송시 /var/log/maillog에 위와 같이 에러가 뜨는 경우가 있습니다.
발생에러: sendmail can not chdir(/var/spool/clientmqueue/): Permission denied
1. 정상적인 권한 설정
/usr/sbin/sendmail.sendmail 파일이 아래와 같은 소유권과 허가권으로 설정되어 있어야 정상입니다.
[root@test spool]# ll /usr/sbin/sendmail.sendmail
-rwxr-sr-x 1 root smmsp 788K Mar 15 2007 /usr/sbin/sendmail.sendmail
[root@test spool]# stat -c %a /usr/sbin/sendmail.sendmail
2755
[root@test spool]# ll /var/spool
drwxrwx--- 2 smmsp smmsp 4096 Jan 3 05:02 clientmqueue
[root@test spool]# ll /var/spool/clientmqueue/
total 168
-rw-rw---- 1 smmsp smmsp 1395 Oct 22 15:00 dfr9M60dCd002438
-rw-rw---- 1 smmsp smmsp 20389 Oct 22 15:00 dfr9M60X8b013086
-rw-rw---- 1 smmsp smmsp 58561 Oct 22 15:12 dfr9M6C9fU010033
-rw-rw---- 1 smmsp smmsp 58566 Oct 22 15:16 dfr9M6GhB0016834
-rw-rw---- 1 smmsp smmsp 803 Oct 22 15:00 Qfr9M60dCd002438
-rw-rw---- 1 smmsp smmsp 772 Oct 22 15:00 Qfr9M60X8b013086
-rw-rw---- 1 smmsp smmsp 772 Oct 22 15:12 Qfr9M6C9fU010033
-rw-rw---- 1 smmsp smmsp 776 Oct 22 15:16 Qfr9M6GhB0016834
[root@test spool]# stat -c %a /var/spool/clientmqueue/
770
2. 권한 설정 방법
해당오류 수정을 위한 권한설정방법
[root@test spool]# chown root.smmsp /usr/sbin/sendmail.sendmail
[root@test spool]# chmod 2755 /usr/sbin/sendmail.sendmail
[root@test spool]# chown -R smmsp.smmsp /var/spool/clientmqueue
[root@test spool]# chmod 770 /var/spool/clientmqueue
3. 메일 발송 테스트
권한설정후 메일발송테스트
[root@test spool]# mail serverhosting@cafe24.com
Subject: test
.
Cc:
Null message body; hope that's ok
메일발송로그확인시 정상적으로 메일 발송되는것을 확인하실수 있습니다.
[root@test spool]# tail -f /var/log/maillog
Jan 3 10:55:55 test sendmail[10014]: 33A003086FA: to=<serverhosting@cafe24.com>, relay=mail.simplexi.com[203.231.63.10]:25, delay=0.53, delays=0.04/0/0.46/0.03, dsn=2.0.0, status=sent (250 2.0.0 s031tvjg022897 Message accepted for delivery)
문제가 해결되지 않았나요?
궁금하신 사항은 언제든지 1:1 문의게시판으로 문의해 주세요.
문의 시 포함 정보:
- 카페24 아이디
- 서비스 ID: 서버호스팅 서비스 ID
- 에러 로그: /var/log/maillog의 에러 메시지
- 현재 권한 설정: ll /usr/sbin/sendmail.sendmail 및 ll /var/spool/clientmqueue/ 결과