Bypass/Ignore Exchange Server "Maximum Send Size"? - c#

As soon as possible I will start a bounty and award 150 (that's what I have) points for solution.
I am developing Outlook add in. When message is sent, add in processes the message, it removes the attachments and sends them through different transfer channel and puts the attachment download links in message body.
When using outlook with exchange server with "maximum send size" limit users can't even attach large files to message. Outlook displays a warning that imposes exchange limit.
To make it worse attachment is refused before any of attachment events are fired.
I need a way to bypass this behavior. Something that will allow users to add attachments of any size by using outlook paper clip button, or drag and drop. Or good direction I can work on.
Adding separate attach button is not an option.

Try to set the PR_MAX_SUBMIT_MESSAGE_SIZE MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x666D0003) using Store.PropertyAccessor.SetProperty.
I was able to set it using OutlookSpy (I am its author) - click IMsgStore button, right click, select IMAPIProp::GetProps, type PR_MAX_SUBMIT_MESSAGE_SIZE - the property is not shown by default, then double click to modify it. I don't know if Outlook will overwrite it on the local cached store later - I never tried to set that property.
Note that the limit is there for a reason - Exchange won't let you send the message if it is over the limit. But it will work if you simply want to get rid of the warming because you will handle the attachment on your own when the message is sent.

You cannot do this, by design. The limit is enforced in the message store to which the submit operation is sent. You could zip the attachment, or chunk it up into separate emails, to allow very large data to be sent.

Related

How to share attachments from user to agent (Human handoff) using Bot?

i have bot made using c#. It has the feature of human off. We have integrated the solution provide by tompanna of human handoff where a agent can talk to single user at a time.Here the link of solution we used for human handoff https://github.com/tompaana/intermediator-bot-sample. Our bot is working fine and able to talk with agent with the help of this solution but major issue come when a user want to share image or any kind of attachments from user to agent or from agent to user. The bot show that image is send but user is not able to see it. Simpler case happen in the case of agent.
Image of agent while sending a attachment to user.
And also the image of user ,unable to see the image send by agent.
The sample which you are using for Human HandOff has not been updated over a year, so it gets difficult to be able to find solutions for supporting various features pertaining to the same. However, going through the sample issues, there has been a similar issue in which the sample does not support emojis, images or files to the receiving user. If a user sends any of the above mentioned features, the receiver will get a blank message as it supports only text messages.
Th tentative solution suggested by a user is to create a simple method extension to send image/file messages.You could go ahead and give it a try to see if it works for your case.
Hope this helps.
You need to edit the source code of the library to achieve what you are trying.
In this MessageRouter file , method RouteMessageIfSenderIsConnectedAsync , you can access message.Attachments , then pass it as a parameter to SendMessageAsync in line 432, then from SendMessageAsync in line 160 , you can pass it to CreateMessageActivity method and then in file ConnectorClientMessageBundle , you can access the attachment and attach it to messageActivity.

Block email sender

Is there anyway you can create a code, when you click a button (I've already created this) it will take the selected email and block the sender which will delete the email?
The Outlook object model doesn't provide anything for that. However you can create a VSTO add-in which can handle incoming emails and delete them is the sender belongs to a blocked list. The NewMailEx event of the Application class is fired when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. Use this method with caution to minimize the impact on Outlook performance. However, depending on the setup on the client computer, after a new message arrives in the Inbox, processes like spam filtering and client rules that move the new message from the Inbox to another folder can occur asynchronously.
See Walkthrough: Create your first VSTO Add-in for Outlook to get started quickly.
Outlook Object Model does not expose blocked/safe senders at all.
If using Redemption (I am its author) is an option, it exposes RDOJunkEmailOptions object (returned from RDOSession.JunkEmailOptions, RDOAccount.JunkEmailOptions, RDOExchangeMailboxStore.JunkEmailOptions), which allow to add blocked senders using RDOJunkEmailOptions.BlockedSenders.Add.

Working with GMail Stars in ActiveUp MailSystem

I'm using ActiveUp MailSystem for an automated mail retrieve and treatment program in C# at work.
In the GMail browser mail cliente, my colleagues use GMail stars to mark a specific mail as handled or to be handled by nother colleague (they all use the same account, but some take care of some subjects while others take care of other subjects, and starring gives them a visual aid into what's taken care off and what's addressed to them by a colleague.
Using the inbox.Fetch.MessageObjectPeekWithGMailExtensions(uid) i can get which messages are starred by looking at msg.HeaderFields["x-gm-labels"] and checking it contains \Starred, however:
1 - How can i find out which start it is set to?
2 - how can i set/change a star on a particular message?
Any help is fully appreciated
I believe the Starred label only indicates that the mail can be found on the Starred mailbox. Gmail uses different IMAP mailboxes for labels. MailSystem isn't fully compatible with Gmail's enhanced IMAP commands yet (doesn't support mail's threadID for example).
You can check if IMAP actually stores the type of star by issuing a command method to the IMAP4Client class, that brings the full message (through the BODY IMAP command), but unfortunately you will have to parse and figure out the meaning of each parameter.
Other solution as Max said is using the X-GM-RAW enhanced search command to check for mails starred with the desired star, in which case you will have to use Gmail's unique identifier to know which email has which star.
Google maps stars to imap \Flagged flag, so you can just manipulate and look for that. Eg, store flag \Flagged, and the message will become starred.

On some outlook installations I cannot access the email internet headers so add-in fails

I am writing an Outlook Addin using AddIn Express.
I use Delphi, anyway the problem relates to everyone writing Outlook AddIns so i include c# in the tags.
var
MItem: _MailItem;
[...]
if OutlookApp.ActiveExplorer.Selection.Item(i).QueryInterface(IID__MailItem, MItem) = 0 then
[...]
this lines fires an exception at customer end. The problem is that if on that customer outlook i try to see the message details (in outlook 2010 i open the message i go on File tab in ribbon and then i click on properties) I got this:
.
If I save the problematic message as msg file and i move it to my local outlook (dragging it in some folder so it becomes "one of my emaii messages") I open the properties and i can see the headers.
So somehow there is an issue with that particular Outlook installation. Is it an issue or is it a Outlook setting? I also noticed that there are 3 types of behaviour:
1) message is fine (at my end all messages are "fine", while at customer's end only some of them are fine. By fine I mean: Internet hedaers are complete)
2) message is not perfect (on some messages the internet headers are incoplete, for example Message-ID headers is missing - in this case anyway the above code works)
3) message is bad (no headers as in screenshot and the code fails).
One more thing: sending a message at customer end to the customer address (so sender = reciever) i see that on sent folder the message is "bad" and on inbox the same message is fine.
Can anyone help me shedding some light on this?
Edit: I noticed that at my end even if I see the hedaers the exception still throws. I am even not able to see the exceptino message. This is probably because of addin express (i have the non source code version).
The message doesn't get an internet header until it leaves your corporate email setup, hence the name.
What's stored in your Sent Items is not the same as what has gone out into the world
Have you tried troubleshooting the exception with AddIn Express? If you give them enough info to repro the problem they will surely help you? It's probably a NullReferenceException anyway is it?

