Zitat:
Original geschrieben von gscht
Hi Darkmind
Wird dort der Username eingetragen, z.b. mailadmin oder Administrator???
|
hoi gscht...
meinst du den Postfachnamen anstatt
bob@example.com ?
wenn ja, dann jep
Code:
'
' For information about this namespace, see
' http://msdn.microsoft.com/library/de...tpenvelope.asp
'
Const RECIP_LIST = "http://schemas.microsoft.com/cdo/smtpenvelope/recipientlist"
'
' For information about the CdoEventStatus enumeration, see
' http://msdn.microsoft.com/library/de...tatus_enum.asp
'
Const CDO_RUN_NEXT_SINK = 0
'
' OnArrival sink entry point
'
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
On Error Resume Next
Dim objFields
Set objFields = Msg.EnvelopeFields
objFields(RECIP_LIST).Value = FixupRecipList(objFields(RECIP_LIST).Value)
objFields.Update
Msg.DataSource.Save ' Commit changes
EventStatus = CDO_RUN_NEXT_SINK
End Sub
'
' Change any @example.com recipient(s) to bob@company.com
'
Function FixupRecipList(strList)
On Error Resume Next
Dim strFixedList
Dim nDomainPart
Dim nNamePart
Dim nNextAddress
strFixedList = strList
While (InStr(LCase(strFixedList),"@supi.ch"))
nDomainPart = InStr(LCase(strFixedList),"@supi.ch")
nNamePart = InStrRev(strFixedList,";",nDomainPart)
nNextAddress = InStr(nDomainPart+Len("@supi.ch;"),strFixedList,"SMTP:")
If (0 = nNamePart) Then
' @example.com is first name in recipient list
If (0 = nNextAddress) Then
' @example.com is the last name in the recipient list
strFixedList = "mailadmin@supi.ch;"
Else
' @example.com is not the last name in the recipient list
strFixedList = "SMTP:mailadmin@supi.ch;" & Right(strFixedList,Len(strFixedList)-nNextAddress+1)
End If
Else
' @example.com is not the first name in recipient list
If (0 = nNextAddress) Then
' @example.com is the last name in the recipient list
strFixedList = Left(strFixedList,nNamePart) & "SMTP:mailadmin@supi.ch;"
Else
' @example.com is not the last name in the recipient list
strFixedList = Left(strFixedList,nNamePart) & "SMTP:mailadmin@supi.ch;" & Right(strFixedList,Len(strFixedList)-nNextAddress+1)
End If
End If
Wend
FixupRecipList = strFixedList
End Function
habs dir noch per mail versandt, kopiere den code keinesfalls von hier heraus.
so würde ich es machen, doch kopiere das script vo msxfaq und schreibe die gewünschte domain nochmals alle rein.
Grüsse
Darkmind