vicker313 tech blog

June 28, 2010

How to Purge Emails at Linux Server using Command

Filed under: Linux, Server — Tags: , — vicker313 @ 12:53 pm

All the mails are stored in files at /var/mail, where each user will have their owned individual file. For example user James’ email will be stored at /var/mail/james. To purge all emails of a user, simply clear the content of the file using the following command:

cat /dev/null > /var/mail/james

Do not remove the file, or else the user will not able to receive email anymore. However by any change the file is removed, simple recreate back the file:

cat /dev/null > /var/mail/james

chown james:mail /var/mail/james


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: