🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Julien ÉLIE Fri, 31 Mar 2023 20:21
Improving deliverability of moderated group submissions
#90230
Author: Julien ÉLIE
Date: Fri, 31 Mar 2023 20:21
75 lines
4976 bytes
Hi all,

We recently had a discussion in the inn-workers mailing list about mails sent to moderators.
The common command line used to send such mails is:

   /usr/lib/sendmail -oi -oem %s

where %s is replaced by the address of the moderator.

Could it be improved to notably receive errors, and how?
As a few mail experts lurk in this newsgroup, I believe we'll manage to find the right options to use :-)


To start the discussion, here is a proposal for an improved wording for the "mta" parameter in INN, based on a feedback from Grant and Russ.


     *mta*
         The command to use when sending a mail (e.g. mailing postings to
         moderators, gatewaying news to mail, sending statistics to the
         TOP1000 project, mailing errors and reports to the news
         administrator).  Some programs use innmail(1) which in turn runs
         *mta*.  The message, with its headers, will be piped into this *mta*
         program.  Depending on the calling program, additional header fields
         may be added when appropriate, like To, Subject or Auto-Submitted
         header fields.

         The string %s, if present, will be replaced by the expected
         recipient(s) like the e-mail address of the moderator or of a remote
         list.  It's strongly recommended for this command to end with %s on
         the command line rather than, when not present, use the addresses in
         the To and Cc header fields of the message, since the latter
         approach allows the news server to be abused as a mechanism to send
         mail to arbitrary addresses and will result in unexpected behavior.
         There is no default value for this parameter; it must be set in
         inn.conf or a fatal error message will be logged via syslog.

         For most systems, "/usr/lib/sendmail -oi -oem %s" (adjusted for the
         correct path to sendmail, and between double quotes) is a good
         choice.

         To improve deliverability of sent mails, especially moderated group
         submissions, you are encouraged to install a modern and
         full-featured MTA like Postfix instead of a frugal MTA like
         Nullmailer.  You'll then be able to configure bounces and benefit
         from DSN (Delivery Status Notifications).  Useful flags to add, if
         your *mta* program supports them, are "-N failure" (to only return a
         DSN on failure, not delay), "-F "Newsmaster"" (to set the full name
         of the notification), "-fnewsmaster" (to set the envelope sender
         address), and "-opnobodyreturn" (a privacy option to only return
         headers in the DSN).  Feel free to add any other options you think
         appropriate.





I've seen that we have an exception with the news2mail gatewaying program, which uses additional flags:

   <mta without %s> -ee -odq -fxxx -pNNTP:pathhost addresses

I don't know what "-ee" means.  Does someone know?  Is it still a useful flag?

-odq queues mails.  It means that "sendmail -q" should be periodically run to actually send the mails.  I wonder whether that's really useful.  Maybe a flag should be added to news2mail to configure that behaviour (for backwards compatibility: if -q is given to news2mail, then it does not queue messages).

-fxxx defaults to the newsmaster address or a specific envelope address configured in news2mail.cf for the list.
I suggest to strip an existing -f flag in mta if one is configured in news2mail.cf so as not to conflict with it.

I am unsure -pNNTP:pathhost is really necessary...  Any thoughts?

-- 
Julien ÉLIE

« J'ai six loyaux serviteurs, ils m'ont appris tout ce que je sais : ils
   s'appellent quoi, pourquoi, quand, comment, où et qui. » (Rudyard
   Kipling)
Re: Improving deliverability of moderated group submissions
#90231
Author: Richard Kettlewell
Date: Fri, 31 Mar 2023 21:31
42 lines
2891 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> We recently had a discussion in the inn-workers mailing list about
> mails sent to moderators.  The common command line used to send such
> mails is:
>
>   /usr/lib/sendmail -oi -oem %s
>
> where %s is replaced by the address of the moderator.
>
> Could it be improved to notably receive errors, and how?
> As a few mail experts lurk in this newsgroup, I believe we'll manage to find the right options to use :-)

-oem is already about as good as it gets for ensuring errors are
reported as email rather than hidden in a logfile.

[..]
> I've seen that we have an exception with the news2mail gatewaying program, which uses additional flags:
>
>   <mta without %s> -ee -odq -fxxx -pNNTP:pathhost addresses
>
> I don't know what "-ee" means.  Does someone know?  Is it still a useful flag?

-eX is a historical synonym for -oeX, and -oee means that if an error in
is encountered when sending the message then it should be reported by an
email, with the exit status always being 0. Contrast -oem where you get
errors by mail but (presumably) also a nonzero exit status.

(Assuming the administrator actually wants to see errors) it should
probably be -oee or -oem depending on what the calling process expects
from the MTA’s exit status.

> -odq queues mails.  It means that "sendmail -q" should be periodically
> run to actually send the mails.  I wonder whether that's really
> useful.  Maybe a flag should be added to news2mail to configure that
> behaviour (for backwards compatibility: if -q is given to news2mail,
> then it does not queue messages).

I guess the intent was to arrange that the actual sending happened in a
batch.

-- 
https://www.greenend.org.uk/rjk/
Re: Improving deliverability of moderated group submissions
#90237
Author: Frank
Date: Fri, 31 Mar 2023 22:06
8 lines
899 bytes
> I am unsure -pNNTP:pathhost is really necessary...  Any thoughts?

I believe its main value is to produce a
  Received: from pathhost by mtahost with NNTP
header or similar.

It could be of some diagnostic use to for whoever reads mail headers on the 
receiving end.
Re: Improving deliverability of moderated group submissions
#90233
Author: Julien ÉLIE
Date: Sun, 02 Apr 2023 20:21
51 lines
3310 bytes
Hi Richard and Franck,

Thanks for your messages about the parameters given to sendmail.
All of the current parameters used in the sendmail command run by 
news2mail seem useful to keep.


>> I've seen that we have an exception with the news2mail gatewaying program, which uses additional flags:
>>
>>    <mta without %s> -ee -odq -fxxx -pNNTP:pathhost addresses
>>
>> I don't know what "-ee" means.  Does someone know?  Is it still a useful flag?
> 
> -eX is a historical synonym for -oeX, and -oee means that if an error in
> is encountered when sending the message then it should be reported by an
> email, with the exit status always being 0. Contrast -oem where you get
> errors by mail but (presumably) also a nonzero exit status.

Thanks for the pointer to "-oee"!


> (Assuming the administrator actually wants to see errors) it should
> probably be -oee or -oem depending on what the calling process expects
> from the MTA’s exit status.

Indeed, the "-oee" fits better in the logic of how news2mail treats the 
return statut of the command.

To prevent conflicts in the arguments given to sendmail, I plan on 
ensuring -oem and -f are stripped from the mta command line 
(parameterized in inn.conf), as news2mail uses different values.

      my $sendmail = $INN::Config::mta;
+    # Remove %s and -f from the mta command line (we'll explicitly set
+    # recipients and an envelope sender below).
+    # Remove -oem as we'll set -oee so that sendmail exits with a
+    # non-zero status only if the mail cannot be sent.
      $sendmail =~ s!\s*%s!!;
+    $sendmail =~ s!\s*-f\s*\S*!!;
+    $sendmail =~ s!\s*-oem!!;
      my @command = (
-        split(' ', $sendmail), '-ee', '-odq', "-f$s",
+        split(' ', $sendmail), '-oee', '-odq', "-f$s",
          "-pNNTP:$INN::Config::pathhost", @a
      );

-- 
Julien ÉLIE

« Traversez la rivière en foule, le crocodile ne vous mangera pas. »
   (proverbe malgache)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads