cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate messages in sender mail adapter

Former Member
0 Kudos

Hi,

We are using the sender mail adapter to retrieve messages from an IMAP mail server. Messages are being picked up correctly, but when we have large messages (with e.g. PDF attachments) things go wrong.

The time it takes to retrieve the mail message is longer than the poll time. In this case the adapter logs in again in the mail server to retrieve the first new message from the inbox. However the first adapter threat is already retrieving that message. This results in a duplicate message in XI. (messages are set to be deleted when read).

We have tried all kind of settings in the adapter but without any results. The adapter works fine with very small messages.

Does anyone recognize this problem?

PS. please do not post links to sap help or the mail adapter FAQ. Useful answers will be rewarded.

Thanks,

Christiaan Schaake

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Christiaan !

I understand your problem. Could you set your IMAP account to avoid multiple simultaneous sessions?? maybe if there is only one session allowed per user or per time, then parallel XI threads will not be able to start downloading the messages.

If you cannot use a longer poll interval, then you could develop an adapter module for the Mail sender adapter that could be used to verify if the current mail is just being downloaded by other thread. This adapter module could check the unique mail data (date/time + subject + etc.) against a local table.

Regards,

Matias.

PD: please award points if helpful.

Message was edited by:

Matias Denker

Answers (2)

Answers (2)

Former Member
0 Kudos

Matias,

Thanks for your advise. I've been thinking of your solution, but the problem is that some emails are created from a fax receiving application. The application creates an email with a PDF attachment. This attachment always has the same name.

I think we have to redesign the complete scenario and maybe even not use XI to process the mails.

Thanks for your help. Any other suggestion is still very welcome.

Kind regards,

Christiaan Schaake.

Former Member
0 Kudos

Hi Christiaan !

Maybe you should also contact SAP and report the bug, maybe thru service marketplace.

The last idea, could be to develop a new mail adapter that controls all the necessary steps.

Regards,

Matias.

Former Member
0 Kudos

Hi Matias,

Thanks for your quick response. We have been thinking about the 3 options.

First of all the poll interval cannot be set large enough. Our messages have large attachments and it takes sometimes 30min. to download them.

Secondly we cannot limit the mailserver to allow only single logins. It just is not possible in the software.

Third, there is no unique identifier that identifies the mail message. Subject and date-time stamp is a very dangerous combination. We get a lot of messages with the same subject, and they are send in batches, so they can have the same timestamp.

Is there a way to limit the adapter in a adaptermodule? Like a singleton object?

Regards,

Christiaan Schaake.

Former Member
0 Kudos

Hi !

I think there is no way to limit the amount of threads assigned to each adapter.

Have you tried to use a quality of service of Exactly Once In Order and state a queue name. I think this setting will also start multiple threads retrieving messages from the imap account, but the message will be enqueued all in the same queue in the order they were retrieved. Did you try this ? just to see if the behavior is better. There should be some field or fields that could be use as "primary key" for the mail..

Regards,

Matias.

Former Member
0 Kudos

Hi Christiaan !

I've one idea..

You could split the scenario in 2 scenarios.

Scenario 1: Mail-XI-File

Downloads mails and writes them as a file in a folder. You should use the file creation mode = create and uncheck the "overwrite existing file" indicator, to have each mail written only once. The filename should be created based on ID fields that are unique in each mail.

Scenario 2: File-XI-your current receiver

Just an idea.

Regards,

Matias.