Mail Extensions

RSS for tag

Use Mail Extensions for composition, message actions, secure email, and content blocking in the Mail app.

Posts under Mail Extensions tag

35 Posts
Sort by:
Post not yet marked as solved
0 Replies
39 Views
Mac Mail app always displays iCloud mailbox as an "offline server", while other mailboxes work well. Mac Mail app shows iCloud incoming mail server unrelated to iCloud and to my iCloud ID. The outgoing mail server line is empty. The same iCloud mail account works well on the web and on iPhones but does not work with the Mac Mail app. I have tried resetting the account, rebooting, reloading, etc., and also checked all Help articles and forums, but did not find any guidelines on how to correct incoming and outgoing server addresses for Mac Mail app. MasOS: 14.5 Beta (23F5049f)
Posted
by Nik_7.
Last updated
.
Post not yet marked as solved
0 Replies
150 Views
Hello. I have the following question. I have a program that creates files with its own extension and reads them. When I select a file with my extension in the Files app, it automatically opens my app. But if a file with my extension is attached to an email, when I click on my file it shows me a screen with programs to open (actually it shows my program the second time I click on the file, if I click the first time, my program is not listed) . I have a question, is it possible to make the file with my extension attached to the letter immediately open in my program without additional screens or is it not allowed. If possible, then what did I miss, based on the fact that it opens immediately from the Files program. Thank you. P.S. File how it works below: ![] [Image Edited by Moderator to Remove Personal Information]
Posted
by 20a.
Last updated
.
Post not yet marked as solved
0 Replies
107 Views
I am using MFMailComposeViewController to allow users to share in my app. Now my app is swiftUI so I had to wrap it in UIViewRepresentable. I have tied my mailComposeDelegate for dismissing as well. struct MailComposerView: UIViewControllerRepresentable { @Environment(\.presentationMode) var presentation @Binding var result: Result<MFMailComposeResult, Error>? var mailControllerWrapperBuilder: () -> MFMailComposerControllerWrappable = { MFMailComposeViewController() } let subject: String let body: String class Coordinator: NSObject, MFMailComposeViewControllerDelegate { @Binding var presentation: PresentationMode @Binding var result: Result<MFMailComposeResult, Error>? init(presentation: Binding<PresentationMode>, result: Binding<Result<MFMailComposeResult, Error>?>) { _presentation = presentation _result = result } func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) { defer { $presentation.wrappedValue.dismiss() } guard error == nil else { if let error = error { self.result = .failure(error) } else { self.result = .failure(NSError()) } return } self.result = .success(result) } } func makeCoordinator() -> Coordinator { return Coordinator(presentation: presentation, result: $result) } func makeUIViewController(context: UIViewControllerRepresentableContext<MailComposerView>) -> UIViewController { var mailComposer = mailControllerWrapperBuilder() mailComposer.setSubject(subject) mailComposer.setMessageBody(body, isHTML: false) mailComposer.mailComposeDelegate = context.coordinator return mailComposer.getUIViewController() } func updateUIViewController(_ uiViewController: UIViewController, context: UIViewControllerRepresentableContext<MailComposerView>) { } } protocol MFMailComposerControllerWrappable { var mailComposeDelegate: MFMailComposeViewControllerDelegate? { get set } var delegate: UINavigationControllerDelegate? { get set } func setSubject(_ subject: String) func setMessageBody(_ body: String, isHTML: Bool) func getUIViewController() -> UIViewController } extension MFMailComposeViewController: MFMailComposerControllerWrappable { func getUIViewController() -> UIViewController { self } } On my main view, which is a swiftui sheet, I present mail composer as a sheet. @State var showMail = false var body: some View { VStack { Button("Mail", action: { showMail = true }) } .sheet(isPresented: $showMail, content: { MailComposerView(result: $viewModel.mailResult, subject: "subject", body: "body") .presentationDetents([.large]) }) } On iOS 17 when swiping down, interactive dismiss is activated and shows user if they want to cancel sending mail. While on iOS16 this behaviour is not observed. I have tried following A custom swiftui view in sheet has interactive dismiss UIViewRespresentable of custom uiview has interactive dismiss Seems like this bug has to do with MFMailComposeViewController itself. Is there a known issue that was fixed in iOS 17? On other apple apps, this behaviour is not observed. One fix that I have on my mind is to present mailcomposer via rootcontroller and not rely on swiftui sheet.
Posted
by shjain.
Last updated
.
Post not yet marked as solved
0 Replies
221 Views
Hi, I'm working on a series of scripts and utilities that process logs and generate pre-composed email reports as a consequence, and wanted to use the open "mailto:address?subject=my subject&amp;body=..." to do so from the scripting. to, cc, bcc, subject, and body are all obvious attributes, but what others are handled? Emails are typically sent from a joint mail address, not the user's primary (default) mail account (but one that is also locally provisioned in Mail.app). So I'd like to force the from=address attribute as well. And the messages should be text/plain, not multipart, and the charset of us-ascii. Where can I find the detailed handling on mailto: URL's in MacOS? RFC-6068 is unfortunately a guideline, and doesn't flesh out many requisites. Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
174 Views
We have a MailExtension using new Apple MailKit API. The extension returns an error from the SecurityHandler's Encode Method based on certain conditions and If an error is reported during mail send 3/4 times, even after user performed a corrective action and hits send again, the same error is is shown by Mail again for couple more times. The attached sample mail extension project returns an error after hitting send if subject line of the mail is “Show Alert”. If we repeat the error 3/4 times then even after changing the subject line the error is reported once or twice more. it is an Apple issue as per our investigation. After the subject line is changed in the mail, each time security handler’s encodeMessage is called, we return it successfully and no error is returned to Apple. Still the old error pop-up appears. I think this is a gap in sync between the remote process that loads the extension and actual Mail.app process. It takes a bit of time to reflect the status of encoding to Mail.app from the remote helper process. This is a timing issue, depends on how fast you keep bombarding the Send. After making the correction of the erroneous condition (in this sample, the subject line) if you wait for ten seconds and then hit ‘Send’ the issue doesn't happen. which suggests its a timing sync issue at Apple end. Code Sample Anyone else seeing this?
Posted
by tathac.
Last updated
.
Post not yet marked as solved
0 Replies
204 Views
I'm subscribed to Proton Mail. Their system has my Mail.app client showing nothing in the Inbox while All mail has unread messages. Not sure how this works, and Proton blames it on the client application. With Mail.app closed, I head to the Proton web interface, where it currently shows 9 in Inbox, and 9 in All Mail. So Proton seems to be legit, and Mail.app screws this up somehow. How can I fix this? Cheers
Posted
by daBee33.
Last updated
.
Post not yet marked as solved
0 Replies
396 Views
I am creating an app where i am opening the direct share extension in app for different apps like instagram, snapchat and whatsapp. It is working fine i know there share extension bundle id and it open perfectly. I also need to open the iMessages share extension in app i have found the bundle id of iMessage share extension it is com.apple.UIKit.activity.Message but when i try to open it got error extension not found. Any one have any idea how i can find the right bundle if for iMessage share extension ? I am using an iOS SPM package LNExtensionExecutor and create a bridge between React Native and this native package.
Posted
by awahab94.
Last updated
.
Post not yet marked as solved
0 Replies
334 Views
My grand plan is to have a rule in Apple Mail that automatically adds a custom header to each message. This rule would be last and each of the rules before that last rule would check for the presence of this custom header and therefore no longer work for incoming mail. So the plan is to have a small AppleScript that adds this header but I am running into a block which hopefully someone can help we with. I have the following pieces of code: tell application "Mail" activate set myHeader to make new header with properties {name:"X-MySecretHeader", content:"It's been set"} end The last statement fails with the following error: Mail got an error: Can’t make or move that element into that container. I then changed the code slightly: tell application "Mail" activate set theMessage to get item 1 of (get selection) set theHeaders to headers of theMessage set myHeader to duplicate item -1 of theHeaders end Mail got an error: Headers can not be copied. That last error seems to indicate that I'm trying to do something which cannot be done. I have also tried to do this in a tell block to theMessage but that did not change anything. Anyone has an idea?
Posted
by FredA.
Last updated
.
Post not yet marked as solved
2 Replies
280 Views
I need to send confirmation mail to customer once, When Customer orders it. I have some methods in Google but all of those methods Triggers the Mail Extension in Mail App and Opens up Mail I don't need to trigger and show the Mail to Customers I just want to send the Order summary to customer Mail Address is there any way or API , SDK
Posted Last updated
.
Post not yet marked as solved
0 Replies
269 Views
Since the recent update attachments to received emails are not showing. The attachments clip icon shows they are there, but is unresponsive on click and grey. If I forward the message it asks if I want to include the attachments, so they are there with certainty. Does anyone know why as of last update this is happening ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
217 Views
Mail searching does not work for me in Sonoma 14.2. I type in the search block, and get nothing. I click my VIP list, get nothing.
Posted Last updated
.
Post marked as solved
4 Replies
1.5k Views
Hi, In our organisation, we create and ship a plug-in for the MacOS Mail app along with our software package. We have heard that mail plugins are not supported in Mac OS Sonoma any more. https://www.macrumors.com/2023/06/14/macos-sonoma-drops-legacy-mail-app-plug-ins/ Can anyone tell us more details about what changed, what is its impact and any way to achieve similar functionality as the mail plugins offer, going forward. We read that mailkit extensions are a new thing, we could also use any heads up on its capabilities and limitations (if known). Thanks, Tathagata
Posted
by tathac.
Last updated
.
Post not yet marked as solved
2 Replies
1.6k Views
I was playing around with Mailkit. I wanted to extract some info, and show a notification when an email arrives. I copied some code that looked alright for notifications and added it to the defailt MailKit template. I ran it, enabled the extension, sent myself an email and.... Mail app crashes I restart the Mail app, and it instantly crashes on launch. I try to comment out the notification code that i added, compile it and restart the Mail app, and it still crashes. Any help for getting my Mail app back to work would be appreciated! Here is the exact code that made this happen. Don't run it locally unless you want your Mail app to no longer work. import MailKit import UserNotifications class MessageActionHandler: NSObject, MEMessageActionHandler {   static let shared = MessageActionHandler()       func decideAction(for message: MEMessage, completionHandler: @escaping (MEMessageActionDecision?) -> Void) {     // The action to take on the message, if any.     var action: MEMessageActionDecision? = nil           // Check if the subject of the message contains the word Mars.     // If it does, specify an action to set the background color to red.     if message.subject.contains("Mars") {       action = MEMessageActionDecision.action(.setBackgroundColor(.red))     }           let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)     var content = UNMutableNotificationContent()      content.title = "Message1"          content.subtitle = "subtitle"          content.body = "body"          content.sound = UNNotificationSound.default          var request = UNNotificationRequest(identifier: UUID().uuidString , content: content, trigger: trigger)          UNUserNotificationCenter.current().add(request)           // Always call the completion handler, passing the action     // to take, or nil if there's no action.     completionHandler(action)   } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
281 Views
Hi, So far in my knowledge of the Mailkit API, a security handler’s encode method is the only place I can alter the RFC 822 data of an email (https://developer.apple.com/documentation/mailkit/memessageencoder/3882902-encode), Any other interface method that gives access to the message data gives a read only access. Can Please confirm if the same understanding is incorrect? Encode method, as the below documentation claims, is supposed to be called once, when the message is sent, but I can see that my extension’s encode method is being called several times during composing of an email. Is this a bug? /// @brief This is invoked when an outgoing message is sent. The supplied @c message will contain the email address of the sender, the recipient email addresses, and the message data being sent. The completion handler should be called with the @c result of applying any encoding if needed based on @c shouldSign and @c shouldEncrypt. If the @c result is not encrypted or signed and does not have any errors, it is assumed the message did not need a signature or encryption applied. In this case the @c data for the result will be ignored. /// @param message - The outgoing message to apply any security mechanisms on. /// @param composeContext - @c MEComposeContext instance which corresponds to the @c message being composed. (void)encodeMessage:(MEMessage *)message composeContext:(MEComposeContext *)composeContext completionHandler:(void (^)(MEMessageEncodingResult *result))completionHandler; I also noticed that mailComposeSessionDidBegin from ComposeSessionHandler is getting called but mailComposeSessionDidEnd isn't when I close the compose window of an email or hit send button. Is this also a bug?
Posted
by tathac.
Last updated
.
Post not yet marked as solved
1 Replies
450 Views
I'm trying to sync Gmail with the Apple Mail client and setup a Smart Mailbox of important emails that are unread. The Gmail emails sync correctly, in various folders as on Gmail. However, when I try to create a smart mailbox, they don't filter in and when you go to edit that smart mailbox, the filters reset. See images below: Image 1: Smart Mailbox Settings Image 2: Resets to 'No mailbox selected' after clicking ok (above) Image 3: The Gmail mails are syncing and filtering correctly, as on Gmail. The smart mailbox works for iCloud accounts though and Apple support wasn't helpful. They said it's Google's problem (even though that doesn't make sense) and even refused to create a ticket for further investigation. Google says that since the emails are syncing and filtering, the problem isn't at their end, it is with the way the Apple Mail client works (and that makes sense). Can anyone please help me with a fix here?
Posted
by mhmmdmz.
Last updated
.
Post not yet marked as solved
0 Replies
361 Views
I am looking into mail kit extensions and I can see that a security handler extension is the recommended way to offer encryption functionality for emails, however if user chooses to click the padlock icon in top right side of compose window, he can opt out of encryption and the security handler encode method is not called. Is there a way to force and mandate that user cannot opt out of encryption and a security handler's encode method is always called by Mail? My objective is actually to be able to inspect every mail attachment and depending on my business logic, I want to encrypt some of the mail attachments. So I need to make sure my security handler's encode method is called, always. Any other approach for achieving the same is also welcome.
Posted
by tathac.
Last updated
.
Post not yet marked as solved
0 Replies
353 Views
We have a custom iOS/iPad app with a thin custom mail client. I am aware of the iOS API that can configure and setup the account at device level. We want to add Exchange ActiveSync support to it so that mail can get pushed to our app. How do we achieve this?
Posted Last updated
.