Use white lists and black lists

<< Click to Display Table of Contents >>

Navigation:  How to... >

Use white lists and black lists

In most of the advanced gateway and connector settings in Diafaan SMS Server white list and black lists can be used to allow or block messages from or to specific numbers or number ranges.

 

Note: The uniform white list/black list was introduced in Diafaan SMS Server 4.2.0.0. White lists in gateways and connectors that were created in older versions can still behave in the original way. White lists in gateways and connectors that are created in Diafaan SMS Server version 4.2.0.0 or higher and white lists that start with a header bracket ( [ ) all conform to the new format.

 

Sections

Each section of the white list consists of a header and a list of numbers or keywords, one number/keyword on each line. The header specifies how the numbers/keywords are interpreted, as a white list or black list, case sensitive or case insensitive etc.

 

Headers

The header appears on a line by itself, in square brackets ('[' and ']'). Each header contains one or more options, separated by comma's, that define how the number list below it is handled. The header can contain the following keywords:

allow                Allow the numbers/keywords in the list (default)

deny                Block the numbers/keywords in the list

break                Stop processing the rest of the list when a match is found (default)

nobreak                Continue processing the rest of the list when a match is found

ignorecase        Ignore upper and lower case differences in the match (default)

enforcecase        Only allow an exact match

 

If the header contains a valid file name and if it is on the first line of the list then the file is used as the white list/black list and the rest of the list is ignored. The file must have the white list/black list format as is described in this text.

 

Number list

Under each header is a list of numbers or keywords, one number or keyword on each line. The numbers may contain the wildcard characters '*' (zero or more characters),  '?' (a single character) and '#' (a single digit) to define a number range instead of a single number.

 

If the line starts with 'regex:' the rest of the line is handled as a regular expression.

 

 

Example 1

 

Allow only German and British numbers except number +49123456789:

 

[allow,nobreak]

+49*

+44*

 

[deny]

+49123456789

 

 

Example 2

 

Use the file 'C:\temp\whitelist.txt' as the white list and/or black list:

 

[C:\temp\whitelist.txt]

 

 

Example 3

 

Allow only valid email addresses (using a regular expression) but block gmail.com email addresses:

 

[allow,nobreak]

regex:\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b

 

[deny]

*@gmail.com

 

 

Example 4

 

Allow only valid Dutch mobile numbers:

 

[allow]

+316########

 

 

Example 5

 

Allow only numbers +49123456789 and +49987654321 (without a header, see the note at the top of this page)

 

+49123456789

+49987654321