MAILMAN_GRPNAME = grp.getgrgid(MAILMAN_GID)[0]
TypeError: illegal argument type for built-in operation.
Gee, doesn't this just scream to you that you should check the value
of MAILMAN_GID?
It sure does to me, using nothing more than English punctuation
skills...