#!/usr/bin/perl # # creatmbx # # The perl way to creating a mbx format mailbox. # Figuring out what mrc's code does is painful. # # Double check output by using od on file. # Vars grokked from reading source files. my $NUSERFLAGS = "30"; my $HDRSIZE = "2048"; my $string; # Check args die "ERROR: creatmbx \n" unless ($#ARGV == 0); # Ported from imap/src/osdep/unix/mbx.c open(FILE,"> $ARGV[0]"); $string = sprintf ("*mbx*\015\012%08lx00000000\015\012", time); for ($i = 0; $i < $NUSERFLAGS; ++$i) { $string .= sprintf "\015\012"; } # Pad the rest of the file with nulls as expected $string = unpack("a${HDRSIZE}", pack("a${HDRSIZE}","$string")); print FILE $string; close(FILE); # The End.