LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-08-2007, 01:49 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
POSTFIX Script


Guys - I was reading the "Postfix" book and found this following script below but I ran it and it showed the following on my server after I ran it...

Code:
[root@mail ~]# delete-from-mailq MAILER-DAEMON
................
postsuper: 5E3ED6C4FA: removed
postsuper: Deleted: 305 messages
So now my question is I don't really understand what the script did and what it basis the deletion from? I can understand that I deleted everything stuck in the queue being sent from "MAILER-DAEMON" but I don't know if I want to delete emails sent from him or what. I do agree that doing this individually by message ID would take way too long. Do I want to remove all messages sent from MAILER-DAEMON stuck in the queue?

Here is the script:

#!/usr/bin/perl
$REGEXP = shift || die "no email-address given (regexp-style, e.g. bl.*\@yahoo.com)!";
@data = qx</usr/sbin/postqueue -p>;
for (@data) {
if (/^(\w+)(\*|\!)?\s/) {
$queue_id = $1;
}
if($queue_id) {
if (/$REGEXP/i) {
$Q{$queue_id} = 1;
$queue_id = "";
}
}
}
#open(POSTSUPER,"|cat") || die "couldn't open postsuper" ;
open(POSTSUPER,"|postsuper -d -") || die "couldn't open postsuper" ;
foreach (keys %Q) {
print POSTSUPER "$_\n";
};
close(POSTSUPER);
 
Old 11-10-2007, 01:32 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
MAILER-DAEMON is an internal name used by postfix to tell you about failures of mail delivery. by email. so you can easily have failing emails to tell you about other emails failing... which is nice.

thanks for the script btw, i actually needed it yesterday... bizarre coincidence.
 
Old 11-13-2007, 12:06 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
So I am still confused. Should I or should I not be removing emails stuck or queued from MAILER-D?
 
Old 11-13-2007, 01:25 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You probably need to have a look at some of the messages and make up your own mind.

My guess is that you're bouncing spam to undeliverable addresses that were spoofed in the first place, in which case you would get rid of them and also consider you settings that are causing the bounces
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make postfix boot script csdhiman Linux - Server 3 03-20-2007 11:24 AM
postfix and perl script pigswillfly Linux - Networking 1 07-25-2006 04:49 PM
Postfix Install Via Script joelhop Linux - Software 3 11-17-2004 11:32 PM
Postfix->filter Script->sudo adduser lawtoncooper Linux - General 0 07-23-2004 01:12 AM
Mail script with Perl & Postfix Bladez Programming 2 02-14-2004 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration