Duplicate emails being produced only through Outlook via Laravel App - outlook

We are using a web application to send out mail. Email is sent and received as expected on a server level and in GMail. However, when messages are pushed to our client's Office365 (Outlook), instead of getting one copy they are getting duplicates.
This is how the app works. You can send emails to a number of people (1,5,20, etc). It's all the same message, subject, etc. It's the same email.
The app sends you a copy. Just one. That's how it is supposed to work. Within their Office365 (Outlook) email account, they get their one copy, and then another copy for each recipient (that's not supposed to happen). So, if you email 5 people, instead of getting one email back, they get 6.
The thing is, this program has run flawlessly for nearly a year. Out of the blue, this glitch started happening.
We have had no code changes, no vendor updates, or anything of the sort on the web application side of things that would trigger since before the time this glitch started happening. When we tested locally, and on the live server, with GMail credentials, the app continues to work as it should.
We are sending out mail via SMTP.
The security protocol is "tls".
https://laravel.com/docs/5.5/mail that describes the core Laravel mail function we are using to send out mail.
The client contacted Microsoft support -- who basically said "I don't know. Not my problem".
I don't know where else to turn, or what other steps to take to debug.

Related

Exchange server filters emails with certain urls in the body of a message and message send fails silently?

I have noticed something very odd about certain emails sent on outlook via an exchange server -- it appears if certain URLs and embedded in the message, message send will fail silently. The message will show up in the "sent items" folder, but it is never actually received by the recipient.
I checked in with GoDaddy who supports my Office365 subscription and they confirmed the behavior (they couldn't send successfully send it either, other me or others in their organization) but had no explanation for the behavior.
I have confirmed that the message sends normally if I use one of my gmail accounts through outlook or or an icloud email account. But my two exchange accounts (on different domains) neither send nor receive any email with this particular embedded url:
(Makes no different if sent in plaintext or not). And other emails, with either no urls or even other urls, send normally. Does Microsoft have a problem with foundation? Or with NFTs or something?
https://foundation.app/#NyanCat/foundation/219
This happens to be the NyanCat NFT that sold for ~$700K a while ago, but no idea what it is about simply the presence of the URL in the body of the message to cause it to fail silently when sent or received on an Exchange server. Not sure if impacts other Exchange servers besides GoDaddy's, but does can anybody explain how this even happening or why?

Microsoft Graph API does not return all received mail for family and personal accounts

Using the following endpoint returns all mail (both sent and received) for a work account:
GET /me/messages
However it doesn't return all received mail for personal/family accounts. Both the v1.0 and beta versions display this behaviour.
Is there a way of retrieving all received mail for personal/family accounts?
returns some or returns error? did you give the api access permissions to those accounts?
make sure to check this official document.
The documentation says you can get up to only 1000 emails at once. And from permissions section, it seems only possible to get all emails from within an application given the permission Mail.ReadBasic.All even for work account.
I don't have a work account thus I tested sending an email to myself on my personal account and tested the query on graph-explorer test page here. The first 2 results are those freshly received and freshly sent ones. with this I will say a work and personal/family accounts are no different on getting emails since you said you can get both received and sent mails from a work account.
so in short, you can get up to 1000 emails unless you use an application with permission to read all but with limited properties because Mail.ReadBasic
allows the app to read email in the signed-in user's mailbox except body, previewBody, attachments and any extended properties, and hence I deduce Mail.ReadBasic.All does the same

Error 550 5.7.708 when creating Calendar Events via the Graph API

When creating Calendar Events via the Graph API, the events are created correctly in the calendar of the organizer but the invites to the participants get bounced. The organizer gets a 'Delivery has failed...' message with the following error message:
Remote Server returned '550 5.7.708 Service unavailable. Access denied, traffic not accepted from this IP. For more information please go to http://go.microsoft.com/fwlink/?LinkId=526653 AS(7171)
Sending emails manually through Outlook (web) from the organizer to the participants works fine.
The issue is intermittent. After changing the DNS server, everything worked fine for some time.
I checked https://protection.office.com/restrictedusers as suggested in the answers to similar posts, but this list is empty.
I also tried delisting the IP address (my own?) through https://sender.office.com/, but to no avail.
The tenant is linked to the Microsoft Developer Program and would allegedly have a 'bad reputation'. However, I don't understand how that would explain the fact that it sometimes works and sometimes doesn't when sending exactly the same API request and hence 'triggering' exactly the same emails...
I think the best way to overcome this would be to add a domain to your developer tenant as per the guidance here:
https://learn.microsoft.com/en-us/Exchange/mail-flow-best-practices/non-delivery-reports-in-exchange-online/fix-error-code-5-7-700-through-5-7-750#57750-client-blocked-from-sending-from-unregistered-domain
Add and validate all domains in Office 365 that you use to send email messages. For more information, see Add a domain to Office 365.
I'm not guaranteeing this will resolve it. You have to understand that those developer tenants are only meant for experimentation and so there are checks and balances to ensure they are used in a bad manor.
How many emails are you sending through this tenant?
Calendar events are sent out via email. Add the "Mail.Send" permission to you App Registration.
This solved it for me.

Outlook add-in - attachment ID's not working correctly in desktop app, but work on web app

I've developed an add-in for Outlook, it needs to be able to access attachments to emails.
On the desktop app, if I move an email with attachments from a shared folder to my main inbox, then try to run the add-in on it, i get the error:
The specified attachment Id is invalid.
However, if I perform exactly the same operation through the web app, it works fine.
I have checked and the Office.context.mailbox.item.itemId and Office.context.mailbox.item.attachments[i].id are exactly the same whether on web or desktop.
Emails with attachments that have not been moved from a different folder, and emails without attachments work fine.
I am fetching the attachment on a remote server through a PHP script, using a callback token I orginally get from Office.context.mailbox.getCallbackTokenAsync. The requests are made via EWS requests.
I am running Office 365 and the Outlook version is 1910 (Build 12130.20390), running on Windows 10.
Can somebody please help?
After some helpful suggestions from #OutlookAdd-insTeam-MSFT, I've come to a solution for this.
The problem is, after moving a message from a shared folder to the main inbox, when using the desktop app, the Office.context.mailbox.item.attachments (created when we run Office.initialize) no longer returns the correct ID's, instead it seems to return the old cached/out of date ID's from before the email was moved. The ID's returned when using the web app are correct using this method.
However, requesting the ID's from the exchange server, via an EWS request (or a REST call, but I use EWS) always returns the correct attachment ID's, whether called from the web app or the desktop app.
So, the solution I have come to is to make sure and request all of the attachment ID's from the exchange server, rather than using the Office.context.mailbox.item object. It means adding in an extra step of having to get a callback token first to then be able to request the info from the exchange server, but it means you always get the correct ID's.
I hope this is of help to someone else.

run a script or sanity check against outgoing emails in outlook 2010

Is there a way to setup Outlook 2010 to run a script or some other form of sanity-check when you attempt to SEND messages from the client? My specific situation is that I use the same outlook client for multiple accounts (work, gmail, VPS server, etc) and I've found myself a couple of times sending emails "from" the wrong account.
In a perfect world I'd want to be able to write a script with logic something like the following:
when (I hit send)
if (the "source" account is "myuserid#gmail.com") then
if (there are addresses in TO or CC that match "work.com") then
pop up a dialog box that says:
"You appear to be sending email to work.com from gmail.com - do you really want to do this?"
if yes, then send it and return
if no, go back to the message compose window
that way, I'd have to actually very intentionally use a non-work email address to send email to the work people (which is rare in my particular case)
Try SendUsingAccount to read the "source" account in ItemSend.

Resources