# addacct_bat.pl script # set for the domain part in SMTP address $domainName = '@poserver2.opentech.co.jp'; # read from standard input while(<>) { @var = split(':', $_); # split by ':' if ( !open(ACCT, ">./$var[0].acct") ) { # open account.acct file print "Can't open $var[0].acct file: $!\n"; } else { print ACCT "Access-Domains: []\n"; # spec. in 11.3.3 print ACCT "AutoReply-Info: []\n"; # User Profile Form print ACCT "AutoReply-Mode: [reply]\n"; # ( page 289 ) print ACCT "Directory-Access: [d]\n"; # in InterMail Post.Office print ACCT "Finger-Access: []\n"; # Administration Guide print ACCT "Finger-Info: []\n"; print ACCT "Forward-Delivery: []\n"; print ACCT "Handler-Delivery: []\n"; print ACCT "Home-URL: []\n"; print ACCT "Local-Delivery: [Mailbox]\n"; print ACCT "Mailbox-Quota: [40960]\n"; print ACCT "Name: [${var[0]}]\n"; print ACCT "Password: [${var[0]}]\n"; print ACCT "POP-Address: [${var[0]}]\n"; print ACCT "PUF-Enabled: [no]\n"; print ACCT "PerUserFilters: []\n"; print ACCT "Program-Deliver-Info: []\n"; print ACCT "Raw-Password: []\n"; print ACCT "SMTP-Address: [${var[0]}${domainName}]\n"; print ACCT "SMTP-RewriteStyle: [none]\n"; print ACCT "UNIX-UserName: []\n"; close(ACCT); # check this system is Windows or Unix for path separator # if the installation path for Post.Office is different from # the following default path, need to change those paths. if ($ENV{'PROCESSOR_ARCHITECTURE'} eq 'x86') { $status = system("C:\\PROGRA~1\\Post.Office\\cmdutils\\addacct.exe $var[0].acct") >> 8; print "C:\\PROGRA~1\\Post.Office\\cmdutils\\addacct.exe $var[0].acct\n"; } else { $status = system("/opt/post.office/cmdutils/addacct $var[0].acct") >> 8; print "/opt/post.office/cmdutils/addacct $var[0].acct\n"; } # check the status for result of addacct command if ($status) { print "Can't add account info for $var[0]: $status\n"; } else { print "Account info for $var[0] was registered...\n"; unlink $var[0].acct; } } }