#!/usr/bin/env perl

use strict;

while (<>) {
	my($user, $pass, $uid, $gid, $name, $homedir, $shell) = split(/:/, $_);
	my($mailbox, $domain) = split(/\@/, $user);
	printf("%s:%s:%s:%s:%s:/var/vmail/%s/%s:%s\n", $user, $pass, $uid, $gid, $name, $domain, $mailbox, $shell);
}
