email-clients.txt 11 KB

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