Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Server Side Sync outgoing mail relay - test works, CRM mails stay in "Pending Send" state.

(0) ShareShare
ReportReport
Posted on by 2

I have an on premises CRM 2015 installation with on premises Exchange 2010 setup and I enabled Server Side Sync for outgoing e-mail. This is done via a SMTP server profile with anonymous SMTP relaying (via the normal port 25) from the CRM backend server to Exchange.

When I approve the e-mail address and 'Test & Enable' my mailbox, the normal CRM Testmail is correctly send and delivered to my mailbox / Outlook. So the Server Side Sync configuration seems to be configured correctly. But when I create e-mails in CRM and send them, they aren't delivered and stay in the "Pending Send" state (or "Waiting to be send" don't know the exact English state name here, my setup is in Dutch) in CRM.

 

I already checked the following:

- Organization mail settings;

- Personal mail settings;

- Server mail profile settings;

- Personal mailbox settings;

- Disabled custom plugins and even some CRM system plugins;

- Checked the Event Log, no errors there;

- Made a server Trace on front- and backend servers. No mail or SMTP errors there. The only clues I see are:

[1] The e-mail delivery gets postponed with 30 minutes (the reason why, I don't see in the trace):

SET DEADLOCK_PRIORITY LOW
BEGIN TRANSACTION 
UPDATE ActivityPointerBase
		SET
			DeliveryAttempts = COALESCE(DeliveryAttempts, 0) + 1, 
			DeliveryLastAttemptedOn = '04/22/2016 10:03:40',
			PostponeActivityProcessingUntil = '04/22/2016 10:33:40'
		OUTPUT
			INSERTED.ActivityId,
			INSERTED.ActivityTypeCode,
			INSERTED.Subject,
			INSERTED.Description,
			INSERTED.PriorityCode,
			INSERTED.EmailAttachmentCount,
			INSERTED.SenderMailboxId,
			INSERTED.DeliveryAttempts,
			INSERTED.ConversationIndex,
			INSERTED.MessageId,
			INSERTED.InReplyTo
		WHERE
			ActivityId
			IN
			(SELECT
				TOP(1000) ActivityPointerBase.ActivityId
			FROM
				ActivityPointerBase WITH (READPAST, READCOMMITTEDLOCK, UPDLOCK)
			LEFT OUTER JOIN
				MailboxBase WITH (NOLOCK) ON (ActivityPointerBase.SenderMailboxId = MailboxBase.MailboxId)
			WHERE
				(
					(
						MailboxBase.EnabledForOutgoingEmail = 1 AND
						MailboxBase.PostponeSendingUntil <= '04/22/2016 10:03:40' AND
						1 = 0
					)
				) AND
				ActivityPointerBase.ActivityTypeCode = 4202 AND
				ActivityPointerBase.StateCode = 1 AND
				ActivityPointerBase.PostponeActivityProcessingUntil IS NOT NULL AND
				ActivityPointerBase.PostponeActivityProcessingUntil <= '04/22/2016 10:03:40'
			ORDER BY
				ActivityPointerBase.DeliveryPriorityCode DESC,
				ActivityPointerBase.ActualEnd ASC
			)


And a few seconds later, the mailbox seems to be getting disabled:

 

BEGIN TRANSACTION
	DECLARE @res INT
	EXEC @res = tempdb..sp_getapplock
				@Resource = 'MailboxQueue_app_lock-49a8d881-a524-e511-8116-005056a133e4',
				@LockMode = 'Exclusive'
	IF @res NOT IN (0, 1)
	BEGIN
		RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
	END 
	ELSE
	BEGIN
UPDATE Mailboxbase WITH (READPAST, READCOMMITTEDLOCK, UPDLOCK)
				SET 
					HostId = 'XXXXXXXX.MSCRMAsyncService.c1fcae7d-d48b-4872-98f8-df2525f515e8',
					ModifiedOn = '04/22/2016 10:03:42',ProcessingLastAttemptedOn = '04/22/2016 10:03:42',ProcessingStateCode = 1,
					PostponeMailboxProcessingUntil = '12/31/9999 23:59:59'
				OUTPUT
					INSERTED.MailboxId,
					INSERTED.ReceivingPostponedUntil,
					INSERTED.NoEmailCount,
					INSERTED.ProcessEmailReceivedAfter,
					INSERTED.IsForwardMailbox,
					INSERTED.EmailAddress,
					INSERTED.ProcessAndDeleteEmails,
					INSERTED.LastMessageId,
					INSERTED.TestEmailConfigurationScheduled,
					INSERTED.PostponeTestEmailConfigurationUntil,
					INSERTED.EnabledForIncomingEmail,
					INSERTED.LastActiveOn,
					INSERTED.StateCode,
					INSERTED.IncomingEmailDeliveryMethod,
					INSERTED.PostponeMailboxProcessingUntil,
					INSERTED.MailboxProcessingContext,
					INSERTED.ActDeliveryMethod,
					INSERTED.EnabledForACT,
					INSERTED.ReceivingPostponedUntilForACT,
					INSERTED.NoACTCount,INSERTED.ProcessedTimes,
					INSERTED.AverageTotalDuration,
					INSERTED.LastDuration
,INSERTED.OrgMarkedAsPrimaryForExchangeSync
,INSERTED.LastSyncErrorCount,
					INSERTED.LastSyncErrorCode
 WHERE 
					MailboxId 
					IN 
					(SELECT 
						TOP (2500) MailboxId 
					FROM 
						MailboxBase WITH (READPAST, READCOMMITTEDLOCK, UPDLOCK) 
					WHERE
						( 
							ProcessingStateCode = 0
							AND
							PostponeMailboxProcessingUntil <= '04/22/2016 10:03:42'
						)
					ORDER BY 
						PostponeMailboxProcessingUntil
					)
EXEC @res = tempdb..sp_releaseapplock 
							@Resource = 'MailboxQueue_app_lock-49a8d881-a524-e511-8116-005056a133e4'
	END
COMMIT



Before I send a test mail I always approve the e-mail address and test and enable the mailbox.

But nothing works... Any help to get the e-mails to be sent is appreciated.

 

 

*This post is locked for comments

  • Maarten Docter Profile Picture
    Maarten Docter 2 on at
    RE: Server Side Sync outgoing mail relay - test works, CRM mails stay in "Pending Send" state.

    Hi Peter,

    I checked my knowledge base and indeed found out this was the answer to a different issue I once had:

    http://www.crmsoftwareblog.com/2015/07/microsoft-dynamics-crm-2015-server-side-sync-email-configuration-test-scheduled-never-runs/

    I refreshed my memory and if I'm correct in our case the problem was in the port 25 and SSL/TLS setting. The system administrator told me that I was to use SSL or TSL, but that didn't work.

    Finally I found some article like these three below:

    http://tunnik.name/how-to-configure-crm-email-server-profile-for-unsecure-connection 

    http://www.magnetismsolutions.com/blog/paulnieuwelaar/2016/02/16/crm-server-side-sync-credentials-disabled---allow-nonsecure-channel 

    http://quantusdynamics.blogspot.nl/2014/07/dynamics-crm-2013-configuring-smtp.html 

    mentioning the two CRM settings: 'AllowCredentialsEntryViaInsecureChannels' and 'ECAllowNonSSLEmail'.

    I asked a DBA to update those settings to the value 1 in the database like mentioned in the Magnetism article and performed the other steps.

    I finally ended up with the following e-mail server profile in CRM. I added some translations in red for clarity:

    2016_2D00_11_2D00_29-15_5F00_30_5F00_28_2D00_Mail-server-profile.png

    Notice that the 'Use SSL for Outgoing Connection' is now enabled and set to 'No'.

    Hope this helps.

    Kind regards,

    Maarten

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Server Side Sync outgoing mail relay - test works, CRM mails stay in "Pending Send" state.

    Hi Maarten,

    thanks for your answer.

    But it didn't work out.

    e-mails stay in de pending state.

    Peter

  • Maarten Docter Profile Picture
    Maarten Docter 2 on at
    RE: Server Side Sync outgoing mail relay - test works, CRM mails stay in "Pending Send" state.

    Hi Peter,

    I'm sorry for not updating this issue. I totally forgot.

    If I remember correctly the problem is trying to activate the mailbox with only an outgoing profile / settings entered.

    For activation you also need to enter the incoming settings. After entering them, approve the e-mail address en press the 'activate and test' button to enable the mailbox.

    Once the test succeeded and you can send mails, edit the mailbox again and remove the incoming settings. The mailbox will stay activated and will still be able to send mail.

    Hope this helps! Please leave a short comment if it does.

    Kind regards,

    Maarten

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Server Side Sync outgoing mail relay - test works, CRM mails stay in "Pending Send" state.

    Hi All,

    We have exactly the same problem.

    Is there already somebody with a solution?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans