No meu caso, não precisei definir umask para criar um soquete. Eu só preciso executar o opendkim com o mesmo usuário e grupo que o sendmail ( RunAsUid
, RunAsGid
) e ter o diretório usado para o soquete com 600
permission ( S_IRUSR|S_IWUSR
).
Você pode verificar isso no sendmail sources [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