Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My /usr/bin/mail currently just has text in it...

Config file not found (-s)

How can I repair this file so I can send mail again? I'm not sure when this happened or how this happened, but I need to get this email back up and running and am not sure how to go about it.

UPDATE

I'm on Linux version 2.6.5-7.147-bigsmp (geeko@buildhost) (gcc version 3.3.3 (SuSE Linux)) #1 SMP Thu Jan 27 09:19:29 UTC 2005

share|improve this question

closed as not a real question by Chopper3, Ward, Khaled, Webnet, Tom O'Connor Jan 5 '12 at 15:52

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
What OS/distribution are you talking about? –  jgoldschrafe Jan 5 '12 at 14:56
4  
Also, this happened because someone running as root inadvertently redirected output (>) of a command instead of piping (|) it to /usr/bin/mail. –  jgoldschrafe Jan 5 '12 at 14:57
2  
The easy way: restore /usr/bin/mail from the latest backup where it was a binary. Although probably if you were having a working backup you would not be asking here. The lesson here: do not mess with servers which do not have working backups - otherwise you will come to regret it sooner or later. –  the-wabbit Jan 5 '12 at 15:27

1 Answer 1

I'd try

yum whatprovides /usr/bin/mail

then

yum reinstall [package name]

This may also work (and is a bit less drastic):

rpm2cpio [rpm file] | cpio -idmv cp usr/bin/mail /usr/bin/ 

You can also browse rpm files and the cpio within them using the midnight commander (mc) file browsers. That's how i normally would do this, (using F5 to copy the file to the other side of the window, and the tab key to switch active panel if you've not used mc before)

share|improve this answer
2  
Or for Debian/Ubuntu: sudo apt-get install --reinstall $(dpkg -S $(readlink -f /usr/bin/mail) | cut -f1 -d:) –  benwh Jan 5 '12 at 15:11
    
It looks like I'm on Suse Linux - do you know what the package name is and how I can install it? I'm unfamiliar with RPM and CPIO files –  Webnet Jan 5 '12 at 15:16
    
Try 'mailx' for the package name –  benwh Jan 5 '12 at 20:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.