Article View: news.software.nntp
Article #80202Re: posting oooold email archive to my inn2 server
From: Julien ÉLIE
Date: Sat, 28 Feb 2009 15:05
Date: Sat, 28 Feb 2009 15:05
83 lines
3982 bytes
3982 bytes
Hi Jon,
>> [with exit 1 -- but maybe we could just exit(1) after the test when "-c"
>> is not used, and write a message error to say what happened]
>>
>> Is it what you want? or another thing?
>
> i guess that could be okay
% cat test | ./mailpost trigofacile.test
Duplicate article <test-article@news.trigofacile.com>.
zsh: done cat test |
zsh: exit 1 ./mailpost trigofacile.test
Index: mailpost.in
===================================================================
--- mailpost.in (révision 8359)
+++ mailpost.in (copie de travail)
@@ -333,7 +333,8 @@
if ( ! $tmpfile ) {
# We had to bail and mail the article to the admin.
- exit (0) ;
+ print STDERR "The creation of the temporary file $tmpfile failed.\n" if -t STDERR;
+ exit(1);
}
@@ -377,7 +378,10 @@
if (defined $DATABASE{$message_id}) {
- exit 0 if (!$opt_c) ;
+ if (!$opt_c) {
+ print STDERR "Duplicate article <$message_id>.\n" if -t STDERR;
+ exit(1);
+ }
## crosspost -c
$newsgroups = &append_newsgroups($DATABASE{$message_id}, $newsgroups) ;
@@ -399,7 +403,8 @@
if ($opt_c) {
if (fork() != 0) {
undef $tmpfile; # Don't unlink $tmpfile.
- exit 0;
+ print STDERR "An error occurred during the fork.\n" if -t STDERR;
+ exit(1);
}
sleep $opt_c ;
@@ -430,7 +435,7 @@
if (defined($dup)) {
syslog("err", "mismatch $newsgroups\n") if $debugging && $use_syslog;
- exit 0 ;
+ exit(1);
}
# Replace Newsgroups:.
@@ -604,9 +609,9 @@
of unknown headers).
If the article has been seen before (B<mailpost> records the Message-ID of
-each article it handles), then the article will be silently dropped. Other
-errors will cause the article to be mailed to the newsmaster (selected
-at configure time and defaulting to C<usenet>).
+each article it handles), then the article will be dropped with a non-zero
+error status. Other errors will cause the article to be mailed to the
+newsmaster (selected at configure time and defaulting to C<usenet>).
Normally, B<mailpost> is run by sendmail(8) via an alias entry:
I hope this patch suits you.
--
Julien ÉLIE
« Vous savez, les idées, elles sont dans l'air. Il suffit que quelqu'un
vous en parle de trop près, pour que vous les attrapiez ! » (Raymond Devos)
Technical Details
Message-ID:
<gobjsf$obh$1@news.trigofacile.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!feeder1.news.weretis.net!weretis.net!news.trigofacile.com!not-for-mailReferences:
<go3dcd$upa$1@munin.diku.dk> <go42tl$83t$1@news.trigofacile.com> <go5je3$148h$1@munin.diku.dk> <go9d72$jgv$1@news.trigofacile.com> <go9g8f$1dhr$1@munin.diku.dk> <go9h98$of3$1@news.trigofacile.com> <go9nqf$1e3r$1@munin.diku.dk> <87fxhze4fs.fsf@windlord.stanford.edu> <goaqvb$lcj$1@aux.snarked.org> <goas6d$29m$1@news.trigofacile.com> <goaufn$1hdm$1@munin.diku.dk>Show Full Headers
Complete Article Headers
Message-ID: <gobjsf$obh$1@news.trigofacile.com> Subject: Re: posting oooold email archive to my inn2 server Date: Sat, 28 Feb 2009 16:05:08 +0100 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <go3dcd$upa$1@munin.diku.dk> <go42tl$83t$1@news.trigofacile.com> <go5je3$148h$1@munin.diku.dk> <go9d72$jgv$1@news.trigofacile.com> <go9g8f$1dhr$1@munin.diku.dk> <go9h98$of3$1@news.trigofacile.com> <go9nqf$1e3r$1@munin.diku.dk> <87fxhze4fs.fsf@windlord.stanford.edu> <goaqvb$lcj$1@aux.snarked.org> <goas6d$29m$1@news.trigofacile.com> <goaufn$1hdm$1@munin.diku.dk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!feeder1.news.weretis.net!weretis.net!news.trigofacile.com!not-for-mail Newsgroups: news.software.nntp Organization: TrigoFACILE -- http://www.trigofacile.com/ Lines: 83 NNTP-Posting-Host: amontpellier-152-1-54-112.w83-197.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Trace: news.trigofacile.com 1235833552 24945 83.197.19.112 (28 Feb 2009 X-Complaints-To: abuse@trigofacile.com NNTP-Posting-Date: Sat, 28 Feb 2009 15:05:52 +0000 (UTC) In-Reply-To: <goaufn$1hdm$1@munin.diku.dk> X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049