Mac Mail api

I have a situation where a third party application is using Mail API to send a message to me but nothing is received in my Mac Mail. The problem is suspected to be configuration on my MacOS High Sierra (10.13.6) but I know of no configuration dealing with Mail and it's API.

Is there any configuration needed to allow the Mail API to interface with Mac Mail?

iMac 27″, macOS 10.13

Posted on Sep 22, 2022 2:24 PM

Reply

Similar questions

12 replies

Sep 22, 2022 2:36 PM in response to cearlp

Have you engaged the third-party application support folks?


Is the message send performed locally, or is the send arriving from a remote host?


Mac Mail doesn’t particularly have an API.


If sent from remote, shut off the Mail app on the Mac, send a message, and see if it arrives via iCloud.com. If not, it’s either egregiously spam, or the sending host is misconfigured.

Sep 22, 2022 3:54 PM in response to cearlp

With the developer unable or unwilling to troubleshoot this and with insufficient in-built diagnostics, and with the use of FTP—FTP transmits login credentials openly and insecurely, and FTP is inherently incompatible with any modern network security that doesn’t also sniff traffic—and with (local?) logs somehow getting shipped around by email, I’d be considering a replacement app.


Ask them specifically how they send the message. i’d expect they’ll send via an ESMTP connection to a mail server. There are various PHP and Python and other scripts for this, and a direct ESMTP via TLS in Swift ot ObjC or such isn’t that difficult. Sending directly into iCloud under your iCloud login credentials, in this case. Maybe they’re using AppleScript to script the mail? But either way, that’s a lot of (potentially fragile) work for shipping around a local log file, rather than generating it and offering a Save As function. Particularly if the app is running in your local login session, but even a running-in-the-background app can be coded to and then asked to provide a file somewhere useful.


Ask for the path to the local logs, or if there’s a way to enable local logs.


Somebody is going to need to take a look at the app source code. Above is based on a whole lot of guesses.

Sep 22, 2022 8:05 PM in response to cearlp

That’s Objective C and AppKit.


(And a whole pile of stuff I was unaware of.)


Here’s an example of how to use that call:

https://indiespark.top/featured/programmatically-sending-rich-text-mail-attachment-mac/


This does send to the server.


So… quit the Mail app. Temporarily.


Trigger the report send in the other app.


Use Safari, and log into your Apple ID on iCloud.com, and see if the mail is there.


Also see if the Mail app launches.


If the Mail app does launch, you’re probably going to need to shut off all local rules (temporarily) and re-send the report, and try again. (I can’t tell from the doc if it launches Mail or not. I’d hope it does not, but will have to run some tests here to check that.)


Sep 23, 2022 8:00 AM in response to cearlp

With Mail app offline and no waiting message and no active mail client (and having checked via iCloud and Safari and not via the local possibly-with-rules Mail app client), and with nothing found in the spam or junk folder, this is back to what looks like an app issue, and a “so where’s the local log file stored really” request with the vendor.


With the full source and build environment, somebody around here might be able to help support this app, but otherwise…


And again, FTP is a trashfire on modern networks, and best avoided.

Sep 22, 2022 4:16 PM in response to cearlp

The code comments don’t seem helpful, eh?


See if Mail app launches, if it’s shut off when the contents of the app log is requested. If it doesn’t launch, then the app is likely using a different path.


If the Mail-logging code you’re looking at is AppleScript, here are some other examples of what that usually looks like:

Introduction to AppleScript Language Guide

https://macosxautomation.com/applescript/examples.html


Did you have to enter your Apple,ID credentials or set up a Mail app-specific password for this app?



Sep 22, 2022 3:14 PM in response to MrHoffman

MrHoffmann,

The third party folks are the ones who think it is a configuration problem on my system.

I'm not sure where the message is coming from.I use their application, (which is designed specifically for the Mac), on my system and ask it to publish the results on another system using FTP.

When the publish process fails I ask their application to send me the error log to see just why the publishing process failed. They say the log sending process is not an internet connection, it uses my local MacOS API to send the error log to my Mail.

I send and receive mail all the time using my Mail app and the only email address I have is through iCloud. (xxx@mac.com), but if it is not an internet connection it might just be from within their application.


Sep 22, 2022 4:06 PM in response to MrHoffman

Mr Hoffman,

Thank you for your reply and insight.

I did get a copy of their API code but don't really understand it.

If I thought it would be ethical I could show it to you but it would have some details in it that might be sensitive.

I agree with you about wondering why they can't or won't just give me access to the error log, especially if it is generated on my system. They have the option to publish to a file but want a $130. license to that version.

Sep 23, 2022 7:29 AM in response to MrHoffman

Your indiespark.top link was very interesting. I looked at the entire piece of code they sent me and I can almost understand it.

It has a few notations in it that are not is the indiespark.top example but that is irrelevant .

I did as you outlined and find out that the Mail app does NOT launch and that iCloud does not have any mail other than what I already had seen in my Mail app.

Sep 23, 2022 3:50 PM in response to MrHoffman

After telling them how Mail was shut down, the Mail app was not launched and no mail came to my iCloud mail, I asked how I can view the log file and this was the response:


The log is in the app’s memory, it’s only exported to a file when sending the email.

The code does not imply the email ever going out of your Mac, it’s directly opening Mail.


Is there a setting I can turn on logging what is happening on my Mac?

Sep 23, 2022 4:14 PM in response to cearlp

Solely logging through mail would not be my app design preference.


If that logging setting existed, I’d assume the app support team would suggest it.


I’m not in a position to reverse-engineer this app, and would likely choose to replace it.


Absent add-on VPN client apps, add-on cleaners, add-on anti-malware apps, \ and other such apps which can cause weird issues, there does not seem to be a path forward here.

Sep 22, 2022 4:45 PM in response to MrHoffman

My Mail app is always active I never shut it off so it doesn't have to be launched.

I don't have to enter a password for Mail unless I sign on to iCloud from some other system.

From looking at your AppleScript links their code looks nothing like it.

Here is a portion of the code they sent me:


NSSharingService *emailSharingService = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail];

emailSharingService.recipients = @[ @"feedback@xxxxxxapp.com" ];


I have no idea what language the routine is using.



  

Sep 23, 2022 5:16 PM in response to MrHoffman

I agree with you 100%.

The app was written with the Mac as the platform for it, and if the support people for the app don't want to help me find out what "my configuration problem" is (since they maintain the problem is on my side) I will just quit using their app.

Thanks for all your responses...I really appreciate them.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Mac Mail api

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.