Wednesday, February 21, 2007

qpsmtpd for anti-spam

Here are the steps to use qpsmtpd:

Get qpsmtpd from http://smtpd.develooper.com/
Extract and put for example on /usr/local/qpsmtpd
Change the port number of currently running qmail from 25 to, for example, 2525
Put (or uncomment) the following line on /usr/local/qpsmtpd/config/plugins
queue/smtp-forward localhost 2525
Make a symbolic link from daemontools' service directory to /usr/localqpsmtpd

The qpsmtpd will then run with default plugins. A list of plugins can be found at http://wiki.qpsmtpd.org/plugins

Here are some plugins that require extra work to set:

check_validrcptto_cdb
This plugin can be downloaded from http://robinbowes.com/projects/check_validrcptto_cdb. This plugin requires a database (cdb file) of valid recipient addresses, which can be made with mkvalidrcptto and cdbmake-12 program, a part of djb's cdb package. A cron job as follows will then periodically make the list of valid RCTP TO addresses and turn into cdb file:



#!/bin/sh
PATH=/usr/bin:/bin:/usr/local/bin:/var/qmail/bin
cd /var/qmail/control

if [ ! -f validrcptto.txt ] ; then touch validrcptto.txt ;

fi mkvalidrcptto > validrcptto.new if ! diff validrcptto.txt validrcptto.new > /dev/null 2>&1
then
cdbmake-12 validrcptto.cdb tmp$$ < validrcptto.new chmod 644 validrcptto.cdb validrcptto.new
fi

mv -f validrcptto.new validrcptto.txt



Then put this line on /usr/local/qpsmtpd/config/plugins
check_validrcptto_cdb /var/qmail/control/validrcptto.cdb

References:
O'Reilly Using Qpsmtpd

Wednesday, February 14, 2007

Replacing SCCP to SIP on Cisco IP 7960

I got time (and enough motivation) to finally got rid of the SCCP firmware inside this Cisco IP 7960 that has been idle for years.


1. Setup a TFTP server
2. Put these files on the TFTP server
OS79XX.TXT
*.bin
(E.g., for v6.3, the file is P0S3-06-3-00.bin)
3. Set 7960 for firmware update
Press **# at the main window of 7960 to unlock the phone, then set DHCP to yes, and alternate to TFTP to yes. Then, press "*","6",Setting buttons at the same time to reboot. The 7960 will then boot with SIP firmware
4. Put these files on the TFTP server
OS79XX.TXT
SIPDefault.cnf
dialplan.xml
RINGLIST.DAT
5. Set the 7960 for SIP setting
Press "*","6",Setting buttons at the same time to reboot again. The 7960 will then booth with SIP settings according to the contents of SIPDefault.cnf and SIP<MAC addresss>.cnf (for example, SIP000B46CABF9F.cnf if the MAC address of the 7960 is 000B46CABF9F)




References:
Configuring Cisco 79xx phones with Asterisk
Cisco 7960 IP Phone - SIP firmware version
Using Cisco IP Phones with Asterisk
Cisco IP Phone 7960 Administrator Guide for SIP, Version 1.0
Cisco IP Phone 7960 Administrator Guide for SIP, Version 2.0
SIP IP Telephone 7940/7960 Software

Asterisk + VP-1000 + Cisco IP 7960

I got Windows server, Fletsphones and Cisco phones, and I got account on Voipbuster with free calls to Japan and other countries. Why can't I make free calls from these phones? So here is my try at Asterisk.

1. Install Trixbox (formerly Asterisk@Home)
Since Trixbox is CentOS based, and I don't have a free machine, I took a VMware image found here, (See "Introducing A Plug-And-Play Asterisk PBX for Windows") and run it on top of a Windows server via VWware Player. Note: set the VMware player to use NAT and DHCP.

2. Setup Asterisk to use Voipbuster account as outgoing trunk
Open freePBX interface of Trixbox, then click on "Trunks" menu. Make a little tweak to "SIP/voipdiscount" trunk just for quick test as follows:

PEER details:
allow=ulaw&alaw
authuser=asiboro
disallow=all
fromdomain=voipbuster.com
fromuser=<username>
host=sip.voipbuster.com
insecure=very
nat=yes
qualify=yes
secret=<password>
type=peer
username=<username>

Register string
<username>:<password>@sip.voipbuster.com


Adjust dialplan strings on both "Trunk" and "Outbound Routes".


3. Setup VP-1000
Setup VP-1000 to use Asterisk as SIP proxy/registrar. For example, use the pre-set number 500 (password 1234). Then VP-1000 can dial to whatever number allowed by dialplan via Voipbuster.



4. Setup Cisco IP Phone 7960
This is a bit not straightforward, since 7960 is shipped with SCCP ("Skinny" protocol) firmware by default, and this one is no exception. Though some people say that Asterisk can support Skinny protocol, it's a lot easier if the firmware is replaced with SIP firmware. So I replaced SCCP to SIP and the rest is like setting any SIP user agent.