Generate an e-mail to be downloaded by client and sent from their outlook account

One of the requirements for the application that I'm working on is to enable users to submit a debugging report to our helpdesk for fatal errors (much like windows error reporting).
I've been told that e-mails must come from a client's mail account to prevent the helpdesk getting spammed and loads of duplicate calls raised.
In order to achieve this, I'm trying to compose a mail message on the server, complete with a nice message in the body for the helpdesk and the error report as an attachment, then add it to the Response so that the user can download, open and send it.
I've tried, without success, to make use of the Outlook Interoperability Component which is a moot point because I've discovered in the last 6 hours of googling that creating more than a few Application instances is very resource intensive.
If you want the user to send an email client side, I don't see how System.Net.Mail will help you.
You have two options:
mailto:support#domain.com?subject=Error&body=Error message here...
get user to download email in some format, open it in their client and send it
Option 1 will probably break down with complex bodies. With Option 2, you need to find a format that is supported by all mail clients (that your users use).
With option 1, you could store the email details locally on your server against some Error ID and just send the email with an Error ID in the subject:
mailto:support#domain.com?subject=Error 987771 encountered
In one of our applications the user hits the generate button and it creates and opens the email in outlook. All they have to do is hit the send button. The functions is below.
public static void generateEmail(string emailTo, string ccTo, string subject, string body, bool bcc)
{
Outlook.Application objOutlook = new Outlook.Application();
Outlook.MailItem mailItem = (Outlook.MailItem)(objOutlook.CreateItem(OlItemType.olMailItem));
/* Sets the recipient e-mails to be either sent by 'To:' or 'BCC:'
* depending on the boolean called 'bcc' passed. */
if (!(bcc))
{
mailItem.To = emailTo;
}
else
{
mailItem.BCC = emailTo;
}
mailItem.CC = ccTo;
mailItem.Subject = subject;
mailItem.Body = body;
mailItem.BodyFormat = OlBodyFormat.olFormatPlain;
mailItem.Display(mailItem);
}
As you can see it is outputting the email in plaintext at the moment because it was required to be blackberry friendly. You can easily change the format to HTML or richtext if you want some formatting options. For HTML use mailItem.HTMLBody
Hope this helps.
EDIT:
I should note that this is used in a C# Application and that it is referencing Microsoft.Office.Core and using Outlook in the Email class the function is located in.
The simple answer is that what you are trying to achieve isn't realistically achievable across all platforms and mail clients. When asked to do the improbable it is wise to come up with an alternative and suggest that.
Assuming that your fault report is only accessible from an error page then you've already got a barrier to spam - unless the spammers can force an exception.
I've always handled this by logging the fault and text into the database and integrating that with a ticketing system. Maybe also have a mailto: as Bruce suggest with subject=ID&body=text to allow the user to send something by email.
I don't think an .eml format file will help either - because they'll need to forward it, and most users would probably get confused.
A .eml is effectively plain text of the message including headers as per RFC-5322.

Categories