Search

Wednesday, June 15, 2011

Archive both incoming and outgoing emails in Sendmail/MailScanner

With MailScanner, we can archive incoming or outgoing or both easily.
 
Firstly, we indicate a ruleset file in the 'Archive and Monitoring' section of MailScanner.conf.
 
/etc/MailScanner/MailScanner.conf:
#
# Mail Archiving and Monitoring
# -----------------------------
#
Archive Mail = %rules-dir%/archive.rules
 
In the ruleset file, we specify a location to where emails are archived.  We can use 'From:/FromOrTo:/To:' to tell MS the scope of emails to archive.  In this example, all incoming and outgoing emails are archived to one single mbox file on daily basis.
/etc/MailScanner/rules/archive.rules:
FromOrTo:       *       /path_of_the_storage_location/_DATE_.mbox
 
The mbox format is accessible by many email clients.  Please see http://kb.wisc.edu/wiscmail/page.php?id=6436
 
 
 
 
 
 

Friday, June 03, 2011

Send fax over internet

Reasons:
 
There are a couple of reasons to send long-distance fax over internet.  Cost saving should be the primary one.  As fax data is transmitted over public internet, we do not need to pay IDD charge to telephone company.  In other cases, we just want to bypass the premise-provided telephone network, for instance, when we need to fax out from hotels or business centers. 
 
Apart from outbound fax, it can work in the reverse path; you can receive fax over internet.  Some internet fax service providers offer national fax numbers and forward incoming faxes over internet to you.  In other words, it gives your sender the impression of faxing to a local number.  Isn't it a beautiful feature?    
 
Nevertheless, you still have to pay some recurring charges such as subscription and rental fees to the internet fax service provider.
 
 
How to put things together:
 
fax-ip-explain
 
 
A typical scenario of sending and receiving fax over internet is shown above.  The fax machine on the left is the one you use for internet faxing.  It connects to a small networked device (we call it ATA) instead of a telephone socket on the wall.  The fax machine on the right is just an ordinary one.  The diagram basically involves four elements.
 
ITSP – Internet telephony service provider
This is the company that routes fax calls over internet to and from your fax machine.  You need to obtain a service account (we call it a SIP account) from them and configure it in a small device (ATA) to work with your fax machine.  The ITSP usually provides you a fax number for receiving fax.  Some examples of such ITSP are www.didforsale.com, www.didww.com, www.zonetel.com.
 
Telephone network – the part A above
It refers to the public switched telephone network (PSTN) that we use from day to day.  Our mobiles, landlines and fax machines are communicated within the PSTN.  The ITSP is usually a gateway (or it lines up another in behind) to PSTN and therefore could terminate your fax to and receive from an ordinary fax machine (the one on the right). 
 
Internet – the part B above
 
ATA – analogue terminal adatpor
It is provided by the ITSP and its purpose is connect your fax machine to them.  It is a small device that provides two ports, one for connecting your fax machine and one for internet connection.  Usually, the ATA device is pre-configured with a SIP account. The SIP account identifies you as a customer to them. 
 
Now, you operate your fax machine as usual and the internet part is handled by the ITSP.
 
 
More...:
 
We all heard or used Skype or similar products that transmit voice over internet to save phone bills.  We might not aware that the internet is not a stable and controllable environment in respect of bandwidth and latency.  Nowadays, voice over internet could be optimized by various techniques such as lossy codecs and jitter buffer to control the demand of bandwidth and handle network delay.  These are practical solutions because we are talking about voice  -- in fact, our ears still perceive good quality even there is data loss technically.  However, fax is different.  Fax machines need much better accuracy in order to handshake, to negotiate speed and to successfully transmit.  To tackle problems of fax over IP, a protocol named T.38 is developed by ITU.  The virtue of this protocol is it encapsulates the original T.30 fax protocol in IP packets.  Both sending and receiving fax machines are then thinking they are talking to a genuine fax.  T.38 is supported by many ITSP and ATA.  It is by now the industry standard of FOIP.
 
Yet the world is no perfect.  Even with T.38 enabled, we sometimes see failed transmission when internet bandwidth is unstable.  In addition, high speed transmission (such as the V.34 33.6kpbs) is not well supported in practice.