October 23rd, 2009

Below are regex patterns to match against valid latitude and longitude.

Both formats are based on Decimal coordinates.

Latitude range is from -90 to +90

Longitude from -180 to +180

For Latitude the regex pattern is

(-?[0-8]?[0-9](\.\d*)?)|-?90(\.[0]*)?

For Longitude use

(-?([1]?[0-7][1-9]|[1-9]?[0-9])?(\.\d*)?)|-?180(\.[0]*)?

This will also restrict the decimal values being > 0 for both +- 90′ and +- 180

October 30th, 2008

The Scenario:

You have an application that uses Simple MAPI (from Outlook) to send Faxes.  The I.T. department then introduce SBS / Exchange Server into the company to manage users email accounts. Now Faxing no longer works.You get a NDR everytime you try and send.   Strange though as you can still send directly through outlook so your software gets the blame.

Sample Non Delivery Report:

  Your message did not reach some or all of the intended recipients.

Subject:  E-MAIL FROM XXXXXXXX
       Sent:     10/25/2008 10:21

The
following recipient(s) could not be reached:

       '0XXXXXXXXXXXX' on
10/25/2008 10:21
The message could not be delivered because the
recipient's
destination email system is unknown or invalid. Please check the
address
and try again, or contact your system administrator to
verify
connectivity to the email system of the recipient.

<sbs.domain #5.1.2>

The Solution:

The problem is due to Exchange attempting to send the fax BEFORE the Fax transport gets a chance to.

To fix this, you need to make a registry modification on each workstation affected.

So in REGEDIT navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\Common\MailSettings

and ADD a new DWORD key named StrictAccountOrder   

Set the value to 1

You may have to restart Outlook for the change to take affect but that should solve the problem.  Outlook will correctly identify the Fax transport before trying to send the Fax via Exchange.

Further reading can be found here http://support.microsoft.com/kb/319820

July 9th, 2008

Recently I’ve noticed quite a few new spam messages making through my mail server into my mailbox so time to update Spam Assassin and let it know what its missing:

1. I have a seperate mailbox I access explicitly for the purpose of holding Spam, so when my personal junk email folders have a significant amount of real spam in which dont have the ***SPAM*** mark, I move them over to the Spam mailbox.

2. Logging into my mail server as root, I can then proceed to the mailbox store, and inform spamassassin that everything in there should be treat as spam.   It’s always a good idea to double check the mail though !

3. Command I use to inform SpamAssassin is the sa-learn command :

 sa-learn –spam –progress <path-to-spam-mailbox>


About Me

Welcome to my blog. Here you'll find mainly work related content, a suppository for all my notes which otherwise would end up on a post it note.