1

Is there any way to query the exchange server to determine the maximum attachment file size? I'd be doing this in ASP.NET/C#. I'd like to be able to validate the file they want to attach is not over the limit before the user attempts to send the file to the server as opposed to having the server send back an exception when it attempts to attach the file and it discovers the file is too large.

I've also posted this question about this on stackoverflow.com as well - I figured a sysadmin for Exchange may have an answer as well as a developer. Hopefully I do not incur the wrath of the stackexchange gods.

Jeff
  • 111
  • 3

2 Answers2

1

There are actually quite a few places you can set the attachment size limit in Exchange, server, mailbox, send connector etc. You can obtain these limits using powershell. Take a look at this article to see all these options and the powershell to find them out.

You can host a powershell runtime inside a .net application. This would allow you to run Powershell commands and get back .net objects to work with.

Sam Cogan
  • 38,736
  • 6
  • 78
  • 114
  • I believe he is asking how to determine the limits of a remote mail server, but I could be incorrect. – Zoredache Jan 25 '11 at 00:35
  • @zoredach good point, if it is a remote server you are talking to this will not work , – Sam Cogan Jan 25 '11 at 07:30
  • Zoredach is correct - I am looking to find the limit on the attachment size that has been set on the server. It is for an application that will be running in the same domain as the Exchange server if that makes a difference. – Jeff Jan 25 '11 at 16:51
  • 1
    @Jeff ok, so if you are on the same domain and your admin will let you, then you should either be able to install the Exchange management console on your server (so being able to run Exchange Powershell commands on that server) or run remote powershell commands on a machine with the management tools installed. – Sam Cogan Jan 25 '11 at 16:59
0

telnet

open mailserver.domain.com 25

ehlo

joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • That won't necessarily reveal anything about limits. – John Gardeniers Jan 25 '11 at 04:14
  • Sure it will. It will list the ESMTP commands that the server supports and will show you what the global size limit is. – joeqwerty Jan 25 '11 at 13:14
  • This will give you the server limit, but any connector or mailbox limits won't be on there. – Sam Cogan Jan 25 '11 at 17:00
  • I've opened the telnet session and issued the ehlo command. Is there any specific verbiage I should be looking for that will indicate the global size limit? After typing "ehlo" I see: 250-SIZE along with a number of other values. Should I expect to see a number after the size? Also, is this the total message size limit - not just the attachment? – Jeff Jan 25 '11 at 17:10