GagA// 0n D nEt

It is currently Tue Aug 21, 2018 10:16 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Linux: Send email to blackhole
PostPosted: Thu Mar 26, 2009 12:07 pm 
Offline

Joined: Wed Jul 18, 2007 1:14 am
Posts: 181
Need to send a bunch of emails to blackhole or /dev/null while sending them out via the command line mail applications in linux?

The following is how you can get that done.

You need to create a new alias in /etc/aliases file. Edit the file:
Quote:
[[email protected] ~]# vim /etc/aliases

And add the following line
Code:
blackhole:   /dev/null

Save and exit the file.

Run the following command
Quote:
[[email protected] ~]# newaliases

Now you have a user, blackhole which is aliased to /dev/null. You can try sending the email to this user via the command line, as given below:
Quote:
[[email protected] ~]# echo "hey, how are you doing?" | mail -s "mail" blackhole


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group