Query related to Sender Email Adapter
Hi ,
I have one requirement related to sender mail adapter.
There are 2 Interfaces and both the interfaces are fetching emails using 2 sender mail adapters from the same email database and I am posting data at the receiver side on the webservice using SOAP. So my requirements/challenges are as mentioned below
1) How to diffrentiate the emails for the two Interfaces i.e . how emails from the same email server database will be fetched correctly for the two interfaces, currently the interfaces are fetching the data incorrectly from the same email server as both the sender email adapters are active. It means that suppose sender email adapter of Interface A is active it fecthes the email and it deletes it from email database and hence it is not available for the interface "B". How to avoid this situation.
2) How to filter emails using sender email adapters i.e. how can we avoid the junk mails and select the correct email for the correct interface.
Note: IMAP cannot be used in our environment due to certain restriction, therefore how can it be done using POP3 protocol?
Any suggestion on the problem will be much appreciated.
Thanks & Regards
Prabhat
Hi,
Any solution on this will be much appreciated.
My requirement is how to filter emails using sender email adapter
Note: I cant's use IMAP4 due to certain restriction, I can use only POP3
Hi Salvi,
Your suggestion cannot be implemented as
The source payload for the two interfaces are different and also 2 different BPMs are used for 2 different interfaces so even if I use same mail adapter and it will picked up by the adapter and processed by one interface and not available to other interface as sender agreements for the interfaces will be different though the communication channel is same.
So If anyone can provide me the solution as how to filter emails from mail box using sender mail adapter , that will solve my problem.
Thanks & Regards
Prabhat
Similar Messages
-
How to filter emails using sender email adapter
Hi,
Does any one know how to filter emails of mail server using Sender email adapter(POP3 protocol ) in PI .
To make it more clear let us assume that there are 10 emails in the email server then 3 emails should be fetched for Interface A , 3 emails Should be fetched for Interface B and remaining 4 emails should be ignored and left in the email server as it is , the reason for this is that it is not related with the Interface A or Interface B. Any suggestion or solution will be much appreciated.
Thanks & Regards
PrabhatHi,
I guess you didnt get my requirement clearly. My requirement is how to filter emails from email server using sender Email adapter in POP3 protocl and pass it to relevant Interface.
For ex: suppose email no.1 is related to Interface A then it should go to Interface A
or email no. 2 is related to Interface B then it should go to Interface B
or if email no. 3 is junk mail then it should avoid deleting that email and leave that email as it is
The problem/challenge here is that email adapter of Interface A or B reads it first and deletes the email message so it is not available for the Interface A or B.
So I just want that sender email adapter should filter it before deleting email from the email server.
Can you provide some solution for this?
Thanks & Regards
Prabhat -
Sender Email Adapter in PI 7.11 by using the IMAP
Hi Experts
I am trying to configure a sender email adapter by using the IMAP Protocal , Can anyone send the blog or paramertes to configure for IMAP Protocal
I did find for POP3
Thanks
PRCan anyone send the blog or paramertes to configure for IMAP Protocal
http://saptrainingsonline.com/sap-xi-pi-tutorials/configuring-the-receiver-mail-adapter-in-sap-xi-pi/
http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm -
Dynamic query configuration in sender jdbc adapter
Hi,
According my undertsnading in XI.3.0 dynamic query in sender JDBC adapter is not possible.
could any one confirms the possibility of this feature in XI 7.0 .
Thanks,
venuHi VJ,
sorry for late responding to your answer.
One of our requirements is the query statement that we write in sender communication channel should be changed dynamically, for example in where condition the condition parameters values required to change.
Thanks,
venu -
Process attachments with sender email adapter
Hi @ all,
I have some problems dealing with xml attachments on emails. I configured the email sender adapter by using Michals Blog
<a href="/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step:///people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
Unfortunately the mail header looks different as the one in the blog:
<b>Content-ID: <[email protected]>
Content-Type: application/octet-stream;name="[email protected]"
Content-Disposition: attachment;filename="MailAttachment-1.bin"
Content-Description: MailAttachment-1</b>
What can I do to make it look like in the blog?
thanks and Regards.
Oliver.Hi,
Try With the Following Blogs
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
Reward Points if Helpful
Regards
Khanna -
Sender Email Adapter: Process multiples attachments of a single email
Hello all,
is there any way to process all the attachments in a single email as different messages? I have the scenario that i receive an email with multiples attachments and i would like to process all of them as if they were single messages. Is it possible?
Thanks in advance.Hi,
>>>I have the scenario that i receive an email with multiples attachments and i would like to process all of them as if they were single messages. Is it possible?
yes and no
no - you cannot process them as XI messages - only as one message with multiple attachments
yes - you can combine them all into one message and then split with different mappings to the same receiver
(multiple lines in interface determination)
or you can even split them one by one in the adapter module and send to XI as many messages as
attachments that you have (this approach requires some dev in the adapter module but it's doable)
Regards,
Michal Krawczyk -
Query related to Email adapter
Hi,
I have query related to receiver Email adapter. I am able to run a scenario for 2 attachments in receiver mail adapter scenario.
My scenario is that I am picking up the multiple files using sender file adapter "additonal fiiles" fucntionality and and post the two files as attachments in receiver email adapter. I am picking up two formats: .xml file and PDF and successfully attached to the receiver email adapter.
My query is is related to Standard module processors sequence.
For 3 files in mail attachments(.xml , pdf & .txt) what should be the module processors sequence in receiver email adapter?
Currently I am using the following module processors sequence
1 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans2
2 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swap
3 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans1
4 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
swap -> swap.keyName -> payload-name
swap> swap.keyValue> file1
trans1> Transform.ContentDescription>file1
trans1> Transform.ContentDisposition>attachment
trans1> Transform.ContentType>application/pdf;name="file1.pdf"
trans2>Transform.ContentDescription>file1
trans2>Transform.ContentDescription>inline
Can any body tell me what should be the sequence of module processors and the associated parameters so that all formats(.xml , pdf & .txt) should go as an attachments in the reciever email adapter.
Thanks & Regards
Prabhatit would be something like this, Try this
1 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swaptxt
2 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans3
3 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swapxml
4 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans2
5 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swappdf
6 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans1
7 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
swapxml -> swap.keyName -> payload-name
swapxml> swap.keyValue> file2
swappdf -> swap.keyName -> payload-name
swappdf> swap.keyValue> file1
trans1> Transform.ContentDescription>file1
trans1> Transform.ContentDisposition>attachment
trans1> Transform.ContentType>application/pdf;name="file1.pdf"
trans2>Transform.ContentDescription>file2
trans2>Transform.ContentDisposition>attachment
trans2> Transform.ContentType>application/xml;name="file2.xml"
trans3> Transform.ContentDescription>file3
trans3> Transform.ContentDisposition>attachment
trans3> Transform.ContentType>application/txt;name="file3.txt"
mail --> mime.contenttype --> multipart/mixed
I have not tried this myself. but it should work -
Read filename of email attachment for sender mail adapter
Hi All,
We have a requirement to read filename of email attachment received from Sender email adapter and send details to SAP by Proxy call.
Can we retrieve the filename of email attachment ?
Any help on this will be really useful.
Regards,
AshishHi,
>>>Can we retrieve the filename of email attachment ?
Please see the below link, it might be useful to you.
http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
Regards,
P.Rajesh -
Sender mail adapter - attachment name
Hi there
We have configured a sender email adapter to receive text/csv attachments and save them to a file system. What we are having a problem with is reading the attachment name. So we are using Dynamis Configuration to create the file name using the subject line - Which is not ideal. Ideally we would like to use the same name as the origianl attachment but haven't found any way of doing that. We even tried using Content-type in the Variable Header (XHeaderName1) suing variable transport binding but it doesn't show up in the Dynamic Config part of the SOAP message.
Is there any way of reading the name of the file attachment? We are on PI release 7.0.
Any help would be appreciated.
Cheers
SalilHi Vitor
There are 2 scenarios that I can think of -
1. You are saving the email attachment as a file. In that case use step 3 in the earlier reply to get the attachment name and save the file witht that name.
2. You are sending the XML straight to a receiver using HTTP, IDOC, JDBC etc. in which case you would need the attachment name much earlier that step 3. For that I guess you would have to write another adapter module on the sender mail adapter(at Position 3 where position1 = payloadswap bean, 2 = custom module to get the attachment name) and add an xml tag to your incoming message. These adapter modules are really powerful and are like user exits in ABAP. In that case you would have to change the Data Type in the Integration repository to reflect that extra tag. Here is some code from a module we wrote to totally change the structure of the xml coming in. The key thing to remember is this module is that you can read the whole message byte by byte. There might be smarter ways of doing it (like using the SAP XML parser factory class) but since I'm not a Java programmer I stuck to the basics. Here's the code( you could also look at the example given in sap help where they remove (or add I'm not sure) CR(carriage return) from CRLF (CR Line feed).
Created on Aug 8, 2007
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package jdbcPackage;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
@author Salil.Mehta Soltius NZ Ltd
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class jdbcClass implements SessionBean, Module {
private SessionContext myContext;
public void ejbRemove() {
public void ejbActivate() {
public void ejbPassivate() {
public void setSessionContext(SessionContext context) {
myContext = context;
public void ejbCreate() throws CreateException {
public ModuleData process(
ModuleContext moduleContext,
ModuleData inputModuleData)
throws ModuleException {
// put your code here
try {
Message msg = (Message) inputModuleData.getPrincipalData();
XMLPayload payload = msg.getDocument();
String payEnc = payload.getEncoding();
byte[] payByte = payload.getContent();
byte[] payByteOut = new byte[payByte.length];
byte[] payByteTemp = new byte[payByte.length];
int i;
int j;
int actualCount = 0;
char xmlTagFound = ' ';
char endXmlTagFound = ' ';
char tagFound = ' ';
System.arraycopy(payByte, 0, payByteTemp, 0, payByte.length);
// Step 1 - Conversions
// convert "< to <" and "> to >"
// convert " to "
// This will remove any carriage returns and line feeds
// and the <XML* and </XML* tags plus the <row> and </row> tags
for (i = 0; i < payByte.length; i++) {
// convert < to < and > to >
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'l') {
if (payByteTemp[i + 2] == 't') {
if (payByteTemp[i + 3] == ';') {
payByteTemp<i> = '<';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'g') {
if (payByteTemp[i + 2] == 't') {
if (payByteTemp[i + 3] == ';') {
payByteTemp<i> = '>';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
if (payByteTemp<i> == '&') {
if (payByteTemp[i + 1] == 'q') {
if (payByteTemp[i + 2] == 'u') {
if (payByteTemp[i + 3] == 'o') {
if (payByteTemp[i + 4] == 't') {
if (payByteTemp[i + 5] == ';') {
payByteTemp<i> = '"';
payByteTemp[i + 1] = '\n';
payByteTemp[i + 2] = '\n';
payByteTemp[i + 3] = '\n';
payByteTemp[i + 4] = '\n';
payByteTemp[i + 5] = '\n';
// This will take in the initial xml declaration from the Byte array
// And we also don't want the stuff after the xml declaration till
// we reach the first <row> tag
if (xmlTagFound == ' ') {
if (payByteTemp<i> == '>') {
xmlTagFound = 'X';
payByteOut[actualCount++] = payByteTemp<i>;
if (xmlTagFound == 'X') {
payByteOut[actualCount++] = '\r';
continue;
if (xmlTagFound == 'X') {
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'r') {
if (payByteTemp[i + 2] == 'o') {
if (payByteTemp[i + 3] == 'w') {
if (payByteTemp[i + 4] == '>') {
xmlTagFound = 'Y';
} else {
continue;
} else {
continue;
} else {
continue;
} else {
continue;
} else {
continue;
// Carriage return and line feed
if ((payByteTemp<i> == '\r') || (payByteTemp<i> == '\n')) {
continue;
// <XML_*> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'X') {
if (payByteTemp[i + 2] == 'M') {
if (payByteTemp[i + 3] == 'L') {
tagFound = 'X';
endXmlTagFound = ' ';
continue;
// </XML_*> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == '/') {
if (payByteTemp[i + 2] == 'X') {
if (payByteTemp[i + 3] == 'M') {
if (payByteTemp[i + 4] == 'L') {
tagFound = 'X';
endXmlTagFound = 'X';
continue;
// <row> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == 'r') {
if (payByteTemp[i + 2] == 'o') {
if (payByteTemp[i + 3] == 'w') {
if (payByteTemp[i + 4] == '>') {
tagFound = 'X';
continue;
// </row> tag
if (payByteTemp<i> == '<') {
if (payByteTemp[i + 1] == '/') {
if (payByteTemp[i + 2] == 'r') {
if (payByteTemp[i + 3] == 'o') {
if (payByteTemp[i + 4] == 'w') {
if (payByteTemp[i + 5] == '>') {
tagFound = 'X';
continue;
if ((payByteTemp<i> == '>') && (tagFound == 'X')) {
tagFound = ' ';
continue;
if (tagFound == ' ') {
if (endXmlTagFound == 'X') {
continue;
payByteOut[actualCount++] = payByteTemp<i>;
byte[] payByteExp = new byte[actualCount];
System.arraycopy(payByteOut, 0, payByteExp, 0, actualCount);
payload.setContent(payByteExp);
msg.setDocument(payload);
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
ModuleException me = new ModuleException(e);
throw me;
return inputModuleData; -
Sender Mail Adapter Configuration error
Hi,
I am working on scenario mail adapter to CRM system. And when I tried to configure the sender email adapter I have got the error following error, Can any one help me to resolve this issues
error occured: <b>exception caught during processing mail message; java.net.ConnectException: Connection refused</b>
the details I have provided are as follows
Transport protocol is POP3
URL - POP://mailservername/Inbox/folder
And I have tried with the IMAP4 also
URL - IMAP://mailservername/Inbox/folder
And we have cross checked that the XI server is able to ping that particular mail server.
Regards,
Venkat.Hi Venkateswara,
I would suggest that you go through these to know how to configure your sender mail adapter,
<a href="/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step mail adapter step by step</a>
<a href="/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure adapter Scenario</a>
Also, to know the various parameters of a sender mail adapter, just go through this link,
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm">Configuring sender mail adapter</a>
Check your mail adapter configuration against these details. Also, check if the mail server you are trying to access is running.
Also go thru this pdf to make yourself more comfortable with mail adapters.
https://websmp205.sap-ag.de/~sapidb/011000358700004556712005E/HowTo_Mail_Adapter2.pdf
Regards,
abhy -
Hi,
I'm using a sender email adapter. But its throwing the following error.
error occured: exception caught during processing mail message; java.io.IOException: invalid IMAP status response; not finding * STATUS, but 001I NO The requested item could not be found.
Can somebody let me know why does this happen? I'm using IMAP4, XIPAYLOAD and Plain Authentication mode.
Thanks,
SandeepHi all
Just for your interest : I had same issue and it was due to a incorrect URL in the mail adapter ( I used my mailbox name and didn't specify the IMAP folder INBOX ):
e.g. imap://mailserver/INBOX
worked for me ( the individual mailbox is apparently found via the username/password ) with microsoft exchange as mail server
hope it can still helps anyone,
regards
Dirk -
can I define multiple query statments in sender jdbc adapter?
because i wanna get multiple recordsets from database according to multiple querty statements.
like:
<recordset1>
<row>
<col1>
<col1/>
<col2>
<col2/>
<row/>
<recordset1/>
<recordset2>
<row>
<col1>
<col1/>
<col2>
<col2/>
<col3>
<col3/>
<col4>
<col4/>
<row/>
<recordset2/>
such as: order and order item scenario.
in general,how to implement the scenario?
i have to make use of BPM to resolve the problem?
ple give some hint and stuff about this. thanks a lot!!!Hi Joy ,
Check out this :
http://www.codeproject.com/Messages/2516517/Re-How-to-write-the-multiple-query-in-single-store-procedure.aspx
Hope you will find this discussion informative : http://forums.asp.net/p/1021356/1765680.aspx
Regards, -
Are socket needed to send emails?????
hi guys,
lets say i need to send an email notification everytime i finish doing a cetain task....do i need to create and use a socket to send these emails????
thanks in advance for any help...
lost and blur.
Below are the codes to send email:
(So are socket needed???)
public void execute(String mailto, String mailcc, String mailsub, String mailbody){
//session object inside the catch block also(in case of DCOException).
DCOSession ds = null;
try{
ds = new DCOSession(); // Create new DCOSession object
ds.login("erstest02"); // Log in as current Notes client user
DCOMail dm = new DCOMail(); // Create new DCOMail object
dm.setDcoSession(ds);// Pass DCOSession to mail
//dm.setDebug(true);
dm.setSendTo(mailto);
dm.setCopyTo(mailcc);
//dm.setBlindCopyTo();
dm.setSubject(mailsub);
dm.setBody(mailbody);
//System.out.println("before mail sent");
dm.send(); // Send the mail
ds.logout(); // Log out of the session
System.out.println("mail sent to "+mailto);
}catch(DCOException e1){
e1.printStackTrace();
try{
if(ds!=null){
ds.logout(); //Log out of session even if exception is thrown
}catch(Exception ee1){
System.out.println("Exception thrown while trying to logout of session");
ee1.printStackTrace();
}catch(Exception e){
e.printStackTrace();
try{
if(ds!=null){
ds.logout(); //Log out of session even if exception is thrown
}catch(Exception ee2){
System.out.println("Exception thrown while trying to logout of session");
ee2.printStackTrace();
}lets say i need to send an email notification
everytime i finish doing a cetain task....do i need
to create and use a socket to send these emails????Yes, sockets are needed to send emails. However, you don't need to deal with them yourself. You can use the JavaMail API. It will hide those low level details from you and let you deal with concepts that are related to sending emails--addresses, contents, servers, etc.
http://java.sun.com/developer/onlineTraining/JavaMail/ -
Global failure on sending emails with legacy devices (with BIS subscription)
Hi there,
Is anybody having troubles sending emails since 5 PM CET ?
Service got suddenly cut around that time today Saturday April 4 (getting a red cross and a message status : "Global Failure")
- sent service books
- registrered now (in Host Routing Table options)
- run a diagnotic with BDA (Blackberry Device Analyzer)
Everything looked fine.
Receiving emails is no an issue. BBM and PIN message are fine.
Talked to a technical support rep of my carrier. He could not connect/log in to the Blackberry Provisioning Administration Tool for carrier/provider.
There is definitely an issue ongoing with NOC infrastructure related to sending emails.
Let me know whether you have got the same issue and where you are.
Jeremie
Carrier : Proximus
Country : Belgium
Device : Bold 9900RESOLVED!!
Issue lasted from 5PM CET till 9:15 PM CET.
After 4h15 min of blackout on our sending email feature, NOC team seems having resolved the issue. We can reply and send email from all our email accounts using our legacy device with BIS subscription.
Regards.
Jeremie -
Query related to multiple attachments in mail adapter
Hi,
I have a query related to multiple attachments in receiver mail adapter.
I have successfully configured mail related scenarios but now I have another requirement in which I have multiple source files in one directory and I want to send one mail for multiple files as mail attachment using receiver mail adapter. Can anybody help me how to achieve multiple attachments in reciever mail adapter.
To clarify the requirement more let us take an example
Ex: I have 5 input files in the source which I pick up using additional files option in the sender file adapter, now I want to send those 5 files into one mail with 5 attachments. Can anybody explain how 5 different payload will be sent as multiple attachments in one mail.
For your information I used, options like "keep attachments" , some parameters in module processesors etcs...but not able to find out as how exactly it will be achieved.......I dont want to use BPM collect pattern for this.....
Need your help on this issue. Please suggest the solution as how it can be achieved using receiver mail adapter.
Thanks & Regards
PrabhatHi,
I resolved the issue on my own. Thanks for your help and support.
Thanks & Regards
Prabhat
Maybe you are looking for
-
How do you sign out of an iTunes or App Store account on your iPhone???
I use a US and UK account, I can easily sign in between the two on my laptop, but cannot find a way to sign out of an account on my iPhone??!! Do I need to sync the iPhone with my laptop while iTunes is logged in as the other account to kick it out o
-
Customization of tcode 'Create Billing Document - *VF01*'
Hi, I have a requirement where I need to enable the disabled field Item in TCode VF01 (to make the field similar to Document Number which is enabled). Please suggest me how to proceed as Functional guys said it is not possible to do from Functional s
-
Mirrored pics (continued)
This mirroring problem also comes with video mode in Photo Booth. In addition, no sound is recorded. My iSight webcam does not pick up sound in iMovieHD either. Wrong camera??
-
Hi - I have an FLA with movie clips that I'm using as buttons (button1, button2, etc). Inside "button4" are layers with button instances (not mc's as buttons) that make up a submenu (sub4_1, sub4_2, etc). The buttons have different looks for Up, Over
-
PDF Printing asking for user id and password
Hi all, We are using SAP Integrated ITS 640 . We have configured the PDF printing device as mentioned in the SAP Note # 771683 . We have configured SSO in portal for r/3 system and SSO works fine in portal for Internet services configured in backen