HyperNews can already send out email notification to subscribers when something has been posted. See the Instructions for Subscribing. The 'sendmail' program is used for this purpose since it takes care of alot of concerns we would have, such as handling rejection, queuing for retries, etc.
To enable outgoing email, you might have to configure sendmail to allow your server process to be a trusted user (See the sendmail.cf T option). This is because HyperNews wants to use the sendmail -f command line option to say that it is Owner-HyperNews sending a message on behalf of the author. Any mailing list software would want to do the same.
HyperNews is configured by default to use a set of options with sendmail that should probably work on your system too. But every sendmail configuration tends to be different, and different sendmail versions have different restrictions and/or bugs.
In some sendmail versions/configurations, if there is a failure to deliver a message to any local user, mail to all recipients fails. With the -oem option, at least the error is mailed to the 'sender'. Perhaps immediate queueing of the message with -odq will avoid this problem. Hints from sendmail experts appreciated here.
There are two ways to reply to a message in most mail programs. Either reply to just the sender of the message or reply to the sender and all recipients of the message. First a little background on how email works with HyperNews.
When HyperNews sends out email, the sender is always the author, and is identified by the "From:" header line. One exception is when the author is unknown; in that case, "Owner-HyperNews" is used since mail programs require that there be some sender.
[BTW, the real recipients of the message are those who subscribed to receive the notification - they are not listed visibly in the outgoing email because they are given in the Bcc field. The only visible recipient is 'HyperNews' (specified by the $mail_to variable). When HyperNews is configured to receive incoming email, this special 'HyperNews' address is an email alias that has a program (mail-incoming.pl) attached to it that posts the message to a HyperNews forum.]
So if you receive email from HyperNews you can reply directly to the author in which case no one else will see it. Or you can reply to the author and all the recipients (i.e. just 'HyperNews'), and all the subscribers will see it. This is done typically with a command called "Reply to All" in your mail program, but check that it does the right thing. Of course, you can mail your reply just to HyperNews too; the author will probably also get the email indirectly via HyperNews.
There is a way to configure HyperNews so it will include a "Reply-to" line in outgoing messages. If you (the administrator) do this, then all email replies will typically be sent to whatever is specified in the Reply-to line, such as "HyperNews". Some mailing lists like do this to encourage all replies to be sent to the list, but I find it very annoying since sometimes I know I just want to send my reply to the author and there is no way to do so without manually copying and pasting the author's address. Furthermore, people accidently post to the list when they intended to reply only to the sender.
However, other mail programs (e.g. older versions of Eudora) do not include an In-Reply-To header. If your reply does not get posted properly, the cause might be that your mail program has not created this header. You can try to post a message on the HyperNews Test Forum and reply to it by email to see if your mail program does the right thing.
Outgoing mail from HyperNews includes, at the top of the body, exactly the In-Reply-To header line that should appear in the header of your reply. If you cannot add it to the header section (some mail programs don't let you add header lines) then you have one more option: you can include it as the very first line of your reply where HyperNews will look for it. HyperNews version 1.9.7 will also ignore leading spaces and '>' chars on that line, but for older versions, be sure to start the "In-Reply-To" at the beginning of the line.
Another issue is the title of your message, which is specified by the "Subject" header line. The default Subject line that many mail programs produce when you reply to a message is not terribly informative (e.g. "Re: What he said"), especially when viewed in a HyperNews forum, so you are encouraged to change the Subject line to something specific to your message.
The In-Reply-To header works fine if you are replying to a message, but what if you want to post a new message to a forum? In this case, it is not a reply to anything. But HyperNews lets you post a new message to a forum by including a "Newsgroups:" header line that specifies the URL of the forum you are posting to. E.g.
Newsgroups: http://www.hypernews.org/HyperNews/get/hypernews/test.htmlThis line, either in the header section or in the first line of the body, will cause HyperNews to post the message to that forum. If there is an "In-Reply-To:" header as well, then that is used first and the Newsgroups line is basically ignored.
For each mail message received by the HyperNews email gateway, if it is not a reply to a preexisting thread and does not have a "Newsgroups" header, HyperNews returns a "HyperNews Posting Error" message indicating that it doesn't know where to post the new message.
There is one other way to post a message to a forum that works for both replies and new messages. If you configure your forum to use an email address that is specific to the forum, then you can also mail directly to that address. See below for how to do this.
If the HyperNews site you want to post a message (or reply) to is restricted to members-only, then you must make sure that the email address used to identify you as the author of your message is also a member of the HyperNews site. You can check this by using the Inquire About Member option on the membership form for the site. The upper and lower case characters in the email addresses are significant. (This will be fixed in a future version.)
If you are the "owner" of a forum you will be subscribed by default. This means you get email notification for every posting. If you don't want that, you can explicitly unsubscribe.
If you are an administrator, you might be getting all email notifications because you have been named in the "HyperNews" email alias. Your version of sendmail might require that email be sent to some explicit address and that address might have to be for a user who exists (such as you) in order for email to be sent to anyone. If you want to disable all email, that would be one rather drastic solution to the problem. Another solution is to make the $mail_to address be an alias that sends the mail to /dev/null. The following works with sendmail V8.7.5.
HyperNews: "| cat > /dev/null"or just try:
HyperNews: /dev/nullAnother way to avoid getting email from the $mail_to address is to enable incoming email, as described in the next section.
Don't swap the $mail_to and $mail_from addresses in hnrc. This may appear to work, but you will be setting yourself up for more confusion.
To use this feature, you need to do a few things in addition to the normal installation of HyperNews.
HyperNews: "| /full/path/to/HyperNews/.scripts/mail-incoming.pl"
The "HyperNews" alias is whatever is in your $mail_to variable. You should probably also have an Owner-HyperNews alias that points to a real user such as you. Make sure mail-incoming.pl is executable by the user:group running sendmail or procmail, typically root:bin.
If you have multiple installations, you will want to have one HyperNews alias for each, but they could share a common Owner-HyperNews.
# All hypernews mail :0 c * ^TO hypernews | /full/path/to/HyperNews/.scripts/mail-incoming.pl
A loop can occur if the .midDB directory is not correct for some reason, because then HyperNews can't tell that you have already posted a message. It checks whether the message ID has already been seen, and if not, then it assumes this is a new message and proceeds to post it. Make sure you have no filter on your mail that changes the message ID before mail-incoming.pl sees it. That would cause a loop.
We also add a special X-Hn-Loop header to outgoing email, and check for that header in incoming email. But some gateways may remove unknown headers, so the message ID check is also useful.
Be sure to test your incoming email gateway, and be around when you do test it so you can quickly disable a mail loop. You can disable a mail loop by turning off all handling of incoming email: move mail-incoming.pl to somewhere else, or edit mail-incoming.pl to add "exit 0;", or edit your hnrc to set "$allowEmailIn = 0;", or change the mail alias that forwards mail to mail-incoming.pl. Take your pick, but be prepared to do it quick.
To create a forum specific email gateway:
For example, if the base article / forum were called "books" and you wanted any messages sent to "books@domain.com" to be added directly to the forum, you would specify "books@domain.com" in the 'books.html,urc' file (or use the web form '../edit-article.pl/books.html').
Using the example ("books") above, the mail alias line in /etc/aliases would be:
books: "| /full/path/to/HyperNews/.scripts/mail-incoming.pl -f /books"
If you are using qmail, the alias might appear in the file .qmail-domain-books or .qmail-books and contain only:
| /full/path/to/HyperNews/.scripts/mail-incoming.pl -f /books
So you could add similar lines for specific forums just as above.
Note that the <forum> must have a leading '/' and not a trailing '.html'. And there is a space after the '-f'.
Verify that the file permissions on the mail-incoming script allow the mail proc to run it.
Others...