#!/usr/bin/perl -wna # -n loops thru while (<>) {} # -a cuts all words in each $_ line by word delims into @F my ($domain, $i); $domain = $ARGV; # domain is filename #print "**$_\n"; (! $F[0]) && (next); # skip blank lines if ($F[0] && $F[0] =~ m/^$|^#/) { next } # next on blank & comment if ($F[0] && $F[0] eq ":") { # collect target list # print "targs...$_\n"; shift @F; $targs = join(", ", @F); next } #print "sources...$_\n"; for $i (@F) { if ($i eq "_null_") { $i = "" }; print $i ."@". $domain ." ". $targs ."\n"; } # format of input file #:destination mailbox #list, of, targets, that, hit, destination, comma, seperated #_null_ for a null email username ie "@domain.com" for a catchall # # #:catchall #_null_ # #:math #kchase, ken, ken.chead, kenc, math # #:aclisham #aclisham, allister.clisham, allisterc, allister # #:alebreton #alebreton, angela.lebreton, angelal, angela # #:brada #brada, brad.arsenault, barsenault, brad # #:danh, dan@hammond-trowels.com #danh, dhammond, dan.hammond, dan # #:jnickerson #jnickerson, jeremy.nickerson, jeremyn, jeremy # #:jrichards, otheraddress@otherhost #jrichards, jonathan.richards, jonathanr, jonr, jon, jonathan #