MH+QMAIL设计方案(7)_Mail服务器教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

7.ISDN

尽管此项看似与与QMAIL或mh有关,我还是整理了。因为若你的ISP没有PPP线就根本无email可言。我在使用我的ISDN中遇到了相当大的麻烦。SusE包含一个专门为ISDN准备的部分,但我想更简单些。以下材料是由Bernhard Hailer更新的。

以下的的rc.config文件装载了初始化的必要组元。

#!/bin/bash

# This is adapted Bernhard Hailers old script

LOCAL_NUMBER="91311234" # tel no. 091311234

REMOTE_NUMBER="0911123456" # ISP tel no.

LOCAL_IP="192.168.0.99" # I have dynamic IP so this will do

REMOTE_IP="195.112.123.11" # your ISPs gateway

DEVICE="ippp0"

SYSPATH="/sbin"

ISDNCTRL="$SYSPATH/isdnctrl"

case "$1" in

start)

# turn on isdn

insmod /lib/modules/2.0.33/net/slhc.o

insmod /lib/modules/2.0.33/misc/isdn.o

sleep 1

# load the hisax module

insmod /lib/modules/2.0.33/misc/hisax.o

id=Tel0 type=5 protocol=2 irq=10 io=0x300

echo "starting isdn4linux"

# global

$ISDNCTRL verbose 0

$ISDNCTRL addif $DEVICE # create new interface

$ISDNCTRL addphone $DEVICE in $REMOTE_NUMBER

$ISDNCTRL addphone $DEVICE out $REMOTE_NUMBER

$ISDNCTRL eaz $DEVICE $LOCAL_NUMBER

$ISDNCTRL l2_prot $DEVICE hdlc

$ISDNCTRL l3_prot $DEVICE trans

$ISDNCTRL encap $DEVICE syncppp

$ISDNCTRL huptimeout $DEVICE 300

$ISDNCTRL chargehup $DEVICE off

$ISDNCTRL secure $DEVICE on

$SYSPATH/ifconfig $DEVICE $LOCAL_IP pointopoint $REMOTE_IP metric 1

$SYSPATH/route add default $DEVICE

$SYSPATH/ipppd /dev/ippp0 file /etc/ppp/options.ipppd &

$SYSPATH/route del default

;;

stop)

#turn off isdn

rmmod hisax.o

sleep 1

rmmod isdn.o

rmmod slhc.o

echo "Shutting down isdn4linux"

$ISDNCTRL delif ippp0

;;

*)

echo "Usage: $0 (start|stop)"

exit 1

;;

esac

我用以下技巧拨号,它被称为简洁的isdn on|off

#!/bin/bash

# This is based on an old script from Bernhard Hailer

IP_ADDRESS="195.112.123.11"

case "$1" in

on)

echo "Calling ippp0"

/sbin/isdnctrl dial ippp0

# the sleep is important as it gives the PPP time to settle down

echo "Sleep for 8s for PPP handshake"

sleep 8s

/sbin/route add default ippp0

echo "line open - checking...."

# check whether PPP negotiation was successful:

set `ping -qc3 -i1 $IP_ADDRESS 2>/dev/null | grep transmitted`

if [ $4 -gt 0 ];

then

echo "succeeded."

echo "Starting fetchmail daemon"

/usr/bin/fetchmail -d 600 -k -v -a -L /var/log/fetchmail

echo "Flushing mail queue...."

/usr/local/bin/serialmail/maildir2smtp

~alias/pppdir alias-ppp- mail.server.ip.no `hostname`

else

echo "failed!"

/sbin/isdnctrl hangup ippp0

fi

;;

off)

echo -n "Shutting down fetchmail daemon"

/usr/bin/fetchmail --quit

/sbin/isdnctrl hangup ippp0

/sbin/route del default # and delete route

echo "You e off line"

;;

*)

echo -e "aUsage:"

echo "isdn on"

echo "isdn off"

;;

esac

接下来的是 ipppd选项文件/etc/ppp/options.ipppd

#基于:

#Klaus Franken,kfr@srse.de

#版本:27。08。97 (5。1)

#

#该文件由YaST在/etc/ppp/ioptions.YaST 拷贝至optiongs.

user"myrserid"

#我的系统名(只在CHAP上使用!)

# name my_system_name

#从peer处得到IP地址

ipcp-accept-local

ipcp-accept-remote

noipdefault

#试着从interface处得到IP地址

#ipppd的特定选项(比如与pppd的冲突)

#只能使用静态IP

#useifip

#把所有的header-compression都设为disable

-vj

-vjccomp

-ac

-pc

-bsdcomp

#有时你需要这个:

#noccp

#最大接受数

mru 1524

#最大传送数

mtu 1500

#如果你的机器是服务器,就要求签证以下未注释的条项。然而,如果你的机器是客户机,做了以上的事就不会成功连接!(信息将提示"peer refused to authenticate"即peer 拒绝签证)所以,只有在服务器上对于未注释的部分做以下步骤:

# "+pap" / "+chap" NUR AKTIVIEREN, WENN DIES EIN SERVER IST!!!

#+pap

#+chap

#如果你对handshaking有什么问题(比如第一次lcp-package没响应)可以试试减少重试次数,默认情况下是3 sec,试试2 sec:

# lcp-restart 2

来源:网络搜集//所属分类:Mail服务器教程/更新时间:2012-06-29
相关Mail服务器教程