Search

Wednesday, March 30, 2011

MailScanner Mail Archiving

System administrators usually face requests from user departments to retrieve backups of incoming or even outgoing emails.  The MailScanner provides some powerful options to archive both incoming and outgoing emails to email, directory or mbox files.
 
To turn on mail archiving, we use the 'Archive Mail' option.  It accepts a archive destination or a ruleset file as value.  For example:
 
Archive Mail = %rules-dir%/archive.rules
 
Ruleset allows more control on which and how emails are archived.  In the ruleset below.
 
FromOrTo:    user1@yourdomain.com    /var/spool/mailarchive/_DATE_.mbox
 
* Emails sent to user2@yourdomain.com will be bcc to backupemail@yourdomain.com.
* Emails originated from or sending to user1@yourdomain.com will be archived as one mbox file per day in /var/spool/mailarchive.  The _DATE_ token will be replaced with current day in yyyymmdd format.  There are other tokens available: _HOUR_, _TOUSER_, _TODOMAIN_, _FROMUSER_, _FROMDOMAIN_.
* Note that mbox file is created when 'Missing Mail Archive Is = file' is specified in the MailScanner.conf.  Otherwise, ms assumes that the location is a directory and archives emails as queue files under it.
 
To make changes effective, we need to restart MailScanner. 
service sendmail stop
service MailScanner stop
service MailScanner start
 
We stop sendmail manually to ensure that it is brought up by MailScanner so that ms can intercepts and filters emails before the smtp daemon.

Monday, March 21, 2011

Guideline to setup SIP trunk with ZONETEL

It is quite often to have customers inquiring the sip trunk configuration issues with ZONETEL.  Here is some useful information for reference.  Usually the tricky part is with NAT and firewall ports, which leads to one-way audio or no audio at all.
 

Sample sip.conf (it applies to asterisk 1.4.x)

[general]

Defaultexpiry=600

 

[zonetel]

Username=<provided by zonetel>

Fromuser=<provided by zonetel>

Secret=<provided by zonetel>

Host=<the sip register server provided>

Type=friend

Qualify=yes

Insecure=very

canreinvite=no

Disallow=all

Allow=alaw

Allow=ulaw

 

 

Ports required

Of course, your firewall needs to allow 5060 tcp/udp for sip signaling

And have to make sure that UDP ports are also allowed to the zonetel subnet