Tuesday, September 12, 2006

Panic: Temporary File Seek

Administrating users emails is a bore. Some are packrats and just keep their emails forever. A quick look at the /var/spool/mail/ directory will show just how much emails are stored.

Yesterday there was a user who sent out an email with a large 17MB power point file to EVERYONE. Three times. This caused uptimes to soar and made people frustrated that their emails were delivered slow if at all. So we had to clean them up.

# mail -u lewser.
fseek: Invalid argument
panic: temporary file seek
Aborted
# |

What? we started panicking. File system corruption? Our RAID failed? Need a reboot? Mailbox dead? We tried it on other users with large mailboxes with the same error!

***panic*panic*panic***

We decided to take a breather and do some research before we rip apart our mailserver.
Googling gave us a hint: use mutt.

#mutt -f lewser

and I was pleasantly surprised with a console app that looked like this:

spam riddled email user.

It successfully opened the mail, allowed me to navigate to the bottom really quickly (PgDn), and interactively delete the email (d), feedbacked to me whenever it was opening or closing a file. No silly fseek problems. What a life-saver.

So why doesnt mail support large mailboxes? I have no idea.
Why doesnt it provide a more 'soothing' error message instead of sending us into panic mode? I dont know.
Will I use 'mail -u' ever again? Not if I can help it.

The Mutt is truly Man's Best Friend.


yk.

5 lewsers:

Anonymous said...

Hey man,
thanx for this article.
Probably saved the life of my mailservers filesystem.

best regards
mario

Anonymous said...

Great post! Just ran into that same problem today. Google pulled this up.

Thanks for the help!

Cheers!
Aaron

Yoon Kit said...

Hi Mario and Aaron,

Its good that you got some info out of this. Its surprising that this problem is so common. You'd have thought that 'mail' would have been upgraded to cater for larger mailboxes by now, yeh?


yk.

Gil Hildebrand said...

Thanks dude! Had the same problem.

Anonymous said...

you're a star. thx.