用户作为Exchange中的任何人发送?

我有一个.NET程序 – 一个Windows服务 – 连接到Exchange发送电子邮件。 目标是允许它发送电子邮件,显示来自我的雇主拥有的域中的任何数量的电子邮件地址。 该程序正在使用Active Directory帐户(称为“AutoMail”)进行身份validation – 问题在于Exchange提供了以下错误响应代码:

System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at ConsoleApplication1.Program.Main(String[] args) in C:\WorkingCode\ConsoleApplication1\ConsoleApplication1\Program.cs:line 38 

当我将networking凭证更改为我的A / Dlogin名,并从我这里发送电子邮件时,它没有问题。

所以我的问题是:可以从Exchange端configurationAutoMail用户以允许发送电子邮件作为任何有效格式化的电子邮件地址? 如果是这样,怎么样?

作为参考,这里是使用的C#代码:

 MailMessage mail = new MailMessage(); mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.Subject = "This is an email"; mail.Body = "This is a test. <b>This is bold</b> <font color=#336699>This is blue</font>"; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "172.16.1.33"; smtp.UseDefaultCredentials = false; smtp.Credentials = new NetworkCredential("AutoMail", "password"); smtp.Send(mail); 

通过实际login通过Exchange挂钩,您将受到发件人validation。 有一些权限需要设置,以模仿某人,这是微软故意做的。 您正在寻找的权限是“发送为”。 这种操作是黑莓企业服务器所要求的,所以并不罕见。

我们解决它的方法是给用户(在你的情况下,AutoMail)一个特定的ACL到AD中的域对象。 Apply To是“Decedent User Objects”,只有“Send As”框被选中。 这将导致域中的所有User对象(除非它们位于closures了权限inheritance的容器中),以允许AutoMail模拟它们。

作为用户发送权限示例http://sysadmin1138.net/images/send-as-user.png