{"thread":{"id":"58749","subject":"Can git send-email support neomutt?","startedAt":"2022-11-05T15:54:16Z","lastAt":"2022-11-06T10:17:29Z","messageCount":5,"participants":["Wu Zhenyu","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"466585","messageId":"20221105154600.hbrqs74inmvpebie@desktop","threadId":"58749","inReplyTo":null,"subject":"Can git send-email support neomutt?","fromName":"Wu Zhenyu","fromEmail":"wuzhenyu@ustc.edu","sentAt":"2022-11-05T15:46:00Z","receivedAt":"2022-11-05T15:54:16Z","isPatch":false,"sender":{"key":"wuzhenyu@ustc.edu","avatar":"https://gravatar.com/avatar/16eb854115234100d5741dd67e2c5b94f635070478dac019ce21c662bc68d605?d=mp&s=160"},"body":"Excuse me.\n\nI want to use neomutt as git send-email's cmd:\n\n```\n[sendemail]\n\tsendmailCmd = neomutt\n```\n\nHowever, I notice\n\n```\nmy @sendmail_parameters = ('-i', @recipients);\n...\nexec (\"sh\", \"-c\", \"$sendmail_cmd \\\"\\$@\\\"\", \"-\", @sendmail_parameters)\n```\n\nIt call `neomutt -i to@email from@email`, which is an incorrect cmd for neomutt.\n\nCan we customize sendmail-cmd more flexible? Like\n\n```\n[sendemail]\n\tsendmailCmd = neomutt %{to}\n```\n\ncall `neomutt to@email.com`.\n\nThanks!\n\n-- \nBest Regards\nWu Zhenyu\n"},{"id":"466611","messageId":"Y2anAijZxu9QEX4M@tapette.crustytoothpaste.net","threadId":"58749","inReplyTo":"20221105154600.hbrqs74inmvpebie@desktop","subject":"Re: Can git send-email support neomutt?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2022-11-05T18:10:10Z","receivedAt":"2022-11-05T18:10:20Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2022-11-05 at 15:46:00, Wu Zhenyu wrote:\n> Excuse me.\n> \n> I want to use neomutt as git send-email's cmd:\n> \n> ```\n> [sendemail]\n> \tsendmailCmd = neomutt\n> ```\n\nMutt and Neomutt are MUAs, which stands for mail user agent.  That is,\nthey're mail clients that people use to read, compose, and send email.\nThe sendmailCmd wants an MTA, or mail transfer agent, which is\nessentially a mail server.  It's customary for most Unix systems to have\nsuch a piece of software which emulates the original Sendmail in its\ncommand-line interface, even if that's to send data off the system.\n\nThat's why you see a fixed interface here, because whether someone is\nusing Sendmail, Exim, Postfix, or a smarthost-only tool like esmtp-run,\nwhatever software is being used presents the same interface.\n\nIt's not likely that we'd add a lot of customizability to this option.\nHowever, you can use the same SMTP server that you use with Neomutt by\nsetting the smtpuser, smtpencryption, smtpserver, and smtpserverport\noptions.\n\nYou can also use `git format-patch --stdout | neomutt -f -` and that may\nprovide you the same functionality you were hoping for with\n`sendemail.sendmailCmd`.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"466628","messageId":"20221106090233.ukf6rjzrygpnavzh@desktop","threadId":"58749","inReplyTo":"Y2anAijZxu9QEX4M@tapette.crustytoothpaste.net","subject":"Re: Can git send-email support neomutt?","fromName":"Wu Zhenyu","fromEmail":"wuzhenyu@ustc.edu","sentAt":"2022-11-06T09:02:33Z","receivedAt":"2022-11-06T09:03:28Z","isPatch":false,"sender":{"key":"wuzhenyu@ustc.edu","avatar":"https://gravatar.com/avatar/16eb854115234100d5741dd67e2c5b94f635070478dac019ce21c662bc68d605?d=mp&s=160"},"body":"Thanks for your quick reply.\n\n> You can also use `git format-patch --stdout | neomutt -f -` and that may\n> provide you the same functionality you were hoping for with\n> `sendemail.sendmailCmd`.\n\nIt cannot use `git send-email -1` I like.\n\n> Mutt and Neomutt are MUAs, which stands for mail user agent.  That is,\n> they're mail clients that people use to read, compose, and send email.\n\nPeople can use MUA to send email, the only problem is `-i`. I consider the following method\n\n```\n[sendemail]\n\tsuppresscc = author\n\tsendmailCmd = git-neomutt\n```\n\n`~/.local/bin/neomutt`\n\n```\n#!/usr/bin/env bash\nneomutt \"${@//-i/}\"\n```\n\nAnd it can work:\n\n```\n❯ git send-email -1\n/tmp/5441yKUviQ/0001-TEST.patch\nThe following files are 8bit, but do not declare a Content-Transfer-Encoding.\n    /tmp/5441yKUviQ/0001-TEST.patch\nWhich 8bit encoding should I declare [UTF-8]?\nTo whom should the emails be sent (if anyone)? my-another@email\nMessage-ID to be used as In-Reply-To for the first email (if any)?\nLogging in...\nWarning: Fcc to an IMAP mailbox is not supported in batch mode\nSkipping Fcc to imaps://imaphz.qiye.163.com/Sent\nOK. Log says:\nSendmail: git-neomutt -i my-another@email\nFrom: Wu Zhenyu <wuzhenyu@ustc.edu>\nTo: my-another@email\nSubject: [PATCH] TEST\nDate: Sun,  6 Nov 2022 16:39:49 +0800\nMessage-Id: <20221106083949.210946-1-wuzhenyu@ustc.edu>\nX-Mailer: git-send-email 2.38.1\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nResult: OK\n```\n\nI want to know can we remove `-i` to allow more MUA/MTA? If user want to add something, why not let them\n\n```\n[sendemail]\n\tsendmailCmd = msmtp -i\n```\n\nI think it should be easy to realize.\n\nAnd I'll consider share this tip to neomutt.\n\nThanks!\n\nOn Sat, Nov 05, 2022 at 06:10:10PM +0000, brian m. carlson wrote:\n> On 2022-11-05 at 15:46:00, Wu Zhenyu wrote:\n> > Excuse me.\n> > \n> > I want to use neomutt as git send-email's cmd:\n> > \n> > ```\n> > [sendemail]\n> > \tsendmailCmd = neomutt\n> > ```\n> \n> Mutt and Neomutt are MUAs, which stands for mail user agent.  That is,\n> they're mail clients that people use to read, compose, and send email.\n> The sendmailCmd wants an MTA, or mail transfer agent, which is\n> essentially a mail server.  It's customary for most Unix systems to have\n> such a piece of software which emulates the original Sendmail in its\n> command-line interface, even if that's to send data off the system.\n> \n> That's why you see a fixed interface here, because whether someone is\n> using Sendmail, Exim, Postfix, or a smarthost-only tool like esmtp-run,\n> whatever software is being used presents the same interface.\n> \n> It's not likely that we'd add a lot of customizability to this option.\n> However, you can use the same SMTP server that you use with Neomutt by\n> setting the smtpuser, smtpencryption, smtpserver, and smtpserverport\n> options.\n> \n> You can also use `git format-patch --stdout | neomutt -f -` and that may\n> provide you the same functionality you were hoping for with\n> `sendemail.sendmailCmd`.\n> -- \n> brian m. carlson (he/him or they/them)\n> Toronto, Ontario, CA\n\n\n\n-- \nBest Regards\nWu Zhenyu\n\n"},{"id":"466629","messageId":"Y2d7B4mUPegaNPU6@tapette.crustytoothpaste.net","threadId":"58749","inReplyTo":"20221106085820.m53mwajd5yfsyri4@desktop","subject":"Re: Can git send-email support neomutt?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2022-11-06T09:14:47Z","receivedAt":"2022-11-06T09:14:54Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2022-11-06 at 08:58:20, Wu Zhenyu wrote:\n> Thanks for your quick reply.\n\nHi, please keep the list in CC.  It's helpful that everyone can benefit\nfrom seeing the replies, and it's possible someone else might have a\nthought on a good way forward.\n\n> > You can also use `git format-patch --stdout | neomutt -f -` and that may\n> > provide you the same functionality you were hoping for with\n> > `sendemail.sendmailCmd`.\n> \n> It cannot use `git send-email -1` I like.\n> \n> > Mutt and Neomutt are MUAs, which stands for mail user agent.  That is,\n> > they're mail clients that people use to read, compose, and send email.\n> \n> People can use MUA to send email, the only problem is `-i`. I consider the following method\n\nSure, I agree that we can do so.  In fact, as soon as I'm done composing\nthis email, I'll be using mutt to send that.\n\n> ```\n> [sendemail]\n> \tsuppresscc = author\n> \tsendmailCmd = git-neomutt\n> ```\n> \n> `~/.local/bin/neomutt`\n> \n> ```\n> #!/usr/bin/env bash\n> neomutt \"${@//-i/}\"\n> ```\n> \n> And it can work:\n> \n> ```\n> ❯ git send-email -1\n> /tmp/5441yKUviQ/0001-TEST.patch\n> The following files are 8bit, but do not declare a Content-Transfer-Encoding.\n>     /tmp/5441yKUviQ/0001-TEST.patch\n> Which 8bit encoding should I declare [UTF-8]?\n> To whom should the emails be sent (if anyone)? my-another@email\n> Message-ID to be used as In-Reply-To for the first email (if any)?\n> Logging in...\n> Warning: Fcc to an IMAP mailbox is not supported in batch mode\n> Skipping Fcc to imaps://imaphz.qiye.163.com/Sent\n> OK. Log says:\n> Sendmail: git-neomutt -i my-another@email\n> From: Wu Zhenyu <wuzhenyu@ustc.edu>\n> To: my-another@email\n> Subject: [PATCH] TEST\n> Date: Sun,  6 Nov 2022 16:39:49 +0800\n> Message-Id: <20221106083949.210946-1-wuzhenyu@ustc.edu>\n> X-Mailer: git-send-email 2.38.1\n> MIME-Version: 1.0\n> Content-Type: text/plain; charset=UTF-8\n> Content-Transfer-Encoding: 8bit\n> \n> Result: OK\n> ```\n\nThere's nothing here preventing you from invoking an arbitrary program.\nThat program just has to implement a sendmail-compatible interface,\nwhich neomutt doesn't.  If you want to wrap neomutt in a\nsendmail-compatible interface like you've done, then this can work just\nfine.\n\n> I want to know can we remove `-i` to allow more MUA/MTA? If user want to add something, why not let them\n> \n> ```\n> [sendemail]\n> \tsendmailCmd = msmtp -i\n> ```\n\nThis breaks a lot of the existing tooling which expects that this is a\nsendmail-compatible interface.  In addition, we might add an additional\nvalue in the future, like -B8BITMIME (which we really should be adding\nif we're sending 8bit data).  The documentation specifically says it\nshould be sendmail-like.\n\n> I think it should be easy to realize.\n\nI think this is going to cause a bunch of compatibility problems.  git\nsend-email is specifically designed to cause email to be sent (i.e., via\nSMTP).  If you want to use another tool to do the sending, that's fine,\nbut then you typically want to use git format-patch to provide those to\nthe other program.\n\n> And I'll consider share this tip to neomutt.\n> \n> Thanks!\n\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"466630","messageId":"20221106101706.jvgfnzn2jlk73i3f@desktop","threadId":"58749","inReplyTo":"Y2d7B4mUPegaNPU6@tapette.crustytoothpaste.net","subject":"Re: Can git send-email support neomutt?","fromName":"Wu Zhenyu","fromEmail":"wuzhenyu@ustc.edu","sentAt":"2022-11-06T10:17:06Z","receivedAt":"2022-11-06T10:17:29Z","isPatch":false,"sender":{"key":"wuzhenyu@ustc.edu","avatar":"https://gravatar.com/avatar/16eb854115234100d5741dd67e2c5b94f635070478dac019ce21c662bc68d605?d=mp&s=160"},"body":"> That program just has to implement a sendmail-compatible interface,\n> which neomutt doesn't.  If you want to wrap neomutt in a\n> sendmail-compatible interface like you've done, then this can work just\n> fine.\n\nGood.\nThe compatibility is important.\nI'll ask neomutt can them provide an official sendmail-compatible interface.\nThanks!\n\nOn Sun, Nov 06, 2022 at 09:14:47AM +0000, brian m. carlson wrote:\n> On 2022-11-06 at 08:58:20, Wu Zhenyu wrote:\n> > Thanks for your quick reply.\n> \n> Hi, please keep the list in CC.  It's helpful that everyone can benefit\n> from seeing the replies, and it's possible someone else might have a\n> thought on a good way forward.\n> \n> > > You can also use `git format-patch --stdout | neomutt -f -` and that may\n> > > provide you the same functionality you were hoping for with\n> > > `sendemail.sendmailCmd`.\n> > \n> > It cannot use `git send-email -1` I like.\n> > \n> > > Mutt and Neomutt are MUAs, which stands for mail user agent.  That is,\n> > > they're mail clients that people use to read, compose, and send email.\n> > \n> > People can use MUA to send email, the only problem is `-i`. I consider the following method\n> \n> Sure, I agree that we can do so.  In fact, as soon as I'm done composing\n> this email, I'll be using mutt to send that.\n> \n> > ```\n> > [sendemail]\n> > \tsuppresscc = author\n> > \tsendmailCmd = git-neomutt\n> > ```\n> > \n> > `~/.local/bin/neomutt`\n> > \n> > ```\n> > #!/usr/bin/env bash\n> > neomutt \"${@//-i/}\"\n> > ```\n> > \n> > And it can work:\n> > \n> > ```\n> > ❯ git send-email -1\n> > /tmp/5441yKUviQ/0001-TEST.patch\n> > The following files are 8bit, but do not declare a Content-Transfer-Encoding.\n> >     /tmp/5441yKUviQ/0001-TEST.patch\n> > Which 8bit encoding should I declare [UTF-8]?\n> > To whom should the emails be sent (if anyone)? my-another@email\n> > Message-ID to be used as In-Reply-To for the first email (if any)?\n> > Logging in...\n> > Warning: Fcc to an IMAP mailbox is not supported in batch mode\n> > Skipping Fcc to imaps://imaphz.qiye.163.com/Sent\n> > OK. Log says:\n> > Sendmail: git-neomutt -i my-another@email\n> > From: Wu Zhenyu <wuzhenyu@ustc.edu>\n> > To: my-another@email\n> > Subject: [PATCH] TEST\n> > Date: Sun,  6 Nov 2022 16:39:49 +0800\n> > Message-Id: <20221106083949.210946-1-wuzhenyu@ustc.edu>\n> > X-Mailer: git-send-email 2.38.1\n> > MIME-Version: 1.0\n> > Content-Type: text/plain; charset=UTF-8\n> > Content-Transfer-Encoding: 8bit\n> > \n> > Result: OK\n> > ```\n> \n> There's nothing here preventing you from invoking an arbitrary program.\n> That program just has to implement a sendmail-compatible interface,\n> which neomutt doesn't.  If you want to wrap neomutt in a\n> sendmail-compatible interface like you've done, then this can work just\n> fine.\n> \n> > I want to know can we remove `-i` to allow more MUA/MTA? If user want to add something, why not let them\n> > \n> > ```\n> > [sendemail]\n> > \tsendmailCmd = msmtp -i\n> > ```\n> \n> This breaks a lot of the existing tooling which expects that this is a\n> sendmail-compatible interface.  In addition, we might add an additional\n> value in the future, like -B8BITMIME (which we really should be adding\n> if we're sending 8bit data).  The documentation specifically says it\n> should be sendmail-like.\n> \n> > I think it should be easy to realize.\n> \n> I think this is going to cause a bunch of compatibility problems.  git\n> send-email is specifically designed to cause email to be sent (i.e., via\n> SMTP).  If you want to use another tool to do the sending, that's fine,\n> but then you typically want to use git format-patch to provide those to\n> the other program.\n> \n> > And I'll consider share this tip to neomutt.\n> > \n> > Thanks!\n> \n> -- \n> brian m. carlson (he/him or they/them)\n> Toronto, Ontario, CA\n\n\n\n-- \nBest Regards\nWu Zhenyu\n"}]}