SYNC_MODE = 1: Consider all AD mailboxes for synchronization
SYNC_MODE = 1: Sync all users
Sync all users and shared mailboxes (SM) for Email-to-Fax and Fax-to-Email
Sync all users/SM only for Email-to-Fax
Sync all users/SM only for Fax-to-Email
Sync only users/SM with a fax number entry for Email-to-Fax (alphanumeric or numeric)
Sync GraphAPI parameters for writing customized headers
Sync GraphAPI parameters for enabling customized cover sheets
Sync number blocks (Retarus-side blocks)
Var1: m2f_enabled
Datatype: bool
true | Enables all mailboxes for Email-to-Fax synchronization. The actual synchronization depends on the variable M2F_sync_just_users_with_faxnumber. If this variable is set, not all mailboxes will be synced for Email-to-Fax. |
false | Mailboxes will not be synchronized for Email-to-Fax. |
Var2: profile_name_m2f
Datatype: string
Name of the profile in the Retarus EAS Portal.
The profile must be set up in the EAS Portal before the first synchronization.
Use a lowercase letter as the first letter of the name.
Default in sample code:
profile_name_m2f = "mail2Fax"
Var3: M2F_sync_just_users_with_faxnumber
true | For Email-to-Fax, only mailboxes with at least one fax number entry—either alphanumeric or numeric—will be considered for synchronization. |
false | All mailboxes are synced for Email-to-Fax, even if they don’t have a fax number entry. The CSID from the profile where the mailbox is listed will be used as the CSID. |
Var4: params_coversheet
Defines the Microsoft Graph API parameters to be synced for use in the Email-to-Fax cover sheet.
Example
To sync
givenName
andsurname
for cover sheet usage:string[] params_coversheet = {"givenName", "surname"}
If no cover sheet is used:
string[] params_coversheet = {}
Microsoft Graph API parameters are always lowercase. Use Graph API parameter names, not the Exchange Admin Center names (see Graph API dictionary table and definitions). The sample code automatically prefixes "s_" to every Microsoft Graph API parameter in the m2f.csv
file to distinguish between standard parameters and customized ones.
Example
The Graph API parameter "givenName"
appears in m2f.csv
as "s_givenName"
.
The sample code generates a unique list of cover sheet parameters across all synced groups. Different groups may:
Have the same cover sheet parameters.
Have completely different parameters.
Have only a subset of other groups' cover sheet parameters.
Cover sheet parameters not relevant for a specific group appear as empty fields in the final m2f.csv
for mailboxes in that group.
Var5: header
Datatype: string
The header can be user-specific or non-user-specific.
A fax header from Retarus may appear as follows. In this example, the date and time, along with the page indicator on the right, are added during fax creation. The sender's fax number (highlighted in yellow) is a user-specific parameter synchronized from Active Directory.

For more details on the available options for Retarus Email-to-Fax headers, refer to the Email-to-Fax documentation or contact your Retarus Technical Consultant or Implementation Engineer.
Examples
Non-user-specific header:
Initialize the header under//3. CONFIGURE THE MODE
:string header = "{DateTime.Now:0f dd.MM.yyyy HH:mm %C}" + "%r%P/%T";
User-specific header:
Initialize an empty string:
string header = "";
Search for
"PERS_HEADER_MODE1"
in the sample code and write or uncomment the line that assigns a value toheader
, such asheader = ...
// PERS_HEADER_MODE1: WRITE/UNCOMMENT CODE BELOW IF A USER-SPECIFIC HEADER
// SHOULD BE USED
// header = "{DateTime.Now:0f dd.MM.yyyy HH:mm %C} " + user.surname + " %r%P/%T";
Var6: f2m_enabled
Datatype: bool
Value | Description |
---|---|
True | Sync mailboxes for Fax-to-Email |
False | Don’t sync mailboxes for Fax-to-Email |
Var7: profile_name_f2m
Datatype: string
Default: string profile_name_f2m = "fax2mail";
In the Retarus EAS Portal, the profile name must be manually configured before starting the synchronization of mailboxes.
Var8: forwarding_enabled
Datatype: bool
Value | Description |
---|---|
True | Enables fax forwarding scenarios. This setting must be configured if at least one user has:
If two or more users in a Fax-to-Email setup share the same fax number, the sample code assumes that all these users should receive the fax via email. In this case, it is necessary to set |
false | Does not enable forwarding scenarios. This setting allows for the following configurations:
If two or more users in a Fax-to-Email setup share the same fax number, the sample code assumes that all these users should receive the fax via email. In this case, it is necessary to set |
Var9: extension_length
Datatype: int
Defines the fax number block length (e.g., 4
for a block of 10,000
numbers) within a group's number block.
The sample code synchronizes:
The number block (f2m.csv parameter:
"block-name"
)The extension (f2m.csv parameter:
"extension"
) separately.
In forwarding scenarios, this separation applies to the C-number (Retarus forwarding number), not to the display number (B-number).
Var10: mode1_multiRecipients
Datatype: bool
Value | Description |
---|---|
True | The sample code supports multiple recipients, meaning that if two or more users share the same fax number, all associated mailboxes will receive the fax via email. Example For fax number +1123456789, the fax will be delivered to: In this scenario, an intermediate file is created to list all Fax-to-Email recipients. This file is then reloaded to correctly map multiple recipients to a single Fax-to-Email fax number (or forwarding scenario). See also f2m_interm_document in the diagram below. |
False | Only set to |
The following logic outlines two scenarios with examples:
Mode1_multiRecipients = true
→ An intermediate CSV is created, and fax recipients are merged.Mode1_multiRecipients = false
→ No intermediate CSV is created, and fax recipients are overwritten.
Consequence
If you expect that one or more fax numbers in your Fax-to-Email implementation might have multiple recipients—now or in the future—set:Mode1_multiRecipients = true

Var11: faxNumberField
Datatype: string
Default: faxNumberField = "faxNumber"
Defines the source for the alphanumeric CSID or one or multiple numeric fax numbers/CSIDs.
This parameter specifies the Microsoft Graph API field in the Entra Admin Center that holds fax number/CSID information for this group. The sample code allows fax number information to be stored in either:
businessPhones
faxNumber
See also Graph API dictionary table and definitions.
Examples
Fax number or CSID information stored in the businessPhones field:
faxNumberField = "businessPhones"
Fax number or CSID information stored in the faxNumber field:
faxNumberField = "faxNumber"
Using the businessPhones field instead of a dedicated fax number field to store CSID or fax number information follows a traditional approach. In this setup, a user's fax number is associated with their business phone number through an extension prefix. For example:
Business phone:
+49 12345678 – 1234
Fax number:
+49 12345678 – 5 – 1234
In such cases, some customers may prefer to use the businessPhones field directly for fax numbers. This approach can be supported by the functionalities extension_length and extension_prefix.
Var12: extension_prefix
Datatype: string
Default value: extension_prefix = ""
Defines a prefix for fax number extensions. This is applicable when the fax number is derived from the business phone number within a specific group.
Example
Business phone:
+49 12345678 – 1234
Fax number:
+49 12345678 – 5 – 1234
In this case, the extension_prefix would be extension_prefix = "5"
.
If this functionality is not used, set extension_prefix = ""
.
Var13: add_countrycode
Datatype: bool
Default value: add_countrycode = false
Adds the country code to the detected fax number(s) of this group.
Value | Description |
---|---|
True | Adds the country code to the detected fax number of this group. The code detects whether an alphanumeric CSID or a numeric CSID/fax number is used. A country code is not added to alphanumeric CSIDs. If a user has multiple fax numbers, each fax number will receive the country code (does not apply to C-numbers in forwarding scenarios). In forwarding scenarios Fax numbers that do not already contain a country code can be written with or without a leading zero. If a leading zero is used, it will be removed, and the country code specified in Countrycode will be added. The only hardcoded exception where the leading zero is retained is when the country code is Italy (39). In Italy, leading zeros are local prefixes that must not be removed, and the country code serves as a prefix for the entire stored number. |
False | No country code is added to the group's mailbox fax number(s). |
Var14: countrycode
Datatype: string
If this feature is required, enter a country code without "+" or "00" (e.g., "1"
for the US or "49"
for Germany). Do not add "+"
or "00"
.
Examples
To add the country code
"55"
:countrycode: "55"
To avoid adding a country code:
countrycode: ""
(not necessary ifadd_countrycode: false
)
Fax numbers that do not already contain a country code can be written with or without a leading zero. If a leading zero is used, it will be removed, and the country code specified in Countrycode will be added.
The only hardcoded exception where the leading zero is retained is when the country code is Italy (39). In Italy, leading zeros are local prefixes that must not be removed, and the country code serves as a prefix for the entire stored number.