Search code examples
linuxmailx

getting dead.letter file on Linux?


i am sending mail to list of users, i am sending mail using mailx utility

mailx -s "$SUBJECT" "$TO" < $FILE

its working fine with valid emails, but problem is that i am getting dead.letter file when i tried to send to mail id like adffadf , it string not a valid email,

expected - i want this dead.latter must not be occur even user having anything for email ID.

like abc@gmail.com, abc@def.cc, adffdfs


Solution

  • The man page for my mailx says a lot of things about set nosave and so on, but they don't seem to work. The only way to stop your dead.letter file growing I have found is to replace it by a link to the special file /dev/null.

    rm ~/dead.letter
    
    ln -s /dev/null ~/dead.letter