Quantcast
Channel: Exchange Server Development forum
Viewing all 7132 articles
Browse latest View live

c1034a07 - This recipient already has an email address

$
0
0

Hi,

I'm in the process of migrating an Exchange 2003 domain to Office 365 and following the steps provided by the Office 365 team I've hit a problem with one mailbox when running a script which disables/disconnects the on-premise mailbox and converts the user to a mail-enabled user.

I asked the question here (https://social.technet.microsoft.com/Forums/exchange/en-US/612c159a-2d95-4659-b998-dc00d6f36392/converting-mailbox-user-to-mail-enabled-user-meu?forum=exchangesvrgenerallegacy) but was told that this might be a better forum to answer the question.

The script which Office 365 provided failed the first time it ran so when it re-ran the first user in the batch was skipped and has not been mail-enabled.  When I try to re-run the script (I've commented out the command to delete the mailbox as that has already been done) it fails with the error above when the user object is mail-enabled.

	'Mail Enable the User
	WScript.Echo "Opening " & userADSIPath & " as CDOEXM::IMailRecipient"
	Set MailUser = MyUser
	WScript.Echo "Mail Enabling user using targetAddress " & User.CloudEmailAddress
	MailUser.MailEnable User.CloudEmailAddress
	WScript.Echo "Disabling Recipient Update Service for user"
	MyUser.PutEx ADS_PROPERTY_APPEND, "msExchPoliciesExcluded", Array("{26491CFC-9E50-4857-861B-0CB8DF22B5D7}")
	WScript.Echo "Saving Changes"
	MyUser.SetInfo
	WScript.Echo "Refreshing ADSI Cache"
	MyUser.GetInfo

Can anyone tell me how I can mail-enable a user manually either via a script, modification of the user object via ADSIEdit or via ESM?


Exchange 2010 (no service pack) Eml body of email is present in file but empty in outlook

$
0
0

We use an exchange agent to save some of the send emails to disk. However the exchange againt writes an (html-)email to disk that cannot be opened by outlook correctly.

Everything is in the file we presume judging by the contents when inspecting it with notepad++. However when we open the file in outlook it opens loads all the info of the email except the body of the email itself. Attachments in the email are shown.

We tried some changes to the sending process. When changed to rtf and plaintext there are no problems opening the file. However this is a undiserable solution.

Therefore we send the same email in the 3 formats available in outlook 2010: plaintext,rtf and the not working html format. All three files are nearly identical except the obvious differences noted below.

Differences:

  • Time send
  • Original Size
  • Message-ID
  • TNEF-Correlator
  • The Winmail.dat attachment(this part contains the body of the email)

For an html email send with an attachment the attachment is recognized by outlook showing that the winmail.dat is readable.
However the body is not readable.

We tried to force Exchange to use the rich-text format, without any effect on the emails.

The piece of code writes the email to disk before encrypting it:

using (var ms = mailItem.GetMimeReadStream())
{
  using (var fs = new
  FileStream(@"c:\temp\email.eml",FileMode.Create))
  {
    Write(ms, fs);
  }
}  

In this piece of code below we open the email after it is encrypted. The code is highly shortened.

Code:

var result = binaryFormatter.Deserialize(memoryStream) as ExtractedEmailInfo; //At this point we have read the file and decrypted it
result.Body ; //has a value and is filled with the correct emailbody

The result of the code suggests that the file has no problems of its own, but it's merely outlook not working as intended.

Any suggestions as to look where the problem might be and what possible solutions there are to fixing the problem?



EWS client built for Exchange 2007 no longer working since moving to Exchange 2013

$
0
0

Hello, 

I have an EWS client built in JAVA which calls the GetUserAvailability and CreateItem operations. SOAP requests are sent over HTTPS. A service account is supplied which satisfies authentication challenges.

The client was built against Exchange Server 2007. Now the infrastructure is moving to Exchange 2013. Initially testing has surfaced an issue connecting and fetching FREEBUSY data from Exchange 2013. 

Exchange 2013 returns a 400 exception when I attempt to fetch FREEBUSY data for an existing mailbox. The same client returns data when pointed against the 2007 server. 

Can someone advise if the SOAP request for Exchange 2013 requires some additional header information ( compared to 2007 request)? 

Including a copy of the request i send incase someone sees something which i should change

<?xml version="1.0" encoding="utf-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"><TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types"><Bias>0</Bias><StandardTime><Bias>0</Bias><Time>01:00:00</Time><DayOrder>4</DayOrder><Month>10</Month><DayOfWeek>Sunday</DayOfWeek></StandardTime><DaylightTime><Bias>0</Bias><Time>01:00:00</Time><DayOrder>4</DayOrder><Month>3</Month><DayOfWeek>Sunday</DayOfWeek></DaylightTime></TimeZone><MailboxDataArray><MailboxData xmlns="http://schemas.microsoft.com/exchange/services/2006/types"><Email><Name/><Address>adress@example.com</Address><RoutingType>SMTP</RoutingType></Email><AttendeeType>Required</AttendeeType><ExcludeConflicts>false</ExcludeConflicts></MailboxData></MailboxDataArray><FreeBusyViewOptions xmlns="http://schemas.microsoft.com/exchange/services/2006/types"><TimeWindow><StartTime>2015-08-29T14:00:00.000Z</StartTime><EndTime>2015-08-29T16:00:00.000Z</EndTime></TimeWindow><MergedFreeBusyIntervalInMinutes>30</MergedFreeBusyIntervalInMinutes><RequestedView>FreeBusy</RequestedView></FreeBusyViewOptions></GetUserAvailabilityRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

 


Access is denied when connect to Remote Exchange in WCF

$
0
0

I have 4 serves:

  1. Server A containts Active Directory.
  2. Server B containts Exchange Server.
  3. ServerC containsIISto configureWCF serviceto connect to theExchange Server.
  4. Server D to developer.

Ideveloped a winformapplicationto connect to theEXandcreated a groupover there,Iranon machineCandDwere successful. This connect to EX success and create group successful.

Then i developed a WCF service and public in server C, i call this WCF services, it log: Access is denied when connect to Exchange Server. But with WCF solution, i debug it in IID of visual studio, it was successful.

Someone help meunderstandwhere error? The codeconnectsto Exchange Serverandcreate group in WCFsimilar with winform.

EWS Managed API - update appointment - 'At least one recipient isn't valid.' during update item with invitation mode set to SendToNone on Exchange 2013

$
0
0

Hi All,

My team works on a managed EWS API based solution but we've found a behavior of the managed EWS API that we can't explain based on dev documentation (maybe we've missed or misunderstood something). 

The problem is that the following piece of code throws 'At least one recipient isn't valid.' error in the line "up.Update"

I don't have any recipients for the appointment so that's true that there is no valid recipient but on the other hand I set the invitation mode to SendToNone so the update changes shouldn't be sent to any recipient.  That's is also interesting why  the behavior is different when SendToNone is used during creation and SendToNone during updating (the commented out lines). The update works fine in this case.

try
{
    var ap = new Appointment(service);
    ap.Start = new DateTime(2014, 1, 31, 10, 0, 0);
    ap.End = new DateTime(2014, 1, 31, 11, 0, 0);
    var r = new Recurrence.RelativeYearlyPattern();
    r.DayOfTheWeek = DayOfTheWeek.Friday;
    r.DayOfTheWeekIndex = DayOfTheWeekIndex.Last;
    r.Month = Month.January;
    ap.Recurrence = r;
    ap.Recurrence.StartDate = new DateTime(2014, 1, 31, 23, 30, 0);
    ap.Subject = "abc";
    // ap.Save(WellKnownFolderName.Calendar, SendInvitationsMode.SendToNone);
    ap.Save(WellKnownFolderName.Calendar, SendInvitationsMode.SendOnlyToAll);
    var up = Appointment.Bind(service, new ItemId(ap.Id.UniqueId));
    up.Recurrence = new Recurrence.DailyPattern(new DateTime(2014, 1, 29), 3);
    up.RequiredAttendees.Add("Administrator@DevExch2013.local");
    // up.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendOnlyToAll);
    up.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);
}
catch (Exception e)
{
    Console.WriteLine(e.Message);
}

The problem seems to only occur on Exchange 2013. We have also two test boxes with Exchange 2013 and the behavior also slightly differs between the boxes. On the first test box the problem occurs always but on the second one the problem only occurs in  specific appointment configurationd. I've never configured exchange 2013 myself so I don't know if there is any parameter during set up that may impact this behavior.

Does anybody see any problem with the above code?

Thanks in advance for help

EWS Managed API - How to add a group to the delegates?

$
0
0

Hi,

I try to add users and groups to the delegates via the EWS API. There is no problem with user but I can not add groups. How can I add groups via the EWS? Thank you for your help.

[E2010][EWSMA][C#][Windows Server 2008 R2]: How do I authenticate with client certificates?

$
0
0

I am looking for a secure way to have my client application authenticate against an Exchange Server instance. I noticed the API appears to support using an X509 certificate as its credentials, however I cannot find any resources outlining the use of this class, let alone using certificates as a method of authenticating.

The idea is that the client application logs in as a user on the server's domain and impersonates accounts of users in a specified group to access their mailboxes. Now this works just fine when I specify the username/password in code (i.e. using WebCredentials), but I don't want plaintext passwords anywhere near my code.

Right now there are a couple of constraints I'm working with:

  • The client and server are on separate domains, with no trust between them
  • The certificate must authorize the client application to perform actions on behalf of a user in the server's domain

I have issued certificates for client authentication from the CA on the server's domain and exported them to the client computer, but I am getting HTTP 401 errors when the API makes calls to impersonate other users. The certificate is self-signed, but while I'm developing I'm short-circuiting the certificate validation logic to ignore this. Right now I'm trying to determine if IIS client-certificate mapping is appropriate, but am struggling with the documentation.

Does anyone know if it's possible to use certificates as credentials in the EWS API, and if so, how I can issue a certificate to accomplish this? The documentation on this seems sparse at best, so if you have any resources you can point me to it'd be much appreciated.

Thanks!


EWS: how to get the subject from free/busy

$
0
0

Dear all,

unfortunately I did not find a solution from the other threads.

I'd like to create activity reports for a group if users, so I need to get their calendar entries to create a time line very similar to Outlooks Calendar view for a team. We already implemented a share free/busy hsaring policy so I can view this for a team from Outlooks default calendar view.

If you had a look to the xxx's team it will display you the free/busy information (?) view, reporting start and end dates for a meetings as well as the subject of the meeting. Obviously you do not need more permissions that free/busy with subject to get a view like that in Outlook.

I tried the same using the EWS managed API using a statement like

service.GetUserAvailability(attendees, new TimeWindow(start, end, AvailabilityData.FreeBusyAndSuggestions, availabilityOptions);

which will return a list of free/busy information, but the subject is missing. On the other hand, the findinfolders method returned an "Access denied" if you are sharing free/busy only and you do not grant additional permission.

How to receive the subject for a meeting in this situation?

Thanks for your response,

Martin


Command to export events/appointments for all user

$
0
0
Is there any command through which I can export events/appointments for all the users of the org ?

just trying to connect to exchange 2013 using C# console...

$
0
0

I'm trying to connect to a mailbox on the exchange 2013 server to grab, move attachments and then remove email.
So I figured I start with the basic..  installed the MS Exchange Reference libraries..
Using MS exact code example online..it doesn't work at all.  I get error: need to find webcredentials.cs, when i'm try to verify that so far everything that is working (debug stepping)..
What I need to do..- first get to server, next get to mailbox, next find first email, move attachment, delete email and get next email (loop)...
But I keep getting a error and to be honest, I have no idea why it's appearing.

using Microsoft.Exchange.WebServices.Autodiscover;
using Microsoft.Exchange.WebServices.Data;
using Microsoft.Exchange.WebServices.Auth;

namespace Exchange2
{
    class Program
    {
        static void Main(string[] args)
        {
            ExchangeService service = new ExchangeService();
            service.Credentials = new WebCredentials("user@domain.com", "Pa$$w0rd");
            service.AutodiscoverUrl("user@domain.com");

 }
    }
}

Can anyone help this newbie?

Is there a way to Get/Send email using exchange webservice without using autodiscover?

$
0
0

I have been trying to use the code in powershell below to test a send email using the webservice.

As it appears according to this tool.

https://testconnectivity.microsoft.com

Autodiscover is not setup.. which I'm being told it is, but the tool tells me another story...

Well, I would rather bypass the Autodiscovery item if at all possible...

code sample:

using System;
using Microsoft.Exchange.WebServices.Data;

 


namespace HelloWorld
{
  class Program
  {
    static void Main(string[] args)
    {
      ExchangeService service = new ExchangeService(ExchangeVersion.Exchange<version and SP> );
      service.EnableScpLookup = false;
      service.Credentials = new WebCredentials("username", "pass", "domain");

     

      service.TraceEnabled = true;
      service.TraceFlags = TraceFlags.All;

// # Commented out service.AutodiscoverUrl("Email account");


     service.Url = "https://<exchange url>/EWS/Exchange.asmx";

      EmailMessage email = new EmailMessage(service);

      email.ToRecipients.Add("<a href="mailto:emailaccount@.com">emailaccount@<email>.com");

      email.Subject = "HelloWorld";
      email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API");

      email.Send();
    }
  }
}

Please let me know if it is possible not to use autodiscovery .... and if there is a way to get this code to send email.. As I would later add a step to get the email downloaded to a sharepoint and or a file once I'm able to access the inbox.

EWS Attachment Name Incorrect

$
0
0

We are encountering an issue with EWS 2.2 Managed API(and previous versions) and attachment names.  EWS exposes two potential fields for an attachment name.  Name, and FileName.  In our findings, Name can sometimes report the same file name we see in mail clients (such as Outlook), and FileName is always black (Nothing in VB.NET).

The XML request and responses are output from the "ExchangeService.TraceEnabled = True" and "ExchangeService.TraceFlags = TraceFlags.All" options.

XML request example:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><t:RequestServerVersion Version="Exchange2010_SP2" /></soap:Header><soap:Body><m:GetItem><m:ItemShape><t:BaseShape>IdOnly</t:BaseShape><t:AdditionalProperties><t:FieldURI FieldURI="item:Attachments" /></t:AdditionalProperties></m:ItemShape><m:ItemIds><t:ItemId Id="biglongItemId" /></m:ItemIds></m:GetItem></soap:Body></soap:Envelope>


EWS XML response:

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="195" MinorBuildNumber="1" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><m:ResponseMessages><m:GetItemResponseMessage ResponseClass="Success"><m:ResponseCode>NoError</m:ResponseCode><m:Items><t:Message><t:ItemId Id="biglongItemId" ChangeKey="CQAAABYAAAB6Lqmbg0p2SpXlhlOVcY4TAAAnDxiX" /><t:Attachments><t:FileAttachment><t:AttachmentId Id="biglongAttachmentId" /><t:Name>body.csv</t:Name><t:ContentType>text/plain</t:ContentType><t:ContentId>{6981D03B-2EBD-4F8F-BF8D-61424696F792}</t:ContentId><t:Size>135</t:Size><t:LastModifiedTime>2014-01-03T02:13:44</t:LastModifiedTime><t:IsInline>false</t:IsInline><t:IsContactPhoto>false</t:IsContactPhoto></t:FileAttachment></t:Attachments></t:Message></m:Items></m:GetItemResponseMessage></m:ResponseMessages></m:GetItemResponse></s:Body></s:Envelope>

In the example above, Name is body.csv.  FileName as nothing.  In Outlook, the attachment file name is "CUSTOMER.CSV".

I have confirmed with the sender that file attachment file is named "CUSTOMER.CSV".

Can anyone provide some insight into why EWS reports a file name that is not what was provided by the sender?

Thanks much in advance.

Cannot add hyperlink in notes for contact in outlook web client

$
0
0

Hi Techies,

I am creating a contact in EWS (Exchange Web Service ) with notes. In notes i am adding hyperlink to my website. the hyperlink appears fine in Outlook Client(software in your system) but when i open the same contact in Outlook web app (web browser) it shows me the literal text code I wrote for hyperlink.

reference code : 

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:k="http://www.w3.org/1999/xhtml" ><soap:Header>
<t:RequestServerVersion Version="Exchange2010"/>
 <t:ExchangeImpersonation>    <t:ConnectingSID>       


<t:PrimarySmtpAddress>abc@xyz.com</t:PrimarySmtpAddress>    </t:ConnectingSID> </t:ExchangeImpersonation>

</soap:Header>
 <soap:Body>

  <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" >
    <SavedItemFolderId>
      <t:DistinguishedFolderId Id="contacts">
        <t:Mailbox>
         <t:EmailAddress>abc@xyz.com</t:EmailAddress>
        </t:Mailbox>
      </t:DistinguishedFolderId>
    </SavedItemFolderId>
   <Items>
    <t:Contact>
<t:Body BodyType = "HTML">

// wrote ascii code because i cannot write HTML standard tags in EWS

//ascii representation of <a href="www.google.com">click here </a> is below

&#60; a   href &#61; "www.google.com"&#62; click here &#60; &#47; a&#62;

</t:Body>

</t:Contact>


Please help...

thanks in advance

Stream notification for multiple mailboxes (Office 365 W15, Exchange 2013).

$
0
0

Hello :-)

I have a few questions that I hope someone can help me with.

I'm trying to set up streaming notification to detect calendar changes in multiple mailboxes using EWS API 2.0.
Using one connection and one subscription for each mailbox works fine with only a few mailboxes.

I have read about "maintain affinity", and tried to follow the steps from the msdn page regarding this:
I'm supposed to get the GroupingInformation using Autodiscover, and then subscribe each group to separate connections.
This way, I will achieve a reduced number of connections.
At the moment I'm testing with just 4 mailboxes, and when I call Autodiscover to get GroupingInformation, all the 4 mailboxes havedifferent GroupingInformation values, so I will end up with 4 connections and 4 subscriptions.
The ExternalEwsUrl is the same for all mailboxes and the domain is the same.
So my questions are:
1: Why is the GroupingInformation different for each mailbox, and is it anything I can do to change it?
2: If I have 5000 mailboxes, should I go for one connection and one subscription for each mailbox, or should I use "affinity" as described on the msdn page (Maintain affinity)?
3: Is there any other/better options?

Thanks in advance.



CRM + Exchange Online

$
0
0

Hello !!!

We dlike to add  "crm" features on a custom web application that we have implement internally. 
Our scope is to have all the communication between us and our customer recorded.
We use Exchange Online  and our web application is an .net mvc5.

I have see that it provides the Exchange online API ( https://msdn.microsoft.com/en-us/library/office/dn567668(v=exchg.150).aspx ) 

So my questions are ,

1)Is it possible to Track the communication Between us and our customer ? 

2)Is it possible to automate import an incoming email ?

3)Is out there any other solution that have implement this ?

Idlike to listen your opinions before to start the development on EWS.
Thanks in advance



Using EWS to attempt to get Attachments and download to c:\ drive folder nothing happens

$
0
0

I have been trying to figure out why when I run this code nothing happens, there are no errors being caught by VS, and then app opens a console window and then it closes rapidly I do not see anything in the console window, but there are no attachments downloaded and nothing happens.

 What I'm attempting to do is use the EWS 2.0  to download the email attachment to the c drive folder temp and I only need the most recent email  .

         

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Exchange.WebServices.Data;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;



namespace GetAttachments
{

    class Program
    {
        static void Main(string[] args)
        {


            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
            service.EnableScpLookup = false;
            service.Credentials = new WebCredentials("USN", "Password", "domain");

            service.TraceEnabled = true;
            service.TraceFlags = TraceFlags.All;
            ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;

            service.Url = new Uri("https://<IP address of Exchange Server>/ews/exchange.asmx");



        }
        public static void GetAttachmentsFromEmail(ExchangeService service, ItemId itemId)
        {
            // Bind to an existing message item and retrieve the attachments collection.
            // This method results in an GetItem call to EWS.
            EmailMessage message = EmailMessage.Bind(service, itemId, new PropertySet(ItemSchema.Attachments));

            // Iterate through the attachments collection and load each attachment.
            foreach (Attachment attachment in message.Attachments)
            {
                if (attachment is FileAttachment)
                {
                    FileAttachment fileAttachment = attachment as FileAttachment;

                    // Load the attachment into a file.
                    // This call results in a GetAttachment call to EWS.
                    fileAttachment.Load("C:\\temp\\" + fileAttachment.Name);

                    Console.WriteLine("File attachment name: " + fileAttachment.Name);
                }
                else // Attachment is an item attachment.
                {
                    ItemAttachment itemAttachment = attachment as ItemAttachment;

                    // Load attachment into memory and write out the subject.
                    // This does not save the file like it does with a file attachment.
                    // This call results in a GetAttachment call to EWS.
                    itemAttachment.Load();

                    Console.WriteLine("Item attachment name: " + itemAttachment.Name);
                }
            }
        }


        public static void SaveEmailAttachment(ExchangeService service, ItemId itemId)
        {
            // Bind to an existing message item and retrieve the attachments collection.
            // This method results in an GetItem call to EWS.
            EmailMessage message = EmailMessage.Bind(service, itemId, new PropertySet(ItemSchema.Attachments));

            foreach (Attachment attachment in message.Attachments)
            {
                if (attachment is ItemAttachment)
                {
                    ItemAttachment itemAttachment = attachment as ItemAttachment;
                    itemAttachment.Load(ItemSchema.MimeContent);
                    string fileName = "C:\\temp\\" + itemAttachment.Item.Subject + ".eml";

                    // Write the bytes of the attachment into a file.
                    System.IO.File.WriteAllBytes(fileName, itemAttachment.Item.MimeContent.Content);

                    Console.WriteLine("Email attachment name: " + itemAttachment.Item.Subject + ".eml");
                }
            }
        }

        private static bool CertificateValidationCallBack(
        object sender,
        System.Security.Cryptography.X509Certificates.X509Certificate certificate,
        System.Security.Cryptography.X509Certificates.X509Chain chain,
        System.Net.Security.SslPolicyErrors sslPolicyErrors)
        {
            // If the certificate is a valid, signed certificate, return true.
            if (sslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
            {
                return true;
            }

            // If there are errors in the certificate chain, look at each error to determine the cause.
            if ((sslPolicyErrors & System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors) != 0)
            {
                if (chain != null && chain.ChainStatus != null)
                {
                    foreach (System.Security.Cryptography.X509Certificates.X509ChainStatus status in chain.ChainStatus)
                    {
                        if ((certificate.Subject == certificate.Issuer) &&
                           (status.Status == System.Security.Cryptography.X509Certificates.X509ChainStatusFlags.UntrustedRoot))
                        {
                            // Self-signed certificates with an untrusted root are valid.
                            continue;
                        }
                        else
                        {
                            if (status.Status != System.Security.Cryptography.X509Certificates.X509ChainStatusFlags.NoError)
                            {
                                // If there are any other errors in the certificate chain, the certificate is invalid,
                                // so the method returns false.
                                return false;
                            }
                        }
                    }
                }

                // When processing reaches this line, the only errors in the certificate chain are
                // untrusted root errors for self-signed certificates. These certificates are valid
                // for default Exchange server installations, so return true.
                return true;
            }
            else
            {
                // In all other cases, return false.
                return true;
            }
        }
    }
}
 

RoutingDomainOverride with custom transport agent

$
0
0

I've wrote a custom transport agent that overrides the routing of the FROM user to make it go to specific send connectors. The reason is because there are certain people I want going out specific send connectors for smart host options such as email archiving/encryption.

Now the problem I'm facing is when I do this with a smart host it works great! But if I remove the smart host and let Exchange do DNS lookups then it will **sometimes** get the 5.4.4 NonExistent Domain errors.

So I have a send connector with the address space set to "custom-domain1xyz.com" which is just a fake domain we use for one send connector. I override the messages which force it to go out that send connector. My guess is Exchange is looking up the custom-domain1xyz.com instead of doing an actual lookup on the receipient domain.

This is the override code in C# for OnResolvedMessage event:

foreach (var recipient in e.MailItem.Recipients)
 {
    RoutingDomain newRoutingDomain = new RoutingDomain("custom-domain1xyz.com");
    RoutingOverride newRoutingOverride = new RoutingOverride(newRoutingDomain, 0);
    source.SetRoutingOverride(recipient, newRoutingOverride);
}

The value 0 should be UseOverrideDomain: https://msdn.microsoft.com/en-us/library/office/microsoft.exchange.data.transport.deliveryqueuedomain(v=exchg.150).aspx

Here is the override method:

https://msdn.microsoft.com/en-us/library/office/dd899758(v=exchg.150).aspx


Need Quick clarification for mail server connectivity for the following two points

$
0
0

Need clarification for mail server connectivity for the following two points, 

· Is ZIMBRA mail server  is compatible with exchange or not ? 

· Creating a send/receive connector with exchange 2010 can be configured or not at ZIMBRA mail server ? 

Great Thanks in Advance.

Ram.M

Exchange 2003 Send Reports

$
0
0

Hi - I am looking for a Log Parser script that will output the top 10 senders for a given day. basically a top ten of who has sent the most email.

Any help is much appreciated

Thanks

Stan

Add and Remove users from Exchange Distribution Groups programmatically C#

$
0
0

Hi all,

we have a requirement to build an application that has the following functionality:

1) search for exchange distribution group (list).

2) show the members of that group

3) allow the owner of the group to add or delete members

is there a REST api or C# way of doing this?

Viewing all 7132 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>