Powershell - Exchange 2013 filing script - email

I have been looking through the http://gallery.technet.microsoft.com/exchange/ website to no avail and was wondering if someone could help me please.
I would like to create a script that runs for every single email that is sent through exchange 2013. This script looks for an id email attribute that the email is assigned by my other script and if it has an id attribute the email will be moved to a shared mailbox on the exchange and put into a folder with the same id or create a new one if one doesn't exist.
Any help would be much appreciated! Thanks in advance.

Dint understand the query fully.
Looks like u want to write some code that will be executed for all the emails flowing through exchange.
Then Transport Agents are the way to go.
Here's the link which gives the documentaion regarding tranpsort agents in Exchange 2013.
http://msdn.microsoft.com/en-us/library/exchange/bb204097(v=exchg.150).aspx
You want to look for an "attribute" in the email and redirect emails based on that.
May be u can look for a message header in an email via transport agent and based on that perform redirection in the agent(removing all the recipients and adding 'redirectmailbox' as the only recipient).
You can also add custom headers to an email via transport agents.
http://blogs.msdn.com/b/mstehle/archive/2009/01/13/howto-sample-transport-agent-add-headers-categories-mapi-props-even-uses-a-fork.aspx
Transport Agents act on all the emails flowing through the orgnanisation.
Use them with caution.

Related

What is the best/easiest way to process received email message body and resend it?

I am receiving chart data in JSON format to my email address and my goal is to convert it to chart/chart img and resend it to my email address.
I have been looking for several methods:
Google App script used for gmail. I failed to find trigger on newly received message.
Email client, that supports adding actions based on scripts to new incoming message trigger. Only one I know about is MS Outlook with VBA scripts, but creating chart image with lack of libraries available in VBA is not very elegant solution.
Open source email client with possibility to alter the code and so directly process data and resend message. The more robust email client, the harder is to change the code to do relatively simple job, I believe.
I really don´t know what kind of solution this simple problem needs.
Thank you in advance.
Sounds like you are interested in some kind of gateway on the server side, not client-side. Take a closer look at your server-side implementation. For example, you may start from the Mail flow rules (transport rules) in Exchange Online page.

set Custom field in rt software(Ticketing System) with email from Sharepoint

I want set Custom Field in request Tracker system with email from Sharepoint. I use Sharepoint Designer for sending email. but I Cant. write this in first line of email:
cf.{QM-Category of work}:Permission
other User with sending email can set cf.
Can anybody help me?
Tnx
Use this version of RT : RT 4.2.8 Copyright 1996-2014 Best Practical Solutions
I suppose you are using Command by mail extension to do that. Note that the commands are executed only when user sending the mail has the proper authorization. So give your Sharepoint user, represented by email address, the appropriate rights for the target queue.

Change subject in TFS 2015 email alerts

I'm trying to change the subject of email alerts generated by TFS 2015. So far, I figured out, where to find the template of the email body at
c:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\TFSJobAgent\Transforms\1033\BuildCompletedEvent.xsl
However, I still got no clue, where the subject of the email is set. Can anyone provide a hint?
Thanks in advance
We can only customize the format for TFS email alerts by default. The event service uses the .xsl and the plaintextXsl files to transform the XML data for an event into an e-mail message. Edit the .xsl file to get a different format for the email notification.
The content of the emails that are issued is automatically generated from the TeamFoundation.xsl file and BuildCompletedEvent.xsl. Modifying the TeamFoundation.xsl file is not recommended. You need to subscribe to the Event Service and create your own e-mails as DaveShaw mentions.
It is not allowed to modify email subject via modifying the email template in TFS2015.
You have to subscribe to TFS events via API, this method gives the option to set email subject you want. Check this blog for further information: http://geekswithblogs.net/BobHardister/archive/2013/07/24/tfs-2012-api-create-alert-subscriptions.aspx (The blog is written for TFS2012, applies to TFS2015 as well)  

Automated database tracking of Undelivr email in ColdFusion?

Given there is a "FAILTO=''" option for cfmail, triggering an email to be sent to that email if the email didn't get delivered...
Is there a way to somehow assign an ID or tracking # to an email, store it in a database with that ID... then update the status of that email if it fails?
I'd like to track bouncebacks... preferably WITHOUT sending the FAILTO to a POP3 or IMAP and then checking it with cfimap...
Is there any alternate way of handling this?
Maybe an event gateway that is triggered upon email failure?
UPDATE: I've decided to take a different approach, utilizing the sendgrid API.
I'm hoping that lends me with a few more tools than CF offers.
The short answer to your question is unfortunately no.
A longer version with a possible solution:
The failTo email address populates the return-path in the email header, this then 'should' be used by mail servers for bounce backs (however see - http://www.bennadel.com/blog/1899-GMail-Seems-To-Ignore-The-Return-Path-Header-Defined-By-The-CFMail-FailTo-Attribute.htm for an example where it doesn't)
So you are going to need to monitor an Imap or pop account to see your mails, however you can set up an event gateway to monitor this, with detailed instructions here - http://www.alagad.com/documentation/imapGateway/ImapWatcher%20Gateway%20Documentation.pdf
What you're left with is needing to identify which mail matches which bounceback, when I've done something similar in the past I used unique id's for the failTo email addresses at a domain I owned. If you set that up and then use your listener cfc to look for the id in the return-path.
So your sending code would work along the lines of:
Generate unique id
Send mail
Add row to database with unique id
Your listener.cfc would then need to inspect the email returned and if it finds the unique id update the row with whatever information that you're after.
Hope that that at least helps even if you'll need to set up some other bits.
You could use a directly watcher on the undelivr folder to log the failed emails, only really a solution if its own server and not a shared server though.
As far as I know once it leave the spool and is off to your SMTP server CF assume it's been sent correctly.
The email will trickle down the chain of SMTP servers/relays and if anything happen the only instruction they have is to bounce it back to the from address or failto address if present. CF isn't listening at this point so it can't respond.
We use an external tool called Glock email processor to handle exceptions. It's not free, but works pretty well. You can find it here: http://www.glocksoft.com/email-processor/
You need to configure it to check the failto address and from there you can take many actions. I got it setup as a three strikes system.
Email address bounce, I increment a counter in my email table, at 3 I deactivate that email from the system.
Nothing you can't do yourself with cfpop though.

Detecting outlook 2007 client in email

Is it possible to detect the email client in an html message? Specifically outlook 2007
Update
My users have access to an online system that really has nothing to do with email, but in this system they can all communicate with themselves.
My app - takes messages from this system, and then sends it via an email instead.
Now I need a reply to function. Obviously its not a normal email address so...
I want a way to intercept this message, and send it via another channel.
I could write the outlook plug to check EVERY SINGLE out going email address, but this surely can't be the way we're expected to work with email.
It would be much easier to have a button in the email itself which can call an outlook function (custom) and then pass control to this function.
Uodate
Thanks guys for your answer, but there is a little more complexity. The online system contains fields, these fields need to be completed by the user before sending the reply. So I need some kind of form (yes with working check boxes, etc in there). This should all be in the email message.
Essentially what you'll need to do is set up an automated process that monitors a particular email address, and set that address as the reply-to in your outgoing email. When a message comes in, you can do whatever analysis you need to (examining the from, subject, etc.) and process the content however you see fit.
"Detect" using what? Javascript does not work in email. CSS stylesheets don't either - so no CSS hacks.
Have you tried to change the Reply-To header in the email to the direction that you want?
You have an example in C# & VB in: http://www.systemwebmail.com/faq/2.7.aspx