Cliquez sur le bonhomme pour un début d'explication >>>
Les messages qui arrivent sur le bbs doivent être forwardés dans un fichier temporaire nommé mailgw.out
Exemple de fichier forward :
>>>>>>>>>
***********************
MAILGW ********************************
A MAILGW
*
G *
*
H GW.*
H F5KBS.AMPR.ORG
H *.AMPR.ORG
*
B MAILGW
P @
C /usr/local/fbb/mailgw.out
------
>>>>>>>>>
* Pour ma part, c'est un sous-fichier de forward
nommé mailgw.sys placé dans /usr/local/fbb/system/fwd/
Ne pas oublier de déclarer mailgw comme étant une bbs dans le fichier bbs.sys (ne pas effacer de lignes !!!!!)
Le serveur de news à utiliser est INN (ici
inn-2.2),
la configuration est assez simple une fois que tout fonctionne...
:-)
Pour installer INN consulter la doc jointe avec
le package, les faq mais elles sont un peu anciennes.....
Vous pouvez aller voir un exemple
d'installation en français!!!
Une fois installé, dans le répertoire /usr/lib/news on trouve le fichier :
active
>>>>>>>>>
control 0000000000 0000000001 y
control.cancel 0000000000 0000000001 y
junk 0000000000 0000000001 y
test 0000000000 0000000001 y
to 0000000000 0000000001 y
ampr.fra.linux 0000000004 0000000002 y
ampr.fra.vente 0000000003 0000000004 y
ampr.fra.tous 0000000010 0000000001 y
ampr.amsat 0000000027 0000000007 y
ampr.vushf 0000000000 0000000001 y
ampr.fra.reseau 0000000000 0000000001 y
ampr.divers 0000000002 0000000001 y
>>>>>>>>>
Dans votre fichier de départ vous devez trouver juste les groupes control, junk et to. Ajoutez vos groupes en fonction de la config de mailgw.(attention aux espaces en fin de ligne et le retour chariot en fin de fichier lorsque vous éditez le fichier!!)
La solution la plus "propre" est de déclarer les newsgroups avec 'ctlinnd' sous news :
su newspuis lancer la commande (pour créer un newsgroup ampr.fra.linux) :
/usr/bin/ctlinnd newgroup ampr.fra.linux totoou
/usr/news/bin/ctlinnd newgroup ampr.fra.linux totosuivant l'endroit ou se trouve l'exécutable
A priori, les groupes déclarés dans mailgw sont représentés dans le fichier active.....
inn.conf
Dans /etc/news/inn.conf :
>>>>>>>>>
## $Revision: 1.24.2.1 $
## inn.conf -- inn configuration data
## Format:
## <parameter>:<whitespace><value>
##
## See the inn.conf(5) man page for a full description
of each
## of these options
##
## Blank values are allowed for certain parameters
## ---------------------------------
# All parameters must exist
#
organization:
A poorly-installed InterNetNews site
server:
f5soh.ampr.org
pathhost:
f5soh.ampr.org
moderatormailer:
root@f5soh.ampr.org
domain:
fromhost:
f5soh.ampr.org
pathalias:
complaints:
mta:
/usr/sbin/sendmail -oi %s
mailcmd:
/usr/bin/innmail
../..
>>>>>>>>>
(la fin du fichier doit être bonne mis à part un espace
à la ligne 110)
newsfeeds
>>>>>>>>>
## $Revision: 1.17 $
## newsfeeds - determine where Usenet articles
get sent
...../....
## Default of everything to everybody except for
junk, control, anything
## with "local" as the newgroup prefix (i.e. matches
"localhost.stuff") or
## groups under foo. Articles posted to any group under
alt.binaries.warez
## will not get propogated, even if they're cross posted
to something that
## is.
ME\
:*,@alt.binaries.warez.*,!junk,!control*,!local*,!foo.*\
/world,usa,na,gnu,bionet,pubnet,u3b,eunet,vmsnet,inet,ddn,k12\
::
...../.....
# :Tf,Wnb,B4096/1024:
#
fbb\
:*\
:Tc,Ap,G2,Wf\
:/usr/bin/nntp_rcv
>>>>>>>>>
Ajouter les lignes qui concernent "fbb" à la fin du fichier,
le fichier nntp_rcv est un binaire
de mailgw
(je l'ai placé avec les autres dans /usr/bin/ mais ça
peut être autre chose...)
nnrp.access
>>>>>>>>>
## $Revision: 1.7 $
## nnrp.access - access file for on-campus NNTP
sites
## Default is no access, no way to authentication, and
no groups.
*:: -no- : -no- :!*
## Foo, Incorporated, hosts have no password, can
read anything.
#*.foo.com:Read Post:::*
stdin:Read Post:::*
localhost:Read Post:::*
127.0.0.1:Read Post:::*
*.ampr.org:Read Post:::*
>>>>>>>>>
Toutes les stations identifiées comme appartenant à ampr.org
peuvent lire et écrire sur les newsgroups, sans mot de passe.
Il est possible de mettre *:Read Post:::*
pour autoriser tous les hosts à lire et écrire.
Une fois les modifs effectuées, il est possible de vérifier
la syntaxe des fichiers de config avec inncheck
(/usr/news/bin/inncheck ou /usr/bin/inncheck)
Vérifier le contenu du fichier inetd.conf pour voir si
nntp et smtp sont validés (à tout hazard)
Vérifier que votre serveur de News fonctionne en faisant un
: telnet "host" 119 puis la commande LIST
qui doit vous donner les groupes de news actifs.
(119 correspond au port nntp, si c'est pas le bon, voir dans le fichier
/etc/services)
Attention !!! si vous avez des messages dans les logs du style :
Mar 1 12:12:21 f5soh innd: fbb:18:proc:550 cant write Broken pipe
Mar 1 12:17:21 f5soh innd: fbb exit 1 elapsed 0 pid 847Les messages postés dans les newsgroups ne sont pas envoyés sur la Fbb, le reste fonctionne......l'erreur vient du fichier /etc/news/control.ctl, les valeurs par défaut sont plus restrictives que dans les versions précédentes de Inn.... vous pouvez récupérer ce fichier ici pour le remplacer (attention aux enregistrements Dos)
J'ai utilisé ici sendmail, en cas de problème voir sur
le site officiel de sendmail
Le fichier de configuration se trouve dans /etc/
sendmail.cf
Modifier / ajouter les éléments suivants :
>>>>>>>>>>>
# my official domain name
# ... define this only if sendmail cannot automatically
determine your domain
(ou quelques problèmes, il oublie son nom et ne peut localiser le serveur lorsqu'il reçoit des mails user@f5kbs.ampr.org !!!)
CP.
# "Smart" relay host (may be null)
# resolve fake top level domains by forwarding to other hosts
# fwd vers pbbs toutes les adresses qui se terminent par
"eu"
Mprog,
P=/bin/sh, F=lsDFMoqeu9, S=10/30, R=20/40, D=$z:/,
T=X-Unix,
A=sh -c $u
>>>>>>>>>>>>
Le fichier est assez long, j'espère que j'ai laissé assez
d'éléments pour arriver à vous repérer....
exemple : pour ajouter la partie Mpbbs, éditer le fichier (vi
sendmail.cf) taper "/Mprog" et vous y êtes!!!
J'ai utilisé la version 3.1 de Mailgw et appliqué le patch
Japonais 031a.diff.gz.
Vous pouvez récupérer les fichiers :
L'archive
Mailgw-0.3.1 officielle ou ici mailgw-0.3.1.tgz
Mailgw
Patch by JH4XSY and JE1SGH (Doc pour appliquer le patch, ancienne version
0.3.0)
Le patch 031a.diff.gz des Om's japonais
qui corrige des headers dans les messages.
Voir aussi la
page G7PIT pour un autre exemple de configuration.
Le site officiel de l'auteur
Vous pouvez aussi récupérer l'archive
de Mailgw au format rpm (Suse 6.3, non patché)
Compiler les sources
Copier les deux fichiers mailgw-0.3.1.tgz
et 031a.diff.gz dans /usr/local/src
Dans /usr/local/src/, taper :
tar xvfz mailgw-0.3.1.tgz (décompresse les sources dans ./mailgw-0.3.1/)
zcat 031a.diff.gz | patch -p0 (applique le patch)
cd mailgw-0.3.1
makeUne fois la compilation terminée, copier les fichiers nntp_rcv, smtp_rcv, pbbs_rcv et pbbs_event dans /usr/bin/
#!/usr/bin/perl
#
# Place this in crontab, to be run every couple minutes...
#
# Runs pbbs_rcv, feeds the bulletins to inn, and cleans the spool
# directory afterwards.
#
$innxmit = "/usr/bin/innxmit"; (chemin pour accéder au binaire innxmit)
$batch = "/var/spool/mailgw/innxmit.batch";
$nntpserver = "localhost";
system("/usr/bin/pbbs_rcv"); (chemin pour accéder au binaire pbbs_rcv, voir mailgw.conf)
../..Créer un répertoire mailgw dans /var/spool/
Les fichiers de config de mailgw sont placés dans le répertoire /etc/mailgw/
mailgw.conf
>>>>>>>>>>
# /etc/mailgw/mailgw.conf
#
# General configuration for the nntp/smtp <> pbbs
gateway.
#
# Local fqdn (the address we get our smtp mail as)
HostName f5soh.ampr.org
# Callsign used on packet
Callsign GW
# Full pbbs hierarchical address
HRoute GW.F5SOH.FAQI.FRA.EU
# QTH string, inserted on the R: line
Qth "Mugron - Landes (40), IN93ps"
#
# Logging
#
# Loglevel: Sum of the following options:
#
#define L_ERR
1 /* Error conditions (file trouble, etc) */
#define L_R_ERR
2 /* Routing errors (no route mappings) */
#define L_ROUTING
4 /* How each message was routed */
#define L_START
8 /* Starting and stopping of nntp_rcv and pbbs_rcv
#define L_INFO
16 /* Informative messages (non-problems) */
#define L_DEBUG
32 /* Debugging messages (verbose) */
#define L_STATS 64 /* Statistics (message counts,
etc) */
LogLevel 127
# LogDest: Sum of the following options:
#
#define L_STDERR
1 /* Log to stderror - breaks smtp_rcv with some
# mailers
*/
#define L_SYSLOG
2 /* Log to syslog */
LogDest 2
#
# Files
#
# pbbs import file (which we write the messages to)
ImportFile /usr/local/fbb/mail.in
# Lock file for the import file
ImportLock /usr/local/fbb/lock.in
# pbbs export file (which the pbbs forwards to)
ExportFile /var/spool/mailgw/mailgw.out
# Lock file for the export file
ExportLock /var/spool/mailgw/mailgw.lck
# smpt/nntp export spool directory (must be created before
starting mailgw!)
# Temporary directory used for feeding articles to inn
and the smtp MTA.
SpoolDir /var/spool/mailgw
# Where innxmit and sendmail (or equivalent) hide
InnXmit /usr/bin/innxmit
Sendmail /usr/sbin/sendmail
#Sendmail /usr/mail/bin/dumb-mailer
>>>>>>>>>>
Modifier les chemins en fonction de votre configuration : innxmit, sendmail.
Permet de trier les bulletins en provenance du
réseau packet vers les groupes de News.
C'est une première ébauche de mon
coté, à voir à l'usage!!!!
(tous les groupes doivent être créés
au niveau de Inn)
>>>>>>>>>>
# /etc/mailgw/bulletin.map
#
# pbbs bulletin distribution -> nntp newsgroup mapping
#
# When messages are transferred from packet bbs to inn,
this map
# is used for deciding which group each message goes
to.
#
# First match wins.
#
# Format:
#
# newsgroup in-distrib
#
# distribution format: recipient@distribution<source@sourcehost
ampr.fra.tous
tous@fra
ampr.fra.linux
linux@fra
ampr.fra.reseau fpac@fra
flex*@fra fbb*@fra
ampr.fra.vente vente@fra
rech*@fra
ampr.vushf
vhf*@* uhf*@* shf*@*
ampr.amsat
kep*@* amsat@*
ampr.divers
*@*
>>>>>>>>>>>>
Permet d'attribuer une adresse de destination packet lorsque l'on répond à un message sur le groupe de News, à noter que les messages postés sur ne newsgroup ampr.divers ne sont pas redirigés vers la bbs Fbb (-).
>>>>>>>>>>>>
# /etc/mailgw/nntp.map
#
# NNTP newsgroup -> pbbs distribution mapping
#
# Format:
#
# newsgroup pbbs-distribution
#
ampr.fra.tous
tous@fra
ampr.fra.vente vente@fra
ampr.fra.reseau reseau@fra
ampr.fra.linux linux@fra
ampr.tcpip
tcpip@fra
ampr.vushf
vushf@fra
ampr.amsat
amsat@fra
ampr.divers
-
>>>>>>>>>>
Permet de retrouver le Home bbs lors d'un post ou reply sur les News
et l'Email
ex: f5acm%f6kdu.faqi.fra.eu@f5kbs.ampr.org
devient F5ACM@F6KDU.FAQI.FRA.EUsur
le packet
>>>>>>>>>>>>
# /etc/mailgw/email-dst.map
#
# Mapping from smtp *destination* addresses to the pbbs
*destination*
# addresses. Used when gatewaying from smtp to the pbbs
side.
#
# Format: pbbsaddr smtpaddr
#
# Can handle xNOS 'spool/rewrite' style wildcards.
# '$1' on the right side is replaced by the part which
matches
# the first '*' on the left side. $2 is replaced with
the second *,
# and so on...
#
# If the email address in the message doesn't match anything
# in this file, it is not gatewayed, and a bounce is
generated.
#
*@* $1@$2
f5soh@* f5soh@f5soh.faqi.fra.eu
*%*@f5soh.ampr.org $1@$2
*%*@*.f5soh.ampr.org $1@$2
# Automatically added entries start here!
>>>>>>>>>>
email-src.map
>>>>>>>>>
# /etc/mailgw/email-src.map
#
# Mapping from smtp *source* addresses to the pbbs *source*
addresses.
# Used when gatewaying from nntp/smtp to the pbbs side.
#
# Format: smtpaddr pbbsaddr [save]
#
# Can handle xNOS 'spool/rewrite' style wildcards.
# '$1' on the right side is replaced by the part which
matches
# the first '*' on the left side. $2 is replaced with
the second *,
# and so on...
#
# If the email address in the message doesn't match anything
# in this file, it is not gatewayed (on SMTP, it's bounced).
#
# If there's a "save" keyword on the line which matches,
it is
# expected that the replies for the message will be returned
# via this gateway, and the address is put into the pbbs->smtp
# destination address table pbbs-dst.map.
#
f5soh@* f5soh@f5soh.faqi.fra.eu
*%*@f5soh.ampr.org $1@$2
*@*.ampr.org $1@$2.ampr.org
>>>>>>>>>>
L'adresse d'un expéditeur packet F5ACM@F6KDU.FAQI.FRA.EU
apparaît sous la forme f5acm%f6kdu.faqi.fra.eu@f5kbs.ampr.org
Si on souhaite envoyer un message à une
station distante, via la bbs fbb, il suffit de taper dans le logiciel de
mail une adresse du type :
indicatif@homebbs.Hroute
>>>>>>>>>>>>
# /etc/mailgw/pbbs-dst.map
#
# Mapping from pbbs *destination* addresses to the email
*destination*
# addresses. Used when gatewaying from the pbbs to the
# smtp/nntp side.
#
# Format: pbbsaddr smtpaddr
#
# Can handle xNOS 'spool/rewrite' style wildcards.
# '$1' on the right side is replaced by the part which
matches
# the first '*' on the left side. $1 is replaced with
the second *,
# and so on...
#
# If the pbbs address in the message doesn't match anything
# in this file, it is not gatewayed, and a bounce is
generated.
#
*@*.ampr.org $1@$2.ampr.org
*@*.f5soh.faqi.fra.eu $1@f5soh.ampr.org
*@*.gw $1@$2
# Automatically added entries start here!
>>>>>>>>>>>>
pbbs-src.map
>>>>>>>>>>>>>
# /etc/mailgw/pbbs-src.map
#
# Mapping from pbbs *source* addresses to the email *source*
addresses.
# Used when gatewaying from the pbbs to the smtp/nntp
side.
#
# Format: pbbsaddr smtpaddr [save]
#
# Can handle xNOS 'spool/rewrite' style wildcards.
# '$1' on the right side is replaced by the part which
matches
# the first '*' on the left side. $1 is replaced with
the second *,
# and so on...
#
# If the pbbs address in the message doesn't match anything
# in this file, it is not gatewayed (if a personal message,
it's
# bounced).
#
# If there's a "save" keyword on the line which matches,
it is
# expected that the replies for the message will be returned
# via this gateway, and the address is put into the smtp->pbbs
# destination address table.
#
# For the callsign%packet.bbs.hroute@your.hostname form:
*@* $1%$2@f5soh.ampr.org
# For the callsign@hroute.your.hostname form (wildcard
MX record):
# *@* $1@$2.f5soh.ampr.org
>>>>>>>>>>>>>>
Lancement de Mailgw
Editer crontab pour lancer Mailgw
avec le script pbbs_event toutes les 10min par exemple.(min 0,10,20,30,40,50)
Pour éditer, taper crontab -e (étant root)
et ajouter une ligne.
crontab (root)
>>>>>>>>>>
#
0,10,20,30,40,50 * * * * /usr/bin/pbbs_event 1> /dev/null
2> /dev/null
>>>>>>>>>>>>
Toutes les erreurs sont visibles dans le fichier /var/log/syslog
(penser à l'effacer de temps en temps... hi)
Une fois que tout fonctionne correctement, il est possible de diminuer
les messages dans syslog. (voir plus haut)
Cette page sur la config de Mailgw est à titre d'exemple.....
je n'assure pas que tout soit bon !!!! :-)
Testé sur une distribution Mandrake 6.1, Fbb7.01i, sendmail.8.9.3
avec un kernel 2.2.13