Ftrack+FIDOGATE mini-howto v1.3 (fido howto)
Ключевые слова: fido, howto, (найти похожие документы)
- RU.LINUX (2:5077/15.22) ------------------------------------------ RU.LINUX -
From : Serge N. Pokhodyaev 2:5020/1838 07 Apr 00 16:28:12
Subj : Ftrack+FIDOGATE mini-howto v1.3
-------------------------------------------------------------------------------
Ftrack+FIDOGATE mini-HOWTO
Serge N. Pokhodyaev, 2:5020/1838, [email protected]
$Id: Ftrack+FIDOGATE,v 1.3 2000/04/07 12:26:45 snp Exp $
Как прикрутить Ftrack к FIDOGATE
______________________________________________________________________________
Содержание
1. Компиляция smapi.
2. Компиляция Ftrack.
3. Инсталляция
4. Hастройка
______________________________________________________________________________
1. Компиляция smapi.
% tar -xzvf smapi-latest.tar.gz -C /usr/local/src
% cd /usr/local/src/smapi
% ln -s makefile.lnx Makefile
Теперь редактируем Makefile. Hадо заменить пару строчек чтобы собиралась
только библиотека .a (smapi нам понадобится только для Ftrack'а, поэтому
для простоты можно обойтись статическими библиотеками). Hеобходимые изменения
приведены в формате unified diff:
===-COPT= -O3 -fomit-frame-pointer -fstrength-reduce -fPIC
+COPT= -O3 -fomit-frame-pointer -fstrength-reduce
-ALL: $(TARGET) libsmapilnx.so.$(VER)
+ALL: $(TARGET)
==% make
2. Компиляция Ftrack.
% unzip ftr300b2s.zip -d /usr/local/src/ftrack
% cd /usr/local/src/ftrack
% cp /usr/local/src/smapi/*.h smapi
% cp /usr/local/src/smapi/*.a smapi
Если планируется использование ASO (AmigaDOS outbound), прикладываем вот этот
патч:
=== ftrack_aso.diff ===- --- ftrack/src/outbound.cpp.orig Sun Feb 20 20:09:37 2000
+++ ftrack/src/outbound.cpp Wed Mar 15 02:03:54 2000
@@ -85,18 +85,26 @@
char *MakePktName(FA &f) {
static char Buff[1024];
strcpy(Buff,Outbound);
- if (Buff[strlen(Buff)-1] == PATHDELIMC) {
- Buff[strlen(Buff)-1] = '\0';
- }
- if ((MyAddr.Zone() & 0xffff) != (f.Zone() & 0xffff)) {
- sprintf(Buff+strlen(Buff),".%03x",(word)(f.Zone() & 0xffff));
- }
- strcat(Buff,PATHDELIMS);
- sprintf(Buff+strlen(Buff),"%04x%04x",(word)(f.Net() &
0xffff),(word)(f.Node() & 0xffff));
- if ((f.Point() & 0xffff) != 0) {
- strcat(Buff,PntExtension""PATHDELIMS"0000");
- sprintf(Buff+strlen(Buff),"%04x",(word)(f.Point() & 0xffff));
+// if (Buff[strlen(Buff)-1] == PATHDELIMC) {
+// Buff[strlen(Buff)-1] = '\0';
+// }
+// if ((MyAddr.Zone() & 0xffff) != (f.Zone() & 0xffff)) {
+// sprintf(Buff+strlen(Buff),".%03x",(word)(f.Zone() & 0xffff));
+// }
+// strcat(Buff,PATHDELIMS);
+// sprintf(Buff+strlen(Buff),"%04x%04x",(word)(f.Net() &
0xffff),(word)(f.Node() & 0xffff));
+// if ((f.Point() & 0xffff) != 0) {
+// strcat(Buff,PntExtension""PATHDELIMS"0000");
+// sprintf(Buff+strlen(Buff),"%04x",(word)(f.Point() & 0xffff));
+// }
+ if (Buff[strlen(Buff)-1] != PATHDELIMC) {
+ strcat(Buff,PATHDELIMS);
}
+ sprintf(Buff+strlen(Buff),"%u.%u.%u.%u",
+ (word)(f.Zone() & 0xffff),
+ (word)(f.Net() & 0xffff),
+ (word)(f.Node() & 0xffff),
+ (word)(f.Point() & 0xffff));
return Buff;
}
==% cd linux
Редактируем Makefile:
===-CFLAGS= -Wall -W -Werror -fno-rtti
+CFLAGS= -Wall -W -fno-rtti
-COPT= -I../hpp -I../src -O3
+COPT= -I../hpp -I../src -I../smapi -O3
-LFLAGS= -s
+LFLAGS= -s -L../smapi
==% make
3. Инсталляция
% mkdir /usr/local/lib/ftrack
% cd /usr/local/lib/ftrack
% cp /usr/local/src/ftrack/linux/ftrack .
% chown root.root ftrack
% chmod 755 ftrack
Кладем в /usr/local/lib/ftrack вот такой скрипт:
=== ftrack-start ===#!/bin/sh
libdir="/usr/local/lib/ftrack"
etcdir="/usr/local/etc/ftrack"
fgdir="/usr/local/lib/fidogate"
outbound="/var/spool/fido/outb"
uid="fido"
########## End of configurable part ##########################################
if [ "`id -un`" != "${uid}" ]; then
echo "Run as user ${uid}!"
exit 1
fi
# First unpack all mail
${fgdir}/bin/rununpack in
${fgdir}/bin/rununpack pin
# Now track it
${libdir}/ftrack -c ${etcdir}/ftrack.conf >/var/log/ftrack/stdout 2>&1
if [ $? != 0 ]; then
echo Error! >&2
exit 1
fi
# Remove void string inside Vias
for i in `find ${outbound} -name \*.\[hdoc\]ut`; do
bsyname="${outbound}/`basename ${i} | sed -e 's,\.[hdoc]ut$,,'`.bsy"
[ -f ${bsyname} ] && continue
touch ${bsyname}
perl -e 'while(<>) { $_ =~ s,(^\r)(\001Via ),$2,; print; }' <${i} >${i}_
touch -r ${i} ${i}_
mv -f ${i}_ ${i}
rm ${bsyname}
done
# Fix permissions
chmod -R go-rw ${outbound}
==% mkdir /usr/local/etc/ftrack
% mkdir /var/spool/fido/ftrack/in_bad
% mkdir /var/spool/fido/ftrack/in_insecure
% mkdir /var/spool/fido/ftrack/in_secure
% mkdir /var/spool/fido/ftrack/out
% chown -R fido.fido /var/spool/fido/ftrack
4. Hастройка
Hиже приведен реальный конфиг, но вначале несколько пояснений. Вначале FTrack
сканирует несколько директорий, а именно: парольный и непарольный аутбаунды и
директории, в которые кладутся сгейтованные FIDOGATE'ом сообщения. При
сканировании эхомейл игнорируется, а нетмейл конвертируется в формат *.msg
и перемещается в директории `/var/spool/fido/ftrack/in_insecure' или
`/var/spool/fido/ftrack/in_secure'. Затем происходит обработка нетмейла,
находящегося в этих директориях, после чего он перемещается в директорию
`/var/spool/fido/ftrack/out' для последующего роутинга.
=== ftrack.conf ===\ \\\\\\\\\\ My addresses \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Address: 2:5020/1838
aka: 2:5020/1354.500 2:5020/1354.*
SysopName: "Serge N. Pokhodyaev"
Origin: "none"
FileInbound: "/var/spool/fido/inb-protected"
Outbound: "/var/spool/fido/outb"
Trafficlog: "/var/log/ftrack/traffic"
LogFile: "/var/log/ftrack/log"
\ LogLevel: 5
LogLevel: 2
UseNewVIA
LoopStr: "2:5020/1838 @"
UseOwnZone
ForceINTL
BadMessages: move "/var/spool/fido/ftrack/in_bad"
CheckPoints: Never
NodelistPath: "/var/spool/fido/nl.d"
Nodelist: "net5020.ndl" 2
Nodelist: "pnt5020.ndl" 2
IndexFile: "/var/spool/fido/nl.d/ftrack_index"
MaxNodelistAge: 60
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\ Insecure...
ScanDir: "##/var/spool/fido/inb"
KludgeMask: "AREA:*" * *
Action: Ignore
Mask: * * * * * *
Action: Move "/var/spool/fido/ftrack/in_insecure"
ScanDir: "##/var/spool/fido/inb-listed"
KludgeMask: "AREA:*" * *
Action: Ignore
Mask: * * * * * *
Action: Move "/var/spool/fido/ftrack/in_insecure"
\ Secure ...
ScanDir: "##/var/spool/fido/inb-protected"
KludgeMask: "AREA:*" * *
Action: Ignore
Mask: * * * * * *
Action: Move "/var/spool/fido/ftrack/in_secure"
ScanDir: "##/var/spool/fido/outpkt"
KludgeMask: "AREA:*" * *
Action: Ignore
Mask: * * * * * *
Action: Move "/var/spool/fido/ftrack/in_secure"
ScanDir: "##/var/spool/fido/outpkt/mail"
Mask: * * * * * *
Action: Move "/var/spool/fido/ftrack/in_secure"
\ \\\\\\\\\\ Inbound insecure netmail \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ScanDir: "/var/spool/fido/ftrack/in_insecure"
\ Все мыло для меня направляем на роутинг (предварительно вставив
предупреждение)
Mask: * * * 2:5020/1838.1 * *
Mask: * * * 2:5020/1838.0 * *
Mask: * * * 2:5020/1354.500 * *
Action: AddNote "/usr/local/etc/ftrack/tmpl/insecure_to_me"
Action: Move "/var/spool/fido/ftrack/out"
\ Все остальное шлем на 2:5020/1838.0
Mask: * * * * * *
Action: NewMsg "/usr/local/etc/ftrack/tmpl/copy_to_me"
"/var/spool/fido/ftrack/out" "FTrack" @ "Serge N. Pokhodyaev" 2:5020/1838.0
"Insecure netmail" *
Action: Delete
\ \\\\\\\\\\ Inbound secure netmail \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ScanDir: "/var/spool/fido/ftrack/in_secure"
\ Hи отправителя, ни получателя нет в нодлисте -- прибиваем
\ Mask: * !# * !# * *
\ Action: NewMsg "/usr/local/etc/ftrack/tmpl/copy_to_me"
"/var/spool/fido/ftrack/out" "FTrack" @ "Serge N. Pokhodyaev" 2:5020/1838.0
"Bad from and to" *
\ Action: Delete
\ Отправителя нет в нодлисте -- отлуп
\ Mask: * !# * * * *
\ Action: NewMsg "/usr/local/etc/ftrack/tmpl/copy_to_me"
"/var/spool/fido/ftrack/out" "FTrack" @ "Serge N. Pokhodyaev" 2:5020/1838.0
"Bad from" *
\ Action: NewMsg "/usr/local/etc/ftrack/tmpl/badfrom"
"/var/spool/fido/ftrack/out" "FTrack" @ % % "Bad source address" *
\ Action: Delete
\ Получателя нет в нодлисте -- отлуп
\ Mask: * * * !# * *
\ Action: NewMsg "/usr/local/etc/ftrack/tmpl/copy_to_me"
"/var/spool/fido/ftrack/out" "FTrack" @ "Serge N. Pokhodyaev" 2:5020/1838.0
"Bad to" *
\ Action: NewMsg "/usr/local/etc/ftrack/tmpl/badto"
"/var/spool/fido/ftrack/out" "FTrack" @ $ $ "Bad destination address" *
\ Action: Delete
\ Луп обнаружили -- отлуп
Mask: * # * # * +7
Action: NewMsg "/usr/local/etc/ftrack/tmpl/copy_to_me"
"/var/spool/fido/ftrack/out" "FTrack" @ "Serge N. Pokhodyaev" 2:5020/1838.0
"Routing loop detected" *
Action: NewMsg "/usr/local/etc/ftrack/tmpl/loop"
"/var/spool/fido/ftrack/out" "FTrack" @ $ $ "Routing loop detected" *
Action: Delete
\ Все мыло для меня направляем на роутинг
Mask: * * * 2:5020/1838.1 * *
Mask: * * * 2:5020/1838.0 * *
Mask: * * * 2:5020/1354.500 * *
Action: Move "/var/spool/fido/ftrack/out"
\ Hа мыло для несуществующих поинтов шлем отлупы
Mask: * * * 2:5020/1838.* * *
Action: NewMsg "/usr/local/etc/ftrack/tmpl/no_point"
"/var/spool/fido/ftrack/out" "FTrack" @ % % "No such point" *
Action: Delete
\ Все остальное направляем на роутинг
Mask: * * * * * *
Action: Move "/var/spool/fido/ftrack/out"
ScanDir: @AfterRoute
\ Ответим на ARQ
Mask: * * * * * +b
Action: NewMsg "/usr/local/etc/ftrack/tmpl/audit"
"/var/spool/fido/ftrack/out" "FTrack" @ $ $ "Audit receipt" *
\ \\\\\\\\\\ Тут мыло, готовое для роутинга \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ScanDir: "/var/spool/fido/ftrack/out"
\ Для меня
Mask: * * * 2:5020/1838.1 * *
Action: Rewrite * * * 2:5020/1838.0 * *
Mask: * * * 2:5020/1838.0 * *
Mask: * * * 2:5020/1354.500 * *
Action: route hold %
\ Мои линки
Mask: * * * 2:5020/278.* * *
Mask: * * * 2:5020/1124.* * *
Mask: * * * 2:5020/1354.* * *
Mask: * * * 2:5020/3500.* * *
Mask: * * * 2:5020/7100.* * *
Action: route normal %.0
\ Остальной фидонет (зоны с 1 по 6)
Mask: * * * 1:*/*.* * *
Mask: * * * 2:*/*.* * *
Mask: * * * 3:*/*.* * *
Mask: * * * 4:*/*.* * *
Mask: * * * 5:*/*.* * *
Mask: * * * 6:*/*.* * *
Action: route normal 2:5020/278.0
\ Всякие левонеты
Mask: * * * * * *
Action: NewMsg "/usr/local/etc/ftrack/tmpl/no_zone"
"/var/spool/fido/ftrack/out" "FTrack" @ % % "No such zone" *
Action: Delete
===--- FIDOGATE 4.4.0-snp10
* Origin: none (2:5020/1838.0)