Watching /var/log/maillog, i noticed a lot of spam sent out from my server through majordomo accounts so i chose to disable it in all my sites.

I did a small HOWTO of how to disable all at the same time. This HOWTO is for Linux/Ensim.

HOWTO Begins:

Note: All command must be Logged as root;

1. First of all we have to disable the email alias in all sites.

CODE
ls /home/virtual/ | grep site | while read x; do echo $x; grep -v "majordomo" /home/virtual/$x/fst/etc/aliases > aliases.tmp; mv -f aliases.tmp /home/virtual/$x/fst/etc/aliases; chroot /home/virtual/$x/fst/ newaliases; done;


2. Now we remove user majordomo from site /etc/passwd.

CODE
ls /home/virtual/ | grep site | while read x; do echo $x; grep -v "majordomo" /home/virtual/$x/fst/etc/passwd > passwd.tmp; mv -f passwd.tmp /home/virtual/$x/fst/etc/passwd; done;


3. And now we remove majordomo from site /etc/group

CODE
ls /home/virtual/ | grep site | while read x; do echo $x; grep -v "majordomo" /home/virtual/$x/fst/etc/group > group.tmp; mv -f group.tmp /home/virtual/$x/fst/etc/group; done;


4. Last restart sendmail, I don't know if this is really necessary, but lets do it anyway.

CODE
service sendmail restart



Thanks, for reading. Feel free to comment/suggest.