Zeal Blog - 泽欧里
WWW Zeal Blog
梦想 就像鸡蛋
要么孵化 要么臭掉

RunAsUser for MSP ignored 错误

Posted by zeal on 2007-01-19 16:12 , 2010 characters |  + 0 - 0   English
转载请保留本行原始链接信息 : http://www.zeali.net/entry/477 MADE 1n ZEAL
标签 ( 开发/理论 ):  ,  , 

sendmail 不知道啥时候又不工作了,上次是 unknown user smmsp ,这回是 RunAsUser for MSP ignored

WARNING: RunAsUser for MSP ignored, check group ids (egid=502, want=51)
can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

据说是因为 sendmail 有时候会在对用户/组名进行对应的时候出错,所以需要把 /etc/mail/submit.cf 里面缺省的配置行

O RunAsUser=smmsp

改成直接使用 smmsp 对应的用户/组 ID的形式:

O RunAsUser=51:51

照方抓药,结果是错误依旧。看来这个问题应该是老版本 sendmail 的问题 ... OrZ

Google 来 Google 去,终于找到个新鲜的说法

It would be worth a careful examination of ${SOURCE}/sendmail/SECURITY,
especially the recommended perms :

--- begin quote ---
-r-xr-sr-x root  smmsp ... /PATH/TO/sendmail
drwxrwx--- smmsp smmsp ... /var/spool/clientmqueue
drwx------ root  wheel ... /var/spool/mqueue
-r--r--r-- root  wheel ... /etc/mail/sendmail.cf
-r--r--r-- root  wheel ... /etc/mail/submit.cf


[Notice: On some OS "wheel" is not used but "bin" or "root" instead,
however, this is not important here.]

That is, the owner of sendmail is root, the group is smmsp, and the binary
is set-group-ID. The client mail queue is owned by smmsp with group smmsp
and is group writable. The client mail queue directory must be writable by
smmsp, but it must not be accessible for others. That is, do not use world
read or execute permissions. In submit.cf the option UseMSP must be set,
and QueueFileMode must be set to 0660
.
--- end quote ---

检查下来,clientmqueuemqueue 目录的权限都没问题,唯独 sendmail 的主程序经过了几次 link :

which sendmail
/usr/sbin/sendmail    -> /etc/alternatives/mta
/etc/alternatives/mta -> /usr/sbin/sendmail.sendmail

而这个 /usr/sbin/sendmail.sendmail 的权限竟然是

-rwxr-xr-x  1 root root ... /usr/sbin/sendmail.sendmail

于是

chown root.smmsp /usr/sbin/sendmail.sendmail
chmod g+s /usr/sbin/sendmail.sendmail
/etc/init.d/sendmail stop
/etc/init.d/sendmail start

再尝试发邮件,搞定。

This Entry was Last Modified on 2007-05-28 14:56
对于这篇日志有什么看法?我想听听您的高见:
您也可以在页面底部的 Google Friend Connect 工具栏进行评论,体验更好的互动交流 »
首先为了证明您不是没有思想的机器Spammer,请告诉我 4 + 8 =
然后任选以下两种方式之一告诉我您的身份:
1. 使用您的 OpenID
2. 使用传统留言格式
(必填) 名字
如何称呼您?
(选填) URL
在此填写您的 Blog / Homepage 的地址,我将非常乐于访问
(选填) Email
Email地址将在经过防SPAM处理后显示在页面。如果您不希望公开自己的Email,请略过此栏
并写下您的见解:
(由于需要进行SPAM过滤,如果评论提交速度慢请耐心等待)
(所有URL都会加 nofollow 标记,保证不被搜索引擎收录,请SEOers不要白费力气)
记住我?

  如何进行评论                   当有新回复时给我发送邮件通知
除了 <b> 和 <i> 之外,其他的HTML标签都将从您的评论中去除. URL 或 Email 地址会被自动加上链接.
当您点击发表或者预览之后,系统会自动保存您此次评论的内容,以便当网络原因发表失败时直接按Ctrl-V重新粘贴上次评论内容。
注意:快捷键及自动拷贝功能仅对IE浏览器有效。
没有评论.
日志存档
2010年
2009年
2008年
2007年
2006年
本 Blog 原创内容
遵循以下授权:

Creative Commons
(创作共用) CC

署名-非商业性
-相同方式分享
Zeal Blog 基于
Powered byPivot - 1.24.1: 'Arcee'
Pivot1.24.1
开发
Launched @
2005-04-27
 里,居也。——《说文》    里,邑也。——《尔雅》。李注:“居之邑也。”RSS Feed (Entries) | Back To Home | All Links | zbird.com | 沪ICP备05024379号