sendmail – Warning: RunAsUser for MSP ignored, check group ids

Every time that I sent an email with an user, the system was displaying the message that could not chdir to the mail directory. I solved following the steps below:

user@linux:~ $ mail blackhole@domain.com
Subject: Test
Sending email to test
.
Cc:
user@linux:~ $ WARNING: RunAsUser for MSP ignored, check group ids (egid=503, want=51)
can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

The group ID 503 was from the user that was logged in and sending the mail. The problem in this system was that it needed setgid set in the sendmail binary file.

root@linux:~ # ls -l /usr/sbin/sendmail.sendmail
-rwxrwxrwx  1 root smmsp 757168 Apr 15  2008 /usr/sbin/sendmail.sendmail

root@anotherlinuxhost:~ # ls -l /usr/sbin/sendmail.sendmail
-rwxr-sr-x  1 root smmsp 757168 Apr 15  2008 /usr/sbin/sendmail.sendmail

root@linux:~ # chmod 2755 /usr/sbin/sendmail.sendmail
root@linux:~ # ls -l /usr/sbin/sendmail.sendmail
-rwxr-sr-x  1 root smmsp 757168 Apr 15  2008 /usr/sbin/sendmail.sendmail

Restarted sendmail and no error message is shown when sending a message.

root@linux:~ # service sendmail restart
Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]

user@linux:~ $ mail blackhole@domain.com
Subject: Test
Sending email to test
.
Cc:
user@linux:~ $