Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Editing message with BBEdit doesn't work

#2129
  • Select a message.
  • From Command menu, choose BBEdit > Edit.
  • Note that a new BBEdit document window is opened, but it does not contain the message, and is titled '+'.

Mailmate 1.12, BBEdit 12.1.5, macOS 10.13.6.

Reported by Mike Conley · October 6th, 2018 @ 04:12 AM

State: new
Milestone: none
Assigned to: benny benny

Activity

  1. benny
    benny

    Sorry about the late reply. Do you still have this issue?

    I suspect the bbedit command might have changed. This is how it is currently used:

    bbedit --wait --resume --clean +${MM_LINE_NUMBER} --pipe-title "${MM_TITLE:-(no subject)}" "${MM_EDIT_FILEPATH}"
    

    If you know how to use a Terminal window then maybe you can use that to figure out what's wrong. (I don't have BBEdit installed.)

    November 21st, 2018 @ 10:19 AM

  2. Mike Conley
    Mike Conley

    I can sort of reproduce this if I set all of the MM_* variables to "" and execute the above command. I get a BBEdit window with a title of '+' and a path of '~/+' instead of '/+'. If I set MM_TITLE and MM_EDIT_FILEPATH to reasonable values but leave MM_LINE_NUMBER undefined, I get the same result.

    If I set all three (e.g., set MM_LINE_NUMBER to '0'), the command works perfectly.

    So I assume that one or more of your MM_* variables are not being passed to the shell, or are not being set.

    November 21st, 2018 @ 03:33 PM

  3. benny
    benny

    Thanks for investigating. I should be able to reproduce this without BBEdit.

    November 22nd, 2018 @ 08:03 AM

  4. benny
    benny
    • State changed from new to cantreproduce

    Unfortunately I don't see it missing and it works with other editors.

    Try enabling this debug variable:

    defaults write com.freron.MailMate MmDebugCommands -bool YES
    

    Then launch MailMate from a Terminal window:

    /Applications/MailMate.app/Contents/MacOS/MailMate
    

    Trigger the Edit command and then loot at the output. Make sure you look at the output after:

    Triggered command named “Edit”
    

    Look for MM_LINE_NUMBER in the list of environment variables.

    November 22nd, 2018 @ 08:11 AM

  5. Mike Conley
    Mike Conley

    Here you go. No variables being set, as far as I can see:-

    Triggered command named “Edit”
    Input type is “none”
    Environment variables:
     Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.WMcgvDVDag/Render
     EDITOR: /usr/bin/bbedit --wait 
     GROUP: staff
     HOME: /Users/nomad
     HOST: Enterprise.local
     HOSTTYPE: unknown
     LANG: en_GB.UTF-8
     LC_CTYPE: en_US.UTF-8
     LOGNAME: nomad
     MACHTYPE: x86_64
     MM_BUNDLE_ITEM_NAME: Edit
     MM_BUNDLE_ITEM_UUID: 4382C559-76C1-4950-BD10-33A1EBCA9B5D
     MM_BUNDLE_SUPPORT: /Users/nomad/Library/Application Support/MailMate/Managed/Bundles/BBEdit.mmbundle/Support
     MM_ID: 69542
     MM_SUPPORT_PATH: /Applications/MailMate.app/Contents/SharedSupport
     MM_TITLE: Recommends: New Photolemur 3 with -60% OFF (Black Friday Discount)
     OSTYPE: darwin
     PATH: /usr/bin:/bin:/usr/sbin:/sbin
     PWD: /Users/nomad
     SHELL: /bin/bash
     SHLVL: 2
     SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.cpQOpzN4KY/Listeners
     SVNREPOS: svn+ssh://mail.crystalmaker.com/Users/Shared/SVN/Repositories
     TERM: xterm-color
     TERM_PROGRAM: Apple_Terminal
     TERM_PROGRAM_VERSION: 404.1
     TERM_SESSION_ID: D2C0AAA0-713C-48A5-9DD0-EF84048EAF2F
     TMPDIR: /var/folders/f1/g6_hndxj31s5crczpd60f4tm0000gq/T/
     USER: nomad
     VENDOR: apple
     XPC_FLAGS: 0x0
     XPC_SERVICE_NAME: 0
     _: /Applications/MailMate.app/Contents/MacOS/MailMate
     __CF_USER_TEXT_ENCODING: 0x1F7:0x0:0x2
    bash-3.2$
    

    November 23rd, 2018 @ 05:03 PM

  6. Mike Conley
    Mike Conley

    In case it's helpful, here are my .login and .tcshrc files (my default shell is tcsh, not bash).

    EDIT: Probably not helpful. I just moved them out of the way and tried it again, but it made no difference.

    November 23rd, 2018 @ 05:06 PM

  7. benny
    benny

    Ah, I now realize what the problem is. You wrote “Select a message” in your original ticket. This is not the purpose of the “Edit” command. It's for the Composer window and allows you to compose the text of an email in your text editor of choice.

    Were you looking for a way to alter a raw email?

    November 23rd, 2018 @ 05:10 PM

  8. Mike Conley
    Mike Conley

    Ah.

    I think it would be nice to be able to open any message in the text editor of choice (and it would be very helpful to be able to open a raw message directly into BBEdit, though perhaps there's a way to script that).

    I guess I find the command as it stands a bit confusing, and didn't realise what it was meant to do. Maybe it would be good to have a variant of the command (via modifier key) which would open a new message body immediately in the editor of choice; the MM Composer window could open in the background, but I wouldn't have to worry about it until I'd finished editing.

    November 23rd, 2018 @ 05:19 PM

  9. benny
    benny
    • State changed from cantreproduce to accepted

    The setting you mention already exists (although hidden).

    I'll put the request for editing the raw email in the “accepted” category. It might actually be something I could use myself for testing purposes -- when I think about it I realize that I relatively often export/edit/import when I try to debug an issue.

    But I'm not sure it's of any general interest (use cases?).

    December 11th, 2018 @ 01:20 PM

  10. Mike Conley
    Mike Conley

    I'll put the request for editing the raw email in the “accepted” category.

    Cool.

    But I'm not sure it's of any general interest (use cases?).

    I use this quite often. I'm constantly examining full email source here at our school to determine whether a message somebody has received is spam or malicious. I realise I can do this within MM itself, but, having been a BBEdit user since the app itself was being developed far too many years ago, I am just more comfortable doing that sort of thing in BBEdit than anywhere else.

    December 11th, 2018 @ 01:33 PM

  11. benny
    benny

    The one-way solution (opening it in BBEdit) should be a pretty simple bundle command. It's the “put it back in MailMate” part that'll require some work (and maybe the part that is mainly useful to me).

    December 11th, 2018 @ 01:43 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.