Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th March 2008, 11:44
sandiphw sandiphw is offline
Junior Member
 
Join Date: Mar 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete spam mail from queue

We are receiving thousands of mails having unknown recipients in our domain which all paralyzed our mail system. Please see the mails stucked up in
queue:
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
561251991FE0* 2865 Sun Mar 9 09:17:15 MAILER-DAEMON
cb-0caraway@holtecnet.com

DFDB61991287* 3126 Sun Mar 9 09:19:23 MAILER-DAEMON
Philip-0eniarom@holtecnet.com

75FB31991349* 2893 Sun Mar 9 09:19:08 MAILER-DAEMON
0jarring@holtecnet.com

D164819912BF* 4101 Sun Mar 9 09:19:12 MAILER-DAEMON
_0gubdeb@holtecnet.com

26B521991480* 4055 Sun Mar 9 09:19:14 MAILER-DAEMON
0ecilam1985@holtecnet.com

478F51991254* 3632 Sun Mar 9 09:19:18 MAILER-DAEMON
Chuck-0potse@holtecnet.com

A26F219912B2* 2944 Sun Mar 9 09:19:26 MAILER-DAEMON
JHON-0sanoj@holtecnet.com

D413519912E6* 3040 Sun Mar 9 09:19:32 MAILER-DAEMON
lechat-0repus@holtecnet.com

CFE871991495* 3409 Sun Mar 9 09:19:37 MAILER-DAEMON
_0esnes@holtecnet.com

D8C0019914BD* 3472 Sun Mar 9 09:19:43 MAILER-DAEMON
_0rotceps@holtecnet.com

1CFE61991FF0* 2940 Sun Mar 9 09:19:09 MAILER-DAEMON
_0kolkhoz@holtecnet.com

How can I delete all these junk mails at a single command as per your suggestion? I don't have the e-mail of sender of these mails.

www.holtecnet.com is our domain. We are using zimbra 3.1.1 on Fedora 5.

Any help regarding this will be highly appreciated.

Sandip K Sadhukhan
Reply With Quote
Sponsored Links
  #2  
Old 12th March 2008, 19:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

If you want to clear the whole mail queue, run
Code:
postsuper -d ALL
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 13th March 2008, 12:46
sandiphw sandiphw is offline
Junior Member
 
Join Date: Mar 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That will delete necessary mails also. Is there anyway I can delete mails only from "MAILER-DAEMON" ?

Sandip
Reply With Quote
  #4  
Old 14th March 2008, 01:16
minskog minskog is offline
Member
 
Join Date: Mar 2006
Posts: 73
Thanks: 7
Thanked 0 Times in 0 Posts
Default

I have this script for this situations

Code:
#!/bin/bash
mailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($7 == "MAILER-DAEMON" )
    print $1 }
' | tr -d '*!' | postsuper -d -
Reply With Quote
  #5  
Old 14th March 2008, 08:39
sandiphw sandiphw is offline
Junior Member
 
Join Date: Mar 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks,

Your full script is not visible. Can you please post the full code or send me at sandiphw@hotmail.com?

Sandip
Reply With Quote
  #6  
Old 14th March 2008, 09:15
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,259
Thanks: 215
Thanked 648 Times in 294 Posts
 
Default

Quote:
Originally Posted by sandiphw
That will delete necessary mails also. Is there anyway I can delete mails only from "MAILER-DAEMON" ?

Sandip
Yes that's true, but you can also:

postsuper -r *QUEUE ID* (for releasing one)
postsuper -r ALL (for releasing ALL)
postsuper -d *QUEUE ID* (for deleting one)
postsuper -d ALL (for deleting ALL)

__________________
Hans

MrHostman | Master in managed hosting
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail server using Postfix, Dovecot, Mysql... Postfix virtual maps doesn't work?? tarasbuljba HOWTO-Related Questions 33 28th May 2010 14:33
Postfix reject connections gabrix Server Operation 27 25th January 2007 08:37
ISPConfig with postfix problem Chrisssssss General 30 20th January 2007 23:34
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 12:16
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs ebbay Installation/Configuration 9 4th March 2006 11:47


All times are GMT +2. The time now is 11:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.