我试图实现一个反垃圾邮件解决方案,并根据我在这里得到的建议,从回答我的其他问题,我决定选择sendmail+mimedefang+spamassassin。
但目前我遇到了非常简单的权限问题:
我已经尝试过以下解决这个问题的方法:
你能提出其他解决办法吗?在与权限相关的sendmail或mimedefang中是否有可用的选项?
发布于 2011-03-04 09:19:38
每当需要进程以另一个用户的身份运行(smmsp、smmta等)时,Sendmail都会以root和叉的形式运行。因此,是的,运行它作为根,并确保您正在运行的最新版本。如果您想以非根用户的身份运行sendmail,请将该用户作为defang组的一部分。注意,defang组也具有套接字上的读取权限。
编辑:(在阅读了下面的注释之后),使套接字组在启动milter之前适当地读-写你必须使用umask (参见提供的链接中的Notes部分)。
发布于 2016-10-09 20:20:26
在我的例子中,我不需要设置umask来创建套接字。我只需要使用与sendmail (RunAsUid
,RunAsGid
)相同的用户和组运行opendkim,并使用带有600
权限(S_IRUSR|S_IWUSR
)的套接字目录。
您可以在sendmail源代码1中检查它:
errno = safefile(colon, RunAsUid, RunAsGid, RunAsUserName, sff,
S_IRUSR|S_IWUSR, NULL);
...
else if (errno != 0)
{
/* if not safe, don't create */
save_errno = errno;
if (tTd(64, 5))
sm_dprintf("X%s: local socket name %s unsafe\n",
m->mf_name, colon);
/*
** SAFEFILE -- return 0 if a file exists and is safe for a user.
**
** Parameters:
** fn -- filename to check.
** uid -- user id to compare against.
** gid -- group id to compare against.
** user -- user name to compare against (used for group
** sets).
** flags -- modifiers:
** SFF_MUSTOWN -- "uid" must own this file.
** SFF_NOSLINK -- file cannot be a symbolic link.
** mode -- mode bits that must match.
** st -- if set, points to a stat structure that will
** get the stat info for the file.
**
** Returns:
** 0 if fn exists, is owned by uid, and matches mode.
** An errno otherwise. The actual errno is cleared.
**
** Side Effects:
** none.
*/
int
safefile(fn, uid, gid, user, flags, mode, st)
1:ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.15.2.tar.gz
https://serverfault.com/questions/242817
复制相似问题