In Japanese.

Mailtonews(1) _ _ NetBSD Reference Manual _ _ Mailtonews(1)

Name
mailtonews --- receive an article of mail-list and deliver it as a news.
SYNOPSIS
mailtonews [-a manager] [-d distribution] [-f config_file] [-n newsgroup]
NOTE
Development of this software has been terminated. Please use mail2news which is include in TERA utilities project.
DESCRIPTION
Mailtonews converts a mail to news file and post the article to newsgroup using inews(1). If no newsgroup is given, and nor is able to convert to newsgroup from To: and/or CC: fields with the conversion table, mailtonews post it to DFLTGRP which determined at compile time.

The manager argument, if given, is used for the Approved: field.

If the distribution argment is given, it is used for the Distribution: field, which default value is determined at compile time.

Mailtonews reads the conversion tables from its configuration file, which default value is /usr/local/share/mailtonews/mailtonews.conf. You can specify alternate file with -f option. For information of the format of the configuration file, see below.

Next, mailtonews reads unix mail form from stdin and creates news file and original mail copy in the temporary directory. These temporary files are unlinked when news server accepts the post. If post fails, mailtonews leave original mail file, converted newsfile and error output from inews in the temporary directory.

If the environment variable TMPDIR is set, mailtonews uses it as the directory in which to put temporary files instead of the default, /tmp.

The mailtonews utility exits 0 on success, 75 when temporary fail, and 1 if other error occurs.

Conversion Rule
Mailtonews modifies few article headers due to the difference between the formats of mail and those of news.

The following headers, if present, are removed:

``Resent-From:'', ``Resent-To:'', ``Resent-Message-Id'', ``From'' (Unix_from), ``Errors-To:'', ``Received:'', ``Return-Path:'', ``Status:'', ``Posted'', ``Distribution:'', ``Newsgroups:'', ``Organization:'', ``NNTP-Posting-Host:'' and ``Xref:''.

Following headers treated specially.

In-Reply-To:: This field sometimes contains Message-Id to which the poster replied. So,if it contains some message-id, mailtonews converts it to Reference: field.

To: and CC:: These headers are expected contain mailing-list name, so mailtonews tries to convert them to newsgroup name.

Subject:: Some mailing-list programs modify the subject of the article, such as adding [mlname,archive_number]. Some newsreader can not trace the thread with such subjects, so mailtonews will remove text enclosed in `[' and ']' at the beginning of the subject. Message-Id:: Some mailers and/or mailing list programs create message-id which is not appropriate for news, such as message-id contains white space, ended with ".", or null hostname ( no string between @ and > ). Mailtonews converts such message-id by replacing white space with dot, removing dot before ">" and adding sender's hostname respectively.

All other headers, unless not duplicate, will be copied to news file. And mailtonews add X-MN-Version: headers.

Configuration File
Configuration file, mailtonews.conf, consists of lines with two fields: the mailing list name and the newsgroup name. The mailing list name is separated from the newsgroup name by one or more white spaces. The lines begin with ``#'' treated as comments.
Example of usage.
This command is normally appeared in /etc/aliases as
netbsd-current: "| mailtonews -n netbsd.current"
Example of mailtonews.conf file
Typical mailtonews.conf file looks like,
     # Mailing List Name  Newsgroup Name
     current-users        netbsd.current
     gnats-bugs           netbsd.bugs
     netbsd-announce      netbsd.announce
     netbsd-bugs          netbsd.bugs
     netbsd-help          netbsd.help
     netbsd-ports         netbsd.ports
     netbsd-questions     netbsd.help
     netbsd-users         netbsd.users
     port-i386            netbsd.ports.i386
     port-alpha           netbsd.ports.alpha
     source               netbsd.source
Notes
Since mailtonews use original mail's message-id as news message-id, inews refuse to accept same mail through different mailing list. In that case, mailtonews just ignore error and unlink temporary files.
FILES
/tmp/mn_mail_XXXXX
Original Mail file.
/tmp/mn_news_XXXXX
Converted file.
/tmp/mn_err_XXXXX
Error output of inews command.
mailtonews.conf
conversion table from Mailing list name to newsgroup.
BUGS
Although mailtonews converts Message-Id based on own rule, it does not care about Reference: field.
SEE ALSO
inews(1)
HISTORY
The mailtonews command appeared in NetBSD-1.0 at Ohtsubo Lab.

Return to OLNS Software Project home
www-admin@www-nuclth.phys.sci.osaka-u.ac.jp
$OLNS: mailtonews.html,v 1.7 1998/07/17 00:45:13 tacha Exp $
Copyright (c) 1996 Ohtsubo and Pupils. ALL RIGHTS RESERVED.