#!/bin/sh

# Enemies of Carlotta routine clean-up cronjob
#
# from the manual page:
#   --cleaning-woman
#        Deal with bouncing addresses and do other cleanup.  You must run
#        enemies-of-carlotta --cleaning-woman periodically, such as once
#        per hour.  It will clean up all your lists.

# There are implications in running this system-wide; therefore this
# cronjob is not installed by default, but it can be edited to taste
# and copied to /etc/cron.hourly/enemies-of-carlotta (say).
# Alternatively you can simply add "enemies-of-carlotta
# --cleaning-woman" to the crontab of the system user that runs your
# lists.

cd /home
for user in *; do
	if [ -d "/home/$user/.enemies-of-carlotta" ]; then
		echo $user
		su $user -s /bin/sh -c "enemies-of-carlotta --cleaning-woman"
	fi
done
