Folding boxes for automated packaging