Fwd: Re: delivery blocked messages
Scooter Chanman <[email protected]>
| Newsgroups | gmane.mail.qmail.scanner |
|---|---|
| Message-ID | <[email protected]> |
Sorry for the slow response as I have been buried in work. I will look at your script and let you know how it goes. I know their are others that can use a script for re-injecting the email and if Jason reads these messages he might put it in the /contrib folder. If he doesn't see it, I will request it as re-injecting mail while preserving the From: To:. For some it is important for the ability of the IT Manager to be able to examine the email for legitimacy and passing it along if the email is legitimate. I work for the government and they don't want hardly any spam and don't tolerate loss of important emails thereby having the need of visual inspections of held email. Scott Lampa <[email protected]> wrote: Date: Mon, 21 May 2007 22:45:37 +0200 From: Lampa <[email protected]> To: [email protected] Subject: Re: [Qmail-scanner-general] delivery blocked messages Hello, thanks for script. I look at script and does in easier way same thing as my script. So i little chenged my script and commented it, so it can be used by other people. But i think that will be better if some perl programmer take look at this. Syntax is doruc.pl emails> [go] Program runs default in debug mode (eg not injecting emails only showing what will be done) after 2nd argument "go" is specified emails will be sent. --- Lampa 2007/5/21, Scooter Chanman : > I see the attachment that you sent me in the other message. Here is the one > that I have been using for a year now with no problem. > > Scott > > Lampa wrote: > Date: Mon, 14 May 2007 20:37:54 +0200 > From: Lampa > To: [email protected] > Subject: [Qmail-scanner-general] delivery blocked messages > > Hi, > > is there some way (no by hand) to deliver blocked (quarantined) > messages to recipient (eg. remove *** Qmail-Scanner Quarantine > Envelope Details Begin/End *** stuff and insert into qmail queue) ? > > Thank you for your advice. > --- > > Lampa > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Qmail-scanner-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general > > > > ________________________________ > Pinpoint customers who are looking for what you sell. > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Qmail-scanner-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general > > > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/_______________________________________________ Qmail-scanner-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general --------------------------------- Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Qmail-scanner-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Qmail-scanner-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general
doruc.pl
(application/octet-stream, 1.9 KB)
#!/usr/bin/perl
use strict 'vars';
if ($#ARGV != 0 && $#ARGV != 1) {
print "Usage: $0 <directory> [go]\n";
exit 1;
}
# specify dir with emails
chdir($ARGV[0]) || die("Cannot change directory to $ARGV[0]\n");
# path to qmail-inject
my $qmailinject = '/usr/local/qmail/bin/qmail-inject';
my ($debug) = 1;
my ($param, $soubor) = '';
my (@HLAVICKY) = ();
$debug = 0 if ($ARGV[1] eq "go");
$param .= " -n" if ($debug);
# read entire directory
opendir(DIR, ".") || die("Cannot read directory $ARGV[0]\n");
foreach $soubor (readdir(DIR)) {
# email should be file
if (!-f $soubor) {
next;
}
# get headers from qmail-scanner
@HLAVICKY = `tail -6 $soubor 2> /dev/null`;
my ($odesilatel, $radek, $prijemci) = '';
my ($odes, $prij) = 0;
# extract sender and recipient(s)
foreach $radek (@HLAVICKY) {
if ($radek =~ /^X-Qmail-Scanner-Mail-From: \"(.*)\" via/) {
$odesilatel = $1;
$odes = 1;
}
if ($radek =~ /^X-Qmail-Scanner-Rcpt-To: \"([^\s]+)\"$/) {
$prijemci = $1;
$prij = 1;
}
}
# send only if we have sender and at least one recipient
if ($odes == 1 && $prij == 1) {
my ($obsah) = '';
# read file only once
open(SOUBOR, "<$soubor");
while (<SOUBOR>) {
if (!/^\*\*\* Qmail-Scanner Quarantine Envelope Details Begin \*\*\*/) {
$obsah .= $_;
} else {
last;
}
}
close(SOUBOR);
my ($prijemce) = '';
# multiple recipients separated by coma
foreach $prijemce (split(/\,/, $prijemci)) {
$prijemce =~ s/^\s//g;
$prijemce =~ s/\s$//g;
$prijemce =~ s/,$//;
# print what we are doing and do it
print "*** Sending file $soubor: $odesilatel -> $prijemce *** ($qmailinject$param -f $odesilatel $prijemce)\n";
open(QI, "|$qmailinject$param -f $odesilatel $prijemce") || die("Cannot execute qmail-inject\n");
print QI $obsah;
close(QI);
}
}
}
closedir(DIR);
exit;