Added logic to handle the last record of the mailq file. Also added tests to around processing the entire mailq