email-clients.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. .. _email_clients:
  2. Email clients info for Linux
  3. ============================
  4. Git
  5. ---
  6. These days most developers use ``git send-email`` instead of regular
  7. email clients. The man page for this is quite good. On the receiving
  8. end, maintainers use ``git am`` to apply the patches.
  9. If you are new to ``git`` then send your first patch to yourself. Save it
  10. as raw text including all the headers. Run ``git am raw_email.txt`` and
  11. then review the changelog with ``git log``. When that works then send
  12. the patch to the appropriate mailing list(s).
  13. General Preferences
  14. -------------------
  15. Patches for the Linux kernel are submitted via email, preferably as
  16. inline text in the body of the email. Some maintainers accept
  17. attachments, but then the attachments should have content-type
  18. ``text/plain``. However, attachments are generally frowned upon because
  19. it makes quoting portions of the patch more difficult in the patch
  20. review process.
  21. It's also strongly recommended that you use plain text in your email body,
  22. for patches and other emails alike. https://useplaintext.email may be useful
  23. for information on how to configure your preferred email client, as well as
  24. listing recommended email clients should you not already have a preference.
  25. Email clients that are used for Linux kernel patches should send the
  26. patch text untouched. For example, they should not modify or delete tabs
  27. or spaces, even at the beginning or end of lines.
  28. Don't send patches with ``format=flowed``. This can cause unexpected
  29. and unwanted line breaks.
  30. Don't let your email client do automatic word wrapping for you.
  31. This can also corrupt your patch.
  32. Email clients should not modify the character set encoding of the text.
  33. Emailed patches should be in ASCII or UTF-8 encoding only.
  34. If you configure your email client to send emails with UTF-8 encoding,
  35. you avoid some possible charset problems.
  36. Email clients should generate and maintain "References:" or "In-Reply-To:"
  37. headers so that mail threading is not broken.
  38. Copy-and-paste (or cut-and-paste) usually does not work for patches
  39. because tabs are converted to spaces. Using xclipboard, xclip, and/or
  40. xcutsel may work, but it's best to test this for yourself or just avoid
  41. copy-and-paste.
  42. Don't use PGP/GPG signatures in mail that contains patches.
  43. This breaks many scripts that read and apply the patches.
  44. (This should be fixable.)
  45. It's a good idea to send a patch to yourself, save the received message,
  46. and successfully apply it with 'patch' before sending patches to Linux
  47. mailing lists.
  48. Some email client (MUA) hints
  49. -----------------------------
  50. Here are some specific MUA configuration hints for editing and sending
  51. patches for the Linux kernel. These are not meant to be complete
  52. software package configuration summaries.
  53. Legend:
  54. - TUI = text-based user interface
  55. - GUI = graphical user interface
  56. Alpine (TUI)
  57. ************
  58. Config options:
  59. In the :menuselection:`Sending Preferences` section:
  60. - :menuselection:`Do Not Send Flowed Text` must be ``enabled``
  61. - :menuselection:`Strip Whitespace Before Sending` must be ``disabled``
  62. When composing the message, the cursor should be placed where the patch
  63. should appear, and then pressing :kbd:`CTRL-R` let you specify the patch file
  64. to insert into the message.
  65. Claws Mail (GUI)
  66. ****************
  67. Works. Some people use this successfully for patches.
  68. To insert a patch use :menuselection:`Message-->Insert File` (:kbd:`CTRL-I`)
  69. or an external editor.
  70. If the inserted patch has to be edited in the Claws composition window
  71. "Auto wrapping" in
  72. :menuselection:`Configuration-->Preferences-->Compose-->Wrapping` should be
  73. disabled.
  74. Evolution (GUI)
  75. ***************
  76. Some people use this successfully for patches.
  77. When composing mail select: Preformat
  78. from :menuselection:`Format-->Paragraph Style-->Preformatted` (:kbd:`CTRL-7`)
  79. or the toolbar
  80. Then use:
  81. :menuselection:`Insert-->Text File...` (:kbd:`ALT-N x`)
  82. to insert the patch.
  83. You can also ``diff -Nru old.c new.c | xclip``, select
  84. :menuselection:`Preformat`, then paste with the middle button.
  85. Kmail (GUI)
  86. ***********
  87. Some people use Kmail successfully for patches.
  88. The default setting of not composing in HTML is appropriate; do not
  89. enable it.
  90. When composing an email, under options, uncheck "word wrap". The only
  91. disadvantage is any text you type in the email will not be word-wrapped
  92. so you will have to manually word wrap text before the patch. The easiest
  93. way around this is to compose your email with word wrap enabled, then save
  94. it as a draft. Once you pull it up again from your drafts it is now hard
  95. word-wrapped and you can uncheck "word wrap" without losing the existing
  96. wrapping.
  97. At the bottom of your email, put the commonly-used patch delimiter before
  98. inserting your patch: three hyphens (``---``).
  99. Then from the :menuselection:`Message` menu item, select
  100. :menuselection:`insert file` and choose your patch.
  101. As an added bonus you can customise the message creation toolbar menu
  102. and put the :menuselection:`insert file` icon there.
  103. Make the composer window wide enough so that no lines wrap. As of
  104. KMail 1.13.5 (KDE 4.5.4), KMail will apply word wrapping when sending
  105. the email if the lines wrap in the composer window. Having word wrapping
  106. disabled in the Options menu isn't enough. Thus, if your patch has very
  107. long lines, you must make the composer window very wide before sending
  108. the email. See: https://bugs.kde.org/show_bug.cgi?id=174034
  109. You can safely GPG sign attachments, but inlined text is preferred for
  110. patches so do not GPG sign them. Signing patches that have been inserted
  111. as inlined text will make them tricky to extract from their 7-bit encoding.
  112. If you absolutely must send patches as attachments instead of inlining
  113. them as text, right click on the attachment and select :menuselection:`properties`,
  114. and highlight :menuselection:`Suggest automatic display` to make the attachment
  115. inlined to make it more viewable.
  116. When saving patches that are sent as inlined text, select the email that
  117. contains the patch from the message list pane, right click and select
  118. :menuselection:`save as`. You can use the whole email unmodified as a patch
  119. if it was properly composed. Emails are saved as read-write for user only so
  120. you will have to chmod them to make them group and world readable if you copy
  121. them elsewhere.
  122. Lotus Notes (GUI)
  123. *****************
  124. Run away from it.
  125. IBM Verse (Web GUI)
  126. *******************
  127. See Lotus Notes.
  128. Mutt (TUI)
  129. **********
  130. Plenty of Linux developers use ``mutt``, so it must work pretty well.
  131. Mutt doesn't come with an editor, so whatever editor you use should be
  132. used in a way that there are no automatic linebreaks. Most editors have
  133. an :menuselection:`insert file` option that inserts the contents of a file
  134. unaltered.
  135. To use ``vim`` with mutt::
  136. set editor="vi"
  137. If using xclip, type the command::
  138. :set paste
  139. before middle button or shift-insert or use::
  140. :r filename
  141. if you want to include the patch inline.
  142. (a)ttach works fine without ``set paste``.
  143. You can also generate patches with ``git format-patch`` and then use Mutt
  144. to send them::
  145. $ mutt -H 0001-some-bug-fix.patch
  146. Config options:
  147. It should work with default settings.
  148. However, it's a good idea to set the ``send_charset`` to::
  149. set send_charset="us-ascii:utf-8"
  150. Mutt is highly customizable. Here is a minimum configuration to start
  151. using Mutt to send patches through Gmail::
  152. # .muttrc
  153. # ================ IMAP ====================
  154. set imap_user = 'yourusername@gmail.com'
  155. set imap_pass = 'yourpassword'
  156. set spoolfile = imaps://imap.gmail.com/INBOX
  157. set folder = imaps://imap.gmail.com/
  158. set record="imaps://imap.gmail.com/[Gmail]/Sent Mail"
  159. set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"
  160. set mbox="imaps://imap.gmail.com/[Gmail]/All Mail"
  161. # ================ SMTP ====================
  162. set smtp_url = "smtp://username@smtp.gmail.com:587/"
  163. set smtp_pass = $imap_pass
  164. set ssl_force_tls = yes # Require encrypted connection
  165. # ================ Composition ====================
  166. set editor = `echo \$EDITOR`
  167. set edit_headers = yes # See the headers when editing
  168. set charset = UTF-8 # value of $LANG; also fallback for send_charset
  169. # Sender, email address, and sign-off line must match
  170. unset use_domain # because joe@localhost is just embarrassing
  171. set realname = "YOUR NAME"
  172. set from = "username@gmail.com"
  173. set use_from = yes
  174. The Mutt docs have lots more information:
  175. https://gitlab.com/muttmua/mutt/-/wikis/UseCases/Gmail
  176. http://www.mutt.org/doc/manual/
  177. Pine (TUI)
  178. **********
  179. Pine has had some whitespace truncation issues in the past, but these
  180. should all be fixed now.
  181. Use alpine (pine's successor) if you can.
  182. Config options:
  183. - ``quell-flowed-text`` is needed for recent versions
  184. - the ``no-strip-whitespace-before-send`` option is needed
  185. Sylpheed (GUI)
  186. **************
  187. - Works well for inlining text (or using attachments).
  188. - Allows use of an external editor.
  189. - Is slow on large folders.
  190. - Won't do TLS SMTP auth over a non-SSL connection.
  191. - Has a helpful ruler bar in the compose window.
  192. - Adding addresses to address book doesn't understand the display name
  193. properly.
  194. Thunderbird (GUI)
  195. *****************
  196. Thunderbird is an Outlook clone that likes to mangle text, but there are ways
  197. to coerce it into behaving.
  198. - Allow use of an external editor:
  199. The easiest thing to do with Thunderbird and patches is to use an
  200. "external editor" extension and then just use your favorite ``$EDITOR``
  201. for reading/merging patches into the body text. To do this, download
  202. and install the extension, then add a button for it using
  203. :menuselection:`View-->Toolbars-->Customize...` and finally just click on it
  204. when in the :menuselection:`Compose` dialog.
  205. Please note that "external editor" requires that your editor must not
  206. fork, or in other words, the editor must not return before closing.
  207. You may have to pass additional flags or change the settings of your
  208. editor. Most notably if you are using gvim then you must pass the -f
  209. option to gvim by putting ``/usr/bin/gvim -f`` (if the binary is in
  210. ``/usr/bin``) to the text editor field in :menuselection:`external editor`
  211. settings. If you are using some other editor then please read its manual
  212. to find out how to do this.
  213. To beat some sense out of the internal editor, do this:
  214. - Edit your Thunderbird config settings so that it won't use ``format=flowed``.
  215. Go to :menuselection:`edit-->preferences-->advanced-->config editor` to bring up
  216. the thunderbird's registry editor.
  217. - Set ``mailnews.send_plaintext_flowed`` to ``false``
  218. - Set ``mailnews.wraplength`` from ``72`` to ``0``
  219. - :menuselection:`View-->Message Body As-->Plain Text`
  220. - :menuselection:`View-->Character Encoding-->Unicode (UTF-8)`
  221. TkRat (GUI)
  222. ***********
  223. Works. Use "Insert file..." or external editor.
  224. Gmail (Web GUI)
  225. ***************
  226. Does not work for sending patches.
  227. Gmail web client converts tabs to spaces automatically.
  228. At the same time it wraps lines every 78 chars with CRLF style line breaks
  229. although tab2space problem can be solved with external editor.
  230. Another problem is that Gmail will base64-encode any message that has a
  231. non-ASCII character. That includes things like European names.