Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to delete all email messages at ONE time? Post 302079978 by reborg on Friday 14th of July 2006 09:10:29 AM
Old 07-14-2006
It can be done by truncating the mail spool for the user

if you have mailx

try delete *

Code:
#! /usr/bin/ksh
#
# delete_mails.ksh
# 

#
# You may want a confirmation dialog here, delete can't be reversed.
#

MAIL=$(mail << EOF | sed -n 's/^[>    ][      ]*\([0-9][0-9]*\)[      ][      ]*.*/\1/p'
h a
EOF
)
mail |&
for mail in $MAIL; do
    print -p d $mail
print q

sleep 1
exit 0

** note do not just copy and paste the code.
each
Code:
  [        ]

is a [ followed by a space and a tab followed by a ].

Last edited by reborg; 06-12-2007 at 05:51 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do we delete spam email on mmdf

Please advise on how to delete spam email from mmdf email, and The Unix spec below: System = SCO_SV Release = 3.2v5.0.5 (2 Replies)
Discussion started by: esh
2 Replies

2. UNIX for Dummies Questions & Answers

Delete All email

If I have thousands of email to delete on the mail server POP3, is there a quick way to delete it all in one command instead of going into pine and deleting them one at a time?:cool: (2 Replies)
Discussion started by: foothillnet
2 Replies

3. Programming

How to delete email addresses

I need to delete old email addresses and can't them them out of my address I have a dell and am served by MSN? (Email address removed... Neo) (4 Replies)
Discussion started by: Deede
4 Replies

4. UNIX for Dummies Questions & Answers

How to delete old email addresses?

Help! Need to delete old email addresses from address book on Dell Windows 98............. -------- The subject line was one long string - I inserted spaces - oombera (1 Reply)
Discussion started by: Deede
1 Replies

5. UNIX for Dummies Questions & Answers

Cron to delete email help needed

I would like to know if I can place a cron job (and what it might be of course) to delete all the mail in an inbox? Here are the servers specs: Operating systemLinuxService StatusClick to ViewKernel version2.6.28.9Machine Typei686Apache version2.2.11 (Unix)PERL version5.8.8Path to... (2 Replies)
Discussion started by: markmatu
2 Replies

6. Shell Programming and Scripting

ftp, archive, email and delete from shell script

Hello, I found the forum’s information very helpful and informative. I am relatively new to UNIX programming. I am researching how to write a UNIX shell script to ftp all files from specific host folder to a client server. Also need to archive all transferred files, send a message (email) if any... (4 Replies)
Discussion started by: Lenora2009
4 Replies

7. Solaris

Delete email recd

Hello All, For many users, .forward file has been created to forward the emails from UNIX (SUN 5.8) to Exhcnage server. Is there any way to delete the email as soon as it comes to the mailbox on UNIX (without the same being forwarded to the Exchange Server)? Thanks! suismilyadon (2 Replies)
Discussion started by: suismilyadon
2 Replies

8. Shell Programming and Scripting

Sent output to email and empty folder at same time

Hi all, i want to sent output to email and folder at same time. This is my code : echo "Hello" | mailx -s "${SUBJECT}" "${email_add}" >> ${file} I only can sent output to my email but cannot sent to my empty folder....can i know how to done it? (1 Reply)
Discussion started by: proghack
1 Replies

9. Debian

sendmail taking too much time to send a email

Hi , I'm using sendmail command to send a email. To send a email sendmail taking 3minutes to complete the process. Is there any configuration needs to be done in server or another solution is there to resolve this issue. Thanks in Advance. Regards Latika (1 Reply)
Discussion started by: latika
1 Replies

10. Shell Programming and Scripting

MAILX too much time to send email

Hello, I am using heirloom-mailx on UBUNTU 11.04 to create a bash script that sends an e-mail with an attachment. The command invoked is : echo $BODY | mailx -v \ -S smtp=smtps://$smtpmailserver:465 \ -S from=$MITTENTE \ -S ssl-verify=ignore \ -S smtp-auth=login \ -S smtp-auth-user=$USER \... (8 Replies)
Discussion started by: occhiverdi1987
8 Replies
openipmicmd(1)						     An IPMI Command Interface						    openipmicmd(1)

NAME
openipmicmd - An IPMI Command Interface SYNOPSIS
openipmicmd [-k entry-to-execute] <connection parms> DESCRIPTION
The openipmicmd program allows a user to execute direct IPMI commands. It can work with direct interface with the OpenIPMI driver or with IPMI LAN interfaces. OPTIONS
-k entry-to-execute Execute a single command an exit. <connection parms> The parameters for the connection depend on the connection type. These are all described in openipmi_conparms (7) COMMANDS
Once up, you can execute commands in the user interface. Note that commands and responses are asynchronous, you issue a command and the interface returns immediately. When the response comes back, it will be dumped on your console. That's a little strange looking, but IPMI is asynchronous underneath. Note that the -k option is synchronous, it will wait for the response or a timeout before returning. 0f lun netfn cmd [data1 [data2 ...]] Send a command to the BMC you are connected to. channel [ipmb] IPMB-addr lun netfn [seq] cmd [data1 [data2 ...]] Send a command to a device on the IPMB bus. The "ipmb" string is optional. The seq must be provided if the netfn is a response (an odd number). It must be the same sequence number that came in on the command in the "Command Sequence = seq" part of the command. channel 00 IPMB-addr lun netfn cmd [data1 [data2 ...]] Send a broadcast command to a device on the IPMB bus. channel lan handle remote-swid local-swid lun netfn cmd [data1 [data ...]] Send a command to a device over a LAN channel. Note that this not the same as a LAN connection. This sends a message through a local BMC to a remote system that is hooked up with a LAN connection. test_lat count command Executes the given commands (one of the previous commands) count times and gives the average time per command to execute. Note that "count" is hexadecimal. help Display some help. regcmd netfn cmd Register to receive the given command. If the driver receives an external command, it will print it out. This only works with sys- tem interface connections, it will not work on LAN connections. unregcmd netfn cmd Remove a command registration. SEE ALSO
ipmi_ui(1), ipmilan(8), openipmi_conparms(7) KNOWN PROBLEMS
The asynchronous nature of the program can be annoying. AUTHOR
Corey Minyard <cminyard@mvista.org> OpenIPMI 05/13/03 openipmicmd(1)
All times are GMT -4. The time now is 08:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy