{ $OUT = ''; # Generate qmail user assignments for the admin user. This will be # handled by ~admin/.qmail. my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef) = getpwnam("admin"); # It is almost impossible to get Text::Template to output nothing # on failure. It can be done by removing the newline at the end of # this file but that is messy. Therefore, we'll simply return an # error message that will make qmail-newu fail. Also send a # warning message that will be captured in the logs. unless (defined $uid && defined $gid && defined $dir) { my $msg = "Failed to obtain user details for \'admin\' " . "while processing admin assignment."; warn "$msg\n"; $OUT = $msg; return; } # Assign mail for the admin user itself, and for admin-ext. my $admin_assign = "admin:${uid}:${gid}:${dir}"; $OUT .= "=admin:${admin_assign}:::\n"; $OUT .= "+admin-:${admin_assign}:-::"; }