Hi
Can any one tell me how to enable or disable catch all user to a domain using the mailenable api.
I have tried to using the add address map for adding the catch all user for domain, it works, but when i try to remove the catch all user for the domain, all the other address mappings are also getting removed for the user
does any one have the solutions...
thaks and regards...
sandtech
Enable and disable catchall user to a domain using API
one thing that i noticed is that the RemoveAddressMap method updates the addressmap.tab file, but not the addressmap.bak file
good luck!
Code: Select all
Function RemoveCatchall(pstrPostoffice As String, pstrDomainName As String) As Integer
Dim MyAddressMap As New MEAOAM.AddressMap
MyAddressMap.Account = pstrPostoffice
MyAddressMap.SourceAddress = "[SMTP:*@" & pstrDomainName & "]"
MyAddressMap.DestinationAddress = ""
MyAddressMap.Scope = ""
'if the catchall exists, rename and remove
If MyAddressMap.EditAddressMap(pstrPostoffice, "[remove]", "[catchall]", "0") Then
MyAddressMap.Account = pstrPostoffice
MyAddressMap.SourceAddress = "[remove]"
MyAddressMap.DestinationAddress = "[catchall]"
MyAddressMap.Scope = "0"
RemoveCatchall = MyAddressMap.RemoveAddressMap
End If
Set MyAddressMap = Nothing
End Function
-
- Site Admin
- Posts: 1127
- Joined: Mon Jun 10, 2002 6:31 pm
- Location: Melbourne, Victoria, Australia
Since the RemoveAddressMap function accepts a wildcard, you cannot remove the catchall in one step. So as you see in sunposts post, you need to rename before removing.
The backup (.BAK) file is always 1 update out. It contains the contents of the TAB file before any change is made to the file (from an Edit/Remove/Add). So the backup is created before the edit is applied.
The backup (.BAK) file is always 1 update out. It contains the contents of the TAB file before any change is made to the file (from an Edit/Remove/Add). So the backup is created before the edit is applied.