The hard part is what source do you use for your users? Are they listed in the local /etc/passwd file, are they in an LDAP compliant directory? Is this cfagent.conf file going to run on one mail server or many ?
If it is one mail server then you can make a list variable myname = ( name01:name02:name03 )
Then the following can be used
#This would take care of the files being in compliance. files:
/var/spool/mail/${myname}
owner=${myname}
mode=660
action=warnall
syslog=trueTo iterate over a list, see the following url: http://www.cfengine.org/docs/cfengine-Tutorial.html#Iterating-over-lists
#Next comes seeing if an extra file is in the directory which should not be in the directory.
/var/spool/mail/${myname}
exclude=${myname}
action=warnall
syslog=trueI have not tested this last one. Give it a try. May need to define an "elsedefine=class" to do more here.
-- Pe5ky Tac0 -------------- Yum, Fish Tacos !!
John Borwick wrote:
Hello! I hope you all are doing well.
How can you check all of the following things in /var/spool/mail: * the only files in /var/spool/mail are usernames (WarnNonUserMail, I'm guessing) * the files are owned by the correct user, w/ appropriate 0660 permissions
Thanks very much! I'll be happy to add answers to cfwiki.org.
Yours, John
------------------------------------------------------------------------
_______________________________________________ Help-cfengine mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-cfengine
-- Pe5ky Tac0 -------------- Yum, Fish Tacos !!
_______________________________________________ Help-cfengine mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-cfengine
