Mule ESB Email Attachment filter - email

Just wanted to ask some help on the Inbound Email scenario. I have setup one mailbox to receive CSV files that contains different mappings for each. I know I can use the choice filetr for it but I can seem to get the correct attachment name values on the email. Any thoughts?
Thanks

I will give you a general answer for situations like this.
When you don't know exactly what property values you are looking for, or what classtype they are, use the debugger in Anypoint Studio. Open your project, add a logger and set a breakpoint on it just after your inbound, and run it in debug mode. Trigger the flow to start, in this case by sending an email to the box it is polling.
Next, you will see the debug perspective and will be able to see the attachment as an inbound property (if i remember correctly). You will also see its type. If you are handling a more complex object, just add a Groovy Script to build the logic needed, and set a simple flag in another property that you will later use in your filter.
Hope it helps.

Related

Thunderbird extensions API - how to get message that's being replied to?

I'm writing a Thunderbird extension that is currently able to trigger when a compose window is created (by listening to when a new tab is created, and then checking the contents of that tab for ComposeDetails). However, what I need is to know if the user is replying to another message, and if so, what other message they're replying to. That information isn't in the ComposeDetails, and I can't figure out how to find it. Can anyone help?
It looks like Thunderbird 88 will support it. The ComposeDetails are getting a new attribute type:
[type] (string) – [Added in TB 88]
Read-only. The type of the message being composed, depending on how the compose window was opened by the user.
Supported values:
draft
new
reply
forward
I have no solution to suggest for older versions.

How to lock on to a cloned form in Delphi?

I am writing a chat program that has a bunch of clients connect to it and populate themselfs to a listview, I want to be able to click on each individual client and open up a form that looks like a chat, but I want to be able to do it to multiple clients at the same time.
I have made Form2 (the chat window) clone itself for every instance, however I need to know how to lock on to the cloned form to make changes such as Form2.RichEdit.Lines.Add
However when I try to do this it does not work because I'm not locking on to the right form since it is cloned I am assuming it is no longer Form2
Any info on this would be highly appreciated.
Update
I am going to go ahead a reword what I am trying to do.
I will explain what im trying to do: I have a chat program (server) that is listening for clients to connect via Indy10 sockets When the client connects it populates the ListView with the user name and when I click on the user name (the server) opens privatemessageform where I can chat with the client.
I want to be able to have multiple clients connected and I want to be able to click on as many as I want and have it clone the privatemessageform and have 2 separate chat windows to 2 separate clients
The problem is: When trying to click on the seccond user the program gets confused and cannot lock on to that seccond user's privatemessageform (clone).
And if any more info is needed and I mean anything at all please do not hesitate to ask I will be on for several hours and constantly checking this thread.
I've been stuck on this for 3 days so I would really love to get this resolved and move forward with my project. Any information is highly appreciated. Thanks in advance!
Open Project Options and remove Form2 from auto-creation list. Do not use that variable any more.
Rename TForm2 to some meaningful name. Once you would have ~10 forms in your program you would forget what you meant by numbers 2, 5, 7 ...
ALWAYS give variables meaningful names, that includes components, that includes forms. Here i will name TForm2 a TPrivMessageForm
Use a special array of variables to keep several forms, not a single global variable. For example like that:
Type TChatUser = string;
// to begin with, user is a name. Then it may become URL, or GUID or something
// complex like `record` or `class` or whatever
Type TPMForms = TDictionary<TChatUser, TPrivMessageForm>;
PMForms := TPMForms.Create;
Creating new private message window after clicked on user:
if not PMForms.ContainsKey(ClickedUser)
then PMForms.Add(ClickedUser, TPrivMessageForm.Create(Application) );
PMForms[ClickedUser].ChatWith := ClickedUser; // variable in ex-TForm2 to tell several instances apart
When such form is closed - it should via its OnClose
Remove itself from PMForms list (so no dangling pointers would remain)
chose caRelease for closing actions (making VCL actually free the form object)
See Also
http://delphi.about.com/od/beginners/a/using-t-dictionary-hash-tables-in-delphi.htm
http://docwiki.embarcadero.com/CodeExamples/XE4/en/Generics_Collections_TDictionary_(Delphi)
PS. Edit your question please and add TAG with your specific Delphi version.
PPS. download ready-made FLOSS chat programs and just read and learn how they do it. Maybe instead of opening a free-floating (cluttering desktop) form you'd better open Tab in PageControl. "Use the Source, Luke"
https://sourceforge.net/p/dreamchat/wiki/Home/
https://sourceforge.net/p/achat/wiki/Home/
http://www.visualirc.net/features.php
For the latter to find the sources one has to type two words "Visual IRC" at www.google.com and get http://sourceforge.net/p/visualirc/mercurial/ci/default/tree/ - this crucial information i did omitted in fair belief that a person interested in finding sources would be able to do it on his own.
PPPS. Those is not "cloned": cloned are separated objects. What you talk is several instances of the same form class. Like you may have two or more labels on the form, you can have two or more forms in your application.

Javamail to receive emails; whats wrong?

I am trying to create a very simple (text based for now) email app for receiving emails. So far i have used this code :
http://www.javaer.org/j2ee/3-javamail/8-javamail-connecting-gmail-using-pop3-with-ssl
The problem is that i when i run this code i am able to get the new emails, only for once. For example if i have a new message in inbox the first time i will this code it will show it but then it wont. Also it seems that i cant see the body contents of the emails which is strange. I was told that it should be better to use imap protocol but i am not entirely sure how.
Specified example really starts once and scans folder and exits (and see answer on POP that removes mail). From description you need some loop that periodically checks catalog and extracts new mails. Look at some swing examples in your JDK how to write window-based program with event loop. You can start dedicated thread that once per minute checks POP server catalog

How to read message from console tab view in eclipse plugin development

requirement is to read message from IConsoleConstants.ID_CONSOLE_VIEW and write it into text file.
Say myConsole (of type MessageConsole) is the reference to your console. The below code will give you the required.
myConsole.getDocument().get();
I don't think you will be able to retreive a direct stream to read the console content. Note also that the console view may have multiple different consoles, you will have to retrieve the good one.
Retrieving the content displayed in a single console should be possible going through the IDocument of a TextConsole. You can get the whole text content. You could also have a look to the IDocumentListener if you can be notified of changes.
Another solution should be to go with a PatternMatchListener of the TextConsole directly.
Anyway I don't think there is a direct solution to do this with the Eclipse console API.

How do I use the Groups.pm in Request Tracker?

In lib\RT\CustomFieldValues\ there is the groups.pm file which is supposed to be an example of how to get data into a custom field, but how do I actually use that once I have written it? Does anyone have any documentation or a sample of this?
I have finally figured it out, to use the Groups.pm module you need to go to /opt/rt3/etc and edit the RT_SiteConfig.pm and add the line
Set(#CustomFieldValuesSources, "RT::CustomFieldValues::Groups");
Restart Apache and it will be available as a new field source.
I have written a blog post on doing this which also includes details on how to build your own module in case anyone is interested in doing this: AD Lookup Control in Request Tracker