PDA

Bekijk de volledige versie : WL700ge as mail server (xmail)



hal2k1
27-05-2007, 12:41
I want to use the WL700ge as a mail server. I want it to send and receive mail for a number of user accounts, and I want the mail to be stored on the WL700ge disk. I want all accounts to be able to see their mail from any client PC on the local lan.

The best bet for this seems to be xmail, as this program is available in the optware packages.

http://www.xmailserver.org/

So, I have installed the xmail package, and I can get it to run, but I am having trouble configuring it. I have set up a dyndns account for the router's IP address, so I have a domain name.

Firstly, when I do a port scan from the wider internet, it would seem that ports 25 (smtp), 110 (pop) and 143 (imap) are all blocked, probably by the firewall but possibly by my ISP. I don't know how to unblock them, or even how to tell if it is the firewall or my ISP who is blocking the ports.

Has anyone had success with xmail? If so, could they kindly post a description of how to set it up and get it going? It would be greatly appreciated, thanks.

If xmail is not the best shot, and there is another (perhaps easier) way to set up a mail facility using the router, I would like very much to hear about that also.

hal2k1
28-05-2007, 14:52
I don't want to turn the firewall off. I don't want the normal web control pages to be accessible on the internet (wan).

I am trying to set up a "virtual server". As an experiment I have redirected external (wlan) requests to port 80 (http) to 127.0.0.1:8082 (lighttpd running on local host).

This only seems to work partially. I will keep trying, and give a report.

hal2k1
29-05-2007, 10:51
I don't want to turn the firewall off. I don't want the normal web control pages to be accessible on the internet (wan).

I am trying to set up a "virtual server". As an experiment I have redirected external (wlan) requests to port 80 (http) to 127.0.0.1:8082 (lighttpd running on local host).

This only seems to work partially. I will keep trying, and give a report.

This did not work. Port 80 is still blocked.

It looks like I am going to have to turn the firewall off, unless anyone has a suggestion as to how to configure the firewall, independently of the web page settings?

sollie
29-05-2007, 18:22
iptables -I INPUT 7 -p tcp --dport 8082 -j ACCEPT

Add this to rc.local.

Sollie.

hal2k1
30-05-2007, 11:32
iptables -I INPUT 7 -p tcp --dport 8082 -j ACCEPT

Add this to rc.local.

Sollie.

Beautiful. Thankyou very, very much.

Now, in order to run xmail as a mail server, do you know what else I need to do?

I'm assuming a similar iptables command for port 25 would be required, and perhaps one for port 110 and 143 as well?

I have lighttpd and PHP running OK, so I am assuming PHPXmail is a good thing to get?

I have also tried Telean:
http://telaen.org/index.php?option=com_frontpage&Itemid=1
... but so far it just hangs. I'm assuming this is also because of a blocked port.

There are a whole raft of xmail tools:
http://www.xmailserver.org/

... so I suppose I have quite a bit of research to go yet.

I will let this board know if I get it all going, and what tools I used to help.

sollie
30-05-2007, 17:41
I use this:


# Opening ports for Enhanced-Ctorrent
iptables -I INPUT 7 -p tcp --dport 2106:2706 -j ACCEPT

# Opening port for Telnet
iptables -I INPUT 7 -p tcp --dport 22 -j ACCEPT

# Opening port for SMTP (xmail)
iptables -I INPUT 7 -p tcp --dport 25 -j ACCEPT

# Opening port for POP3 (xmail)
iptables -I INPUT 7 -p tcp --dport 110 -j ACCEPT

# Opening port for Xmail
iptables -I INPUT 7 -p tcp --dport 8082 -j ACCEPT

# Opening port for SABnzbd
iptables -I INPUT 7 -p tcp --dport 8084 -j ACCEPT

# Opening port for Firefly
iptables -I INPUT 7 -p tcp --dport 3689 -j ACCEPT

# Opening port for Amule
#iptables -I INPUT 7 -p tcp --dport 4662 -j ACCEPT
#iptables -I INPUT 7 -p udp --dport 4665 -j ACCEPT
#iptables -I INPUT 7 -p udp --dport 4672 -j ACCEPT
#iptables -I INPUT 7 -p tcp --dport 4712 -j ACCEPT
#iptables -I INPUT 7 -p tcp --dport 4711 -j ACCEPT

And this:


# Start Xmail (pop/smtp)
/opt/etc/init.d/S43xmail start

Sollie.

sollie
30-05-2007, 17:44
This is my /opt/etc/init.d/S43xmail file:


#!/opt/bin/bash
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified by Davide Libenzi <davidel@xmailserver.org>
#
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
#

XMAIL_ROOT=/opt/var/MailRoot
#XMAIL_CMD_LINE="-SX 1 -Qn 1 -Yt 1 -Ln 1 -PX 1 -CX 1"
XMAIL_CMD_LINE="-Md -SX 1 -Qn 1 -Yt 1 -Ln 1 -PX 1 -CX 1 -Pl -Sl -Ql -Yl -Fl -Cl -Ll"
PATH=$XMAIL_ROOT/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/opt/bin/XMail NAME=XMail DESC="XMail server"

test -f $DAEMON || exit 0

set -e
ulimit -c 10000

start_xmail()
{
MAIL_ROOT=$XMAIL_ROOT
export MAIL_ROOT
MAIL_CMD_LINE=$XMAIL_CMD_LINE
export MAIL_CMD_LINE
$DAEMON $MAIL_CMD_LINE > /dev/null 2>&1 &
while [ ! -f /var/run/$NAME.pid ]
do
sleep 1
done
}

stop_xmail()
{
if [ -f /var/run/$NAME.pid ]
then
echo `date` > $XMAIL_ROOT/.shutdown
kill -INT `cat /var/run/$NAME.pid`
while [ -f $XMAIL_ROOT/.shutdown ]
do
sleep 1
done
fi
}


case "$1" in
start)
echo -n "Starting $DESC: "
start_xmail
echo "$NAME.[" `cat /var/run/$NAME.pid` "]"
;;
stop)
echo -n "Stopping $DESC: "
stop_xmail
echo "$NAME."
;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
echo -n "Restarting $DESC: "
stop_xmail
sleep 1
start_xmail
echo "$NAME.[" `cat /var/run/$NAME.pid` "]"
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

Sollie.

hal2k1
31-05-2007, 13:46
Thankyou sollie, with your help I am almost there now.

I have got xmail itself and telaen working. PHPxmail doesn't work for me.

I have a simple cms running: http://www.cmsimple.dk/

I even have a wiki site going: http://wiki.splitbrain.org/wiki:dokuwiki

So far, so good.

I noticed that CTCS now refers to Enhanced Ctorrent rather than just Ctorrent, so I thought I would give that a new trial ... and that is where I came unstuck again.

I wanted to make sure my Enhanced Ctorrent & CTCS were up to date ... and so I ran "ipkg update" ... no joy. Couldn't find the server.

It turns out that dnsmasq is working fine for all machines on the net except the WL700ge router itself.

Here is what I get on client machines:

$ ping ipkg.nslu2-linux.org
PING limax.nslu2-linux.org (140.211.167.165) 56(84) bytes of data.
64 bytes from limax2.osuosl.org (140.211.167.165): icmp_seq=1 ttl=52 time=232 ms
64 bytes from limax2.osuosl.org (140.211.167.165): icmp_seq=2 ttl=52 time=227 ms
64 bytes from limax2.osuosl.org (140.211.167.165): icmp_seq=3 ttl=52 time=232 ms

Here is what I get on the router:

$ ping ipkg.nslu2-linux.org
ping: ipkg.nslu2-linux.org: Unknown host

Dnsmasq doesn't work on the machine it is running on, apparently.

So now I'm stuck ... I can't figure out how to install or update packages!

sollie
31-05-2007, 16:45
I dont use CTCS, i use ECTC:

http://www.nslu2-info.de/showthread.php?t=4515

Read the whole post.

And i use this CMS:

http://cutephp.com

PS: DNSmasq isnt my thing.

Sollie.

hal2k1
01-06-2007, 13:49
I dont use CTCS, i use ECTC:

http://www.nslu2-info.de/showthread.php?t=4515

Read the whole post.

And i use this CMS:

http://cutephp.com

PS: DNSmasq isnt my thing.

Sollie.

OK, I got it working with dnsmasq ... kind of. I left udhcpd running, I killed the router's default dnsmasq, and I ran optware dnsmasq configure so as not to enable the DHCP part.

Now, the router can use dns, but the local lan clients don't know each other's address (no local lan dns lookups). Go figure.

Sollie, I tried csts again, and I can't figure out how to use it effectively.

I don't read German, so I had a lot of trouble following your link ... which was a link to a discussion on a board a lot like this one, only in German.

Are you able to give me a straight link to a downloadable file for ECTC? I couldn't find any such in the thread.

sollie
01-06-2007, 14:30
I am not German either, i am Dutch :)

http://www.nslu2-info.de/attachment.php?attachmentid=332&d=1179674437

Sollie.

hal2k1
02-06-2007, 06:32
I am not German either, i am Dutch :)

http://www.nslu2-info.de/attachment.php?attachmentid=332&d=1179674437

Sollie.

That link leads to a German site, and it appears to be asking me for a user name and password, which of course I do not have, and I can't read German, so I have no idea how to register.

I can't get to a download from your link. Is there any other way to get it?

back2basic
02-06-2007, 07:01
That link leads to a German site, and it appears to be asking me for a user name and password, which of course I do not have, and I can't read German, so I have no idea how to register.

I can't get to a download from your link. Is there any other way to get it?

http://wl700g.homelinux.net/drupal/index.php?q=node/61 :eek: :eek:

hal2k1
02-06-2007, 09:36
http://wl700g.homelinux.net/drupal/index.php?q=node/61 :eek: :eek:

Thanks. I'll give it a try shortly.

It does have a bit to compete with, though. At the moment, I have some aliases set up, "wl" -> 'ssh myusername@192.168.1.1' and, on the router device, "sc" -> 'screen -R'.

This means, for example, to start a straight download (either http or ftp), I copy the URL into the clipboard, open a console, type 'wl', then my password, and then I type 'screen wget ' and then crtl-v and then once it starts, I type ctrl-a ctrl-d ctrl-d. That is 16 keystrokes to start a download.

If it is a bittorrent, I just use rtorrent in place of wget.

To check progress, I start a console, type 'wl', then my password, then I type 'sc'. To exit from the check, I type ctrl-a ctrl-d ctrl-d.

Once you have got the hang of it, and you set up a few helpful aliases, the character-based interface isn't hard, and it is extremely quick.

I'm not sure even if I get a GUI going for enhanced-ctorrent that I would actually use it much, except if I want to start the box downloading while I was away and I only had a web browser. In that one use case, this might be the go for me.

hal2k1
05-06-2007, 15:49
I finally got dnsmasq configure how I wanted to. It involved telling dnsmasq not to use /etc/resolv.conf, but rather to use /opt/etc/resolv.conf. Then I put the wl700ge router IP and domain as the first "upstream" nameserver, then the two nameserver IP addresses from my ISP, and I also used the dynds domain name.

Finally, dnsmaq.conf now resolves local lan addresses both for other local lan clients and for the router itself! I have also got dnsmasq to supply fixed IP addresses based on mac addresses, and everything now hums along nicely. No more DNS-related pauses.

Telaen is very slow though. I think this has to do with the PHP server though.

hal2k1
21-06-2007, 16:45
Telaen is very slow though. I think this has to do with the PHP server though.

An update to this: I have abandoned both the lighttpd web server and the telaen web mail script.

I now use appweb for the web server (this is installable as optware):
http://www.appwebserver.org/

and I use IlohaMail for web mail access to the xmail mail server:
http://ilohamail.org/main.php

This is significantly faster, better and more reliable.

I am still using CMSimple
http://www.cmsimple.dk/

... but I may be persuaded now to use something a little more adventurous.