Sponsored Content
Full Discussion: Clearing Mail Queue
Top Forums UNIX for Dummies Questions & Answers Clearing Mail Queue Post 21541 by Perderabo on Saturday 18th of May 2002 07:28:04 AM
Old 05-18-2002
The shell expands that * into a list of filenames and then tries to run the rm command with that list. But there's a limit to how long that list can be and you exceeded it.

Since you are using the full path, you might try a relative path instead:
Code:
cd /var/spool/mqueue
rm *

Now each individual file no longer has the /var/spool/mqueue/ prefix so the expanded command is much shorter. But if this is still too long, you can try this...
Code:
cd /var/spool/mqueue
ls | xargs rm

The ls produces a list of file names which xargs reads. It then assembles them into a bunch of rm commands. It knows how long each one can be and it won't assemble a command that is too long.

But are sure that you want to do this? You are going to discard all of your mail! My idea of clearing the queue is
Code:
/usr/lib/sendmail -q -v


Last edited by rbatte1; 11-17-2016 at 10:59 AM.. Reason: Added CODE tags
This User Gave Thanks to Perderabo For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

MyDoom in mail queue

Is there someone out there that has a script for cleaning up the mail queue after viruses such as MyDoom? (5 Replies)
Discussion started by: pmj1970
5 Replies

2. Shell Programming and Scripting

shell script needed for mail queue notification

Hi shell experts, I would like to have a shell script running in a redhat server for monitoring the mailqueue status. I have already installed the qmHandle and I am using it to get a status of the mail queue in daily basis. I am executing the qmhandle in the cron. Now I am planning to execute... (10 Replies)
Discussion started by: Nightman
10 Replies

3. UNIX for Advanced & Expert Users

mail is not sent, instead just coping into /var/spool/queue dir

Hi, I have some problems w/ the sendmail. I see that messages are queued in the /var/spool/mqueue and they are never sent to the recipients. This problem just suddenly started without any modifications in the current configuration. I already started and stop the sendmail and it did not help.... (3 Replies)
Discussion started by: ktanya
3 Replies

4. IP Networking

postfix - reinject mail to postfix from hold queue directory

hi all. Am using smtpd_recipient_restrictions & check_recipient_access in postfix. The hash file looks like this: emailaddress1 HOLD emailaddress2 HOLD The aim is to place email from these recipients in the hold directory,check them then reinject them back in postfix on some... (0 Replies)
Discussion started by: coolatt
0 Replies

5. Shell Programming and Scripting

flush the mail queue

Hi Guys, My mail queue is showing a mail. I want to flush the queue. Can you let me know how to flush the mail queue. Regards, Magesh (12 Replies)
Discussion started by: mac4rfree
12 Replies

6. AIX

clearing PVID

HI admins, I am not able to clear pvid .I am getting below error. chdev -l hdisk273 -a pv=clear Method error (/usr/lib/methods/chgdisk): 0514-047 Cannot access a device. pv The disk is from SAN. I can clear remove the disk using rmdev.But if i run cfgmgr , this disk apperas... (2 Replies)
Discussion started by: newaix
2 Replies

7. UNIX for Dummies Questions & Answers

Mail Queue refilling

Hello I'm using Cent OS6 and a webmin interface I've had an issue where over 1 million emails were queued in the sendmail mail queue. I found a thread on here from 2002 explaining how to delete them all and it worked great. Thanks Perderabu unix-for-dummies-questions-and-answers /... (0 Replies)
Discussion started by: bullbreed
0 Replies

8. Shell Programming and Scripting

Check pending mail in mail queue

I know the command mailq can check the pending mail in mqueue , and also have another command to check POSIX mail queue in server , now I will regularly check the mqueue manually , it is time consuming , would advise the script that could help to check the mail queue , and then send the details to... (3 Replies)
Discussion started by: ust3
3 Replies

9. Shell Programming and Scripting

Check mail queue

We use Redhat server , we always use mailq to check any pending mail in mailq , when run the command mailq , it shows all existing pending mail would advise how to write a script to show the pending mails which are older than 24 hours , ( if possible , then send this pending mail info to... (9 Replies)
Discussion started by: ust3
9 Replies

10. UNIX for Dummies Questions & Answers

Printer queue not clearing

Hi I have installed an HP X451dw printer on our network and want to print from Sco Openserver v6 The printer produces correct output but then repeats until the queue is manually stopped. :confused: It is using a netcat/dumb interface Any advice on how to persuade it to only print once... (5 Replies)
Discussion started by: David Holmes
5 Replies
logwatch_mail_selinux(8)				   SELinux Policy logwatch_mail 				  logwatch_mail_selinux(8)

NAME
logwatch_mail_selinux - Security Enhanced Linux Policy for the logwatch_mail processes DESCRIPTION
Security-Enhanced Linux secures the logwatch_mail processes via flexible mandatory access control. The logwatch_mail processes execute with the logwatch_mail_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. For example: ps -eZ | grep logwatch_mail_t ENTRYPOINTS
The logwatch_mail_t SELinux type can be entered via the mta_exec_type, mta_exec_type, sendmail_exec_t file types. The default entrypoint paths for the logwatch_mail_t domain are the following: /bin/mail(x)?, /usr/bin/mail(x)?, /usr/sbin/sendmail(.sendmail)?, /usr/bin/esmtp, /usr/sbin/rmail, /usr/sbin/ssmtp, /usr/lib/sendmail, /var/qmail/bin/sendmail, /usr/sbin/sendmail.postfix, /usr/lib/courier/bin/sendmail PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux logwatch_mail policy is very flexible allowing users to setup their logwatch_mail processes in as secure a method as possible. The following process types are defined for logwatch_mail: logwatch_mail_t Note: semanage permissive -a logwatch_mail_t can be used to make the process type logwatch_mail_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. logwatch_mail policy is extremely flexible and has several booleans that allow you to manipulate the policy and run logwatch_mail with the tightest access possible. If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server, you must turn on the authlo- gin_nsswitch_use_ldap boolean. Disabled by default. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to allow confined applications to run with kerberos, you must turn on the kerberos_enabled boolean. Enabled by default. setsebool -P kerberos_enabled 1 If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. setsebool -P nis_enabled 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Enabled by default. setsebool -P nscd_use_shm 1 NSSWITCH DOMAIN
If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server for the logwatch_mail_t, you must turn on the authlogin_nsswitch_use_ldap boolean. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow confined applications to run with kerberos for the logwatch_mail_t, you must turn on the kerberos_enabled boolean. setsebool -P kerberos_enabled 1 MANAGED FILES
The SELinux process type logwatch_mail_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. courier_spool_t /var/spool/courier(/.*)? /var/spool/authdaemon(/.*)? exim_log_t /var/log/exim[0-9]?(/.*)? exim_spool_t /var/spool/exim[0-9]?(/.*)? logwatch_mail_tmp_t logwatch_tmp_t mail_home_rw_t /root/Maildir(/.*)? /home/[^/]*/.maildir(/.*)? /home/[^/]*/Maildir(/.*)? mail_spool_t /var/mail(/.*)? /var/spool/imap(/.*)? /var/spool/mail(/.*)? mqueue_spool_t /var/spool/(client)?mqueue(/.*)? /var/spool/mqueue.in(/.*)? sendmail_log_t /var/log/mail(/.*)? /var/log/sendmail.st.* uucpd_spool_t /var/spool/uucp(/.*)? /var/spool/uucppublic(/.*)? COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), logwatch_mail(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) logwatch_mail 14-06-10 logwatch_mail_selinux(8)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy