0

거의 조직 외부의받는 사람으로 구성된 메일 그룹이 있습니다. 받는 사람 메일 호스트 중 하나의 문제로 인해 네트워크 외부에서 발생하는 From 헤더가있는 모든 메시지를 거부합니다. 따라서 [email protected]이 목록에 메시지를 보내면 [email protected]은 메시지를받지 못합니다. 따라서 메일 항목의 P1 및 P2 SMTP 및 메시지 봉투는 메일 그룹 자체의 주소가되도록 FromSender을 수정하는 전송 에이전트를 작성했습니다. 모든 것이 대부분 잘 작동합니다.Exchange 전송 에이전트 - 메시지 봉투의 DisplayName을 변경할 수 없습니다.

누가 전자 메일을 메일 그룹으로 보냈는지 알 수 있도록 전송 에이전트에서 P2 메시지 봉투의 표시 이름을 보낸 사람의 실제 전자 메일 주소로 설정해야합니다. 내 조직 외부 사람이 목록에 전자 메일을 보내지 만 발신자가 조직에있는 경우에는 작동하지 않습니다. 나는 이것을 RoutingAgentSmtpReceiveAgent으로 구현하려고 시도했으며 동작은 동일합니다. 내 로깅에서 내 조직 내부의 보낸 사람이 메시지를 처리하고 있음을 알 수 있습니다.

예상대로 동작하지 않는 사람은 누구입니까? 메시지가 저장소 Exchange로 배달 할 때 항상 이메일 주소가 GAL에서 EX 주소 항목을 다시 사용 해결할 수 있기 때문에 작동하지 않습니다 표시 이름을 변경

public void OnEndOfDataHandler(ReceiveMessageEventSource source, EndOfDataEventArgs eodArgs) 
{ 
    MailItem mailItem = eodArgs.MailItem; 
    EmailMessage message = mailItem.Message; 
    EnvelopeRecipient distributionList = AddressedToDistributionList(mailItem); 

    if(distributionList != null) 
    { 
     mailItem.FromAddress = distributionList.Address; 

     if (message.From.DisplayName == message.From.SmtpAddress) 
      message.From = new EmailRecipient(message.From.SmtpAddress.Replace("@", " at "), distributionList.Address.GetAddress(true)); 
     else 
      message.From = new EmailRecipient(message.From.DisplayName + " (" + message.From.SmtpAddress.Replace("@", " at ") + ")", distributionList.Address.GetAddress(true)); 

     if (message.Sender.DisplayName == message.Sender.SmtpAddress) 
      message.Sender = new EmailRecipient(message.Sender.SmtpAddress.Replace("@", " at "), distributionList.Address.GetAddress(true)); 
     else 
      message.Sender = new EmailRecipient(message.Sender.DisplayName + " (" + message.Sender.SmtpAddress.Replace("@", " at ") + ")", distributionList.Address.GetAddress(true)); 
    } 
} 

답변

관련 문제