message.texi 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678
  1. \input texinfo @c -*-texinfo-*-
  2. @include gnus-overrides.texi
  3. @setfilename ../../info/message.info
  4. @settitle Message Manual
  5. @include docstyle.texi
  6. @synindex fn cp
  7. @synindex vr cp
  8. @synindex pg cp
  9. @copying
  10. This file documents Message, the Emacs message composition mode.
  11. Copyright @copyright{} 1996--2017 Free Software Foundation, Inc.
  12. @quotation
  13. Permission is granted to copy, distribute and/or modify this document
  14. under the terms of the GNU Free Documentation License, Version 1.3 or
  15. any later version published by the Free Software Foundation; with no
  16. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
  17. and with the Back-Cover Texts as in (a) below. A copy of the license
  18. is included in the section entitled ``GNU Free Documentation License''.
  19. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  20. modify this GNU manual.''
  21. @end quotation
  22. @end copying
  23. @dircategory Emacs network features
  24. @direntry
  25. * Message: (message). Mail and news composition mode that
  26. goes with Gnus.
  27. @end direntry
  28. @iftex
  29. @finalout
  30. @end iftex
  31. @titlepage
  32. @ifset WEBHACKDEVEL
  33. @title Message Manual (DEVELOPMENT VERSION)
  34. @end ifset
  35. @ifclear WEBHACKDEVEL
  36. @title Message Manual
  37. @end ifclear
  38. @author by Lars Magne Ingebrigtsen
  39. @page
  40. @vskip 0pt plus 1filll
  41. @insertcopying
  42. @end titlepage
  43. @summarycontents
  44. @contents
  45. @node Top
  46. @top Message
  47. @ifnottex
  48. @insertcopying
  49. @end ifnottex
  50. All message composition from Gnus (both mail and news) takes place in
  51. Message mode buffers.
  52. @menu
  53. * Interface:: Setting up message buffers.
  54. * Commands:: Commands you can execute in message mode buffers.
  55. * Variables:: Customizing the message buffers.
  56. * Appendices:: More technical things.
  57. * GNU Free Documentation License:: The license for this documentation.
  58. * Index:: Variable, function and concept index.
  59. * Key Index:: List of Message mode keys.
  60. @end menu
  61. @c Adjust ../Makefile.in if you change the following lines:
  62. Message is distributed with Gnus. The Gnus distribution
  63. @c
  64. corresponding to this manual is Gnus v5.13
  65. @node Interface
  66. @chapter Interface
  67. When a program (or a person) wants to respond to a message---reply,
  68. follow up, forward, cancel---the program (or person) should just put
  69. point in the buffer where the message is and call the required command.
  70. @code{Message} will then pop up a new @code{message} mode buffer with
  71. appropriate headers filled out, and the user can edit the message before
  72. sending it.
  73. @menu
  74. * New Mail Message:: Editing a brand new mail message.
  75. * New News Message:: Editing a brand new news message.
  76. * Reply:: Replying via mail.
  77. * Wide Reply:: Responding to all people via mail.
  78. * Followup:: Following up via news.
  79. * Canceling News:: Canceling a news article.
  80. * Superseding:: Superseding a message.
  81. * Forwarding:: Forwarding a message via news or mail.
  82. * Resending:: Resending a mail message.
  83. * Bouncing:: Bouncing a mail message.
  84. * Mailing Lists:: Send mail to mailing lists.
  85. @end menu
  86. You can customize the Message Mode tool bar, see @kbd{M-x
  87. customize-apropos RET message-tool-bar}. This feature is only available
  88. in Emacs.
  89. @node New Mail Message
  90. @section New Mail Message
  91. @findex message-mail
  92. The @code{message-mail} command pops up a new message buffer.
  93. Two optional parameters are accepted: The first will be used as the
  94. @code{To} header and the second as the @code{Subject} header. If these
  95. are @code{nil}, those two headers will be empty.
  96. @node New News Message
  97. @section New News Message
  98. @findex message-news
  99. The @code{message-news} command pops up a new message buffer.
  100. This function accepts two optional parameters. The first will be used
  101. as the @code{Newsgroups} header and the second as the @code{Subject}
  102. header. If these are @code{nil}, those two headers will be empty.
  103. @node Reply
  104. @section Reply
  105. @findex message-reply
  106. The @code{message-reply} function pops up a message buffer that's a
  107. reply to the message in the current buffer.
  108. @vindex message-reply-to-function
  109. Message uses the normal methods to determine where replies are to go
  110. (@pxref{Responses}), but you can change the behavior to suit your needs
  111. by fiddling with the @code{message-reply-to-function} variable.
  112. If you want the replies to go to the @code{Sender} instead of the
  113. @code{From}, you could do something like this:
  114. @lisp
  115. (setq message-reply-to-function
  116. (lambda ()
  117. (cond ((equal (mail-fetch-field "from") "somebody")
  118. (list (cons 'To (mail-fetch-field "sender"))))
  119. (t
  120. nil))))
  121. @end lisp
  122. This function will be called narrowed to the head of the article that is
  123. being replied to.
  124. As you can see, this function should return a list. In this case, it
  125. returns @code{((To . "Whom"))} if it has an opinion as to what the To
  126. header should be. If it does not, it should just return @code{nil}, and
  127. the normal methods for determining the To header will be used.
  128. Each list element should be a cons, where the @sc{car} should be the
  129. name of a header (e.g., @code{Cc}) and the @sc{cdr} should be the header
  130. value (e.g., @samp{larsi@@ifi.uio.no}). All these headers will be
  131. inserted into the head of the outgoing mail.
  132. @node Wide Reply
  133. @section Wide Reply
  134. @findex message-wide-reply
  135. The @code{message-wide-reply} pops up a message buffer that's a wide
  136. reply to the message in the current buffer. A @dfn{wide reply} is a
  137. reply that goes out to all people listed in the @code{To}, @code{From}
  138. (or @code{Reply-to}) and @code{Cc} headers.
  139. @vindex message-wide-reply-to-function
  140. Message uses the normal methods to determine where wide replies are to go,
  141. but you can change the behavior to suit your needs by fiddling with the
  142. @code{message-wide-reply-to-function}. It is used in the same way as
  143. @code{message-reply-to-function} (@pxref{Reply}).
  144. @vindex message-dont-reply-to-names
  145. Addresses that match the @code{message-dont-reply-to-names} regular
  146. expression (or list of regular expressions or a predicate function)
  147. will be removed from the @code{Cc} header. A value of @code{nil} means
  148. to exclude only your email address.
  149. @vindex message-prune-recipient-rules
  150. @code{message-prune-recipient-rules} is used to prune the addresses
  151. used when doing a wide reply. It's meant to be used to remove
  152. duplicate addresses and the like. It's a list of lists, where the
  153. first element is a regexp to match the address to trigger the rule,
  154. and the second is a regexp that will be expanded based on the first,
  155. to match addresses to be pruned.
  156. It's complicated to explain, but it's easy to use.
  157. For instance, if you get an email from @samp{foo@@example.org}, but
  158. @samp{foo@@zot.example.org} is also in the @code{Cc} list, then your
  159. wide reply will go out to both these addresses, since they are unique.
  160. To avoid this, do something like the following:
  161. @lisp
  162. (setq message-prune-recipient-rules
  163. '(("^\\([^@@]+\\)@@\\(.*\\)" "\\1@@.*[.]\\2")))
  164. @end lisp
  165. If, for instance, you want all wide replies that involve messages from
  166. @samp{cvs@@example.org} to go to that address, and nowhere else (i.e.,
  167. remove all other recipients if @samp{cvs@@example.org} is in the
  168. recipient list:
  169. @lisp
  170. (setq message-prune-recipient-rules
  171. '(("cvs@@example.org" ".")))
  172. @end lisp
  173. @vindex message-wide-reply-confirm-recipients
  174. If @code{message-wide-reply-confirm-recipients} is non-@code{nil} you
  175. will be asked to confirm that you want to reply to multiple
  176. recipients. The default is @code{nil}.
  177. @node Followup
  178. @section Followup
  179. @findex message-followup
  180. The @code{message-followup} command pops up a message buffer that's a
  181. followup to the message in the current buffer.
  182. @vindex message-followup-to-function
  183. Message uses the normal methods to determine where followups are to go,
  184. but you can change the behavior to suit your needs by fiddling with the
  185. @code{message-followup-to-function}. It is used in the same way as
  186. @code{message-reply-to-function} (@pxref{Reply}).
  187. @vindex message-use-followup-to
  188. The @code{message-use-followup-to} variable says what to do about
  189. @code{Followup-To} headers. If it is @code{use}, always use the value.
  190. If it is @code{ask} (which is the default), ask whether to use the
  191. value. If it is @code{t}, use the value unless it is @samp{poster}. If
  192. it is @code{nil}, don't use the value.
  193. @node Canceling News
  194. @section Canceling News
  195. @findex message-cancel-news
  196. The @code{message-cancel-news} command cancels the article in the
  197. current buffer.
  198. @vindex message-cancel-message
  199. The value of @code{message-cancel-message} is inserted in the body of
  200. the cancel message. The default is @samp{I am canceling my own
  201. article.}.
  202. @cindex Cancel Locks
  203. @vindex message-insert-canlock
  204. @cindex canlock
  205. When Message posts news messages, it inserts @code{Cancel-Lock}
  206. headers by default. This is a cryptographic header that ensures that
  207. only you can cancel your own messages, which is nice. The downside
  208. is that if you lose your @file{.emacs} file (which is where Gnus
  209. stores the secret cancel lock password (which is generated
  210. automatically the first time you use this feature)), you won't be
  211. able to cancel your message. If you want to manage a password yourself,
  212. you can put something like the following in your @file{~/.gnus.el} file:
  213. @lisp
  214. (setq canlock-password "geheimnis"
  215. canlock-password-for-verify canlock-password)
  216. @end lisp
  217. Whether to insert the header or not is controlled by the
  218. @code{message-insert-canlock} variable.
  219. Not many news servers respect the @code{Cancel-Lock} header yet, but
  220. this is expected to change in the future.
  221. @node Superseding
  222. @section Superseding
  223. @findex message-supersede
  224. The @code{message-supersede} command pops up a message buffer that will
  225. supersede the message in the current buffer.
  226. @vindex message-ignored-supersedes-headers
  227. Headers matching the @code{message-ignored-supersedes-headers} are
  228. removed before popping up the new message buffer. The default is@*
  229. @samp{^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|@*
  230. ^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|@*
  231. Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|@*
  232. ^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|@*
  233. ^X-Payment:\\|^Approved:}.
  234. @node Forwarding
  235. @section Forwarding
  236. @findex message-forward
  237. The @code{message-forward} command pops up a message buffer to forward
  238. the message in the current buffer. If given a prefix, forward using
  239. news.
  240. @table @code
  241. @item message-forward-ignored-headers
  242. @vindex message-forward-ignored-headers
  243. In non-@code{nil}, all headers that match this regexp will be deleted
  244. when forwarding a message.
  245. @item message-forward-included-headers
  246. @vindex message-forward-included-headers
  247. In non-@code{nil}, only headers that match this regexp will be kept
  248. when forwarding a message.
  249. @item message-make-forward-subject-function
  250. @vindex message-make-forward-subject-function
  251. A list of functions that are called to generate a subject header for
  252. forwarded messages. The subject generated by the previous function is
  253. passed into each successive function.
  254. The provided functions are:
  255. @table @code
  256. @item message-forward-subject-author-subject
  257. @findex message-forward-subject-author-subject
  258. Source of article (author or newsgroup), in brackets followed by the
  259. subject.
  260. @item message-forward-subject-fwd
  261. Subject of article with @samp{Fwd:} prepended to it.
  262. @end table
  263. @item message-wash-forwarded-subjects
  264. @vindex message-wash-forwarded-subjects
  265. If this variable is @code{t}, the subjects of forwarded messages have
  266. the evidence of previous forwards (such as @samp{Fwd:}, @samp{Re:},
  267. @samp{(fwd)}) removed before the new subject is
  268. constructed. The default value is @code{nil}.
  269. @item message-forward-as-mime
  270. @vindex message-forward-as-mime
  271. If this variable is @code{t} (the default), forwarded messages are
  272. included as inline @acronym{MIME} RFC822 parts. If it's @code{nil}, forwarded
  273. messages will just be copied inline to the new message, like previous,
  274. non @acronym{MIME}-savvy versions of Gnus would do.
  275. @item message-forward-before-signature
  276. @vindex message-forward-before-signature
  277. If non-@code{nil}, put forwarded message before signature, else after.
  278. @end table
  279. @node Resending
  280. @section Resending
  281. @findex message-resend
  282. The @code{message-resend} command will prompt the user for an address
  283. and resend the message in the current buffer to that address.
  284. @vindex message-ignored-resent-headers
  285. Headers that match the @code{message-ignored-resent-headers} regexp will
  286. be removed before sending the message.
  287. @node Bouncing
  288. @section Bouncing
  289. @findex message-bounce
  290. The @code{message-bounce} command will, if the current buffer contains a
  291. bounced mail message, pop up a message buffer stripped of the bounce
  292. information. A @dfn{bounced message} is typically a mail you've sent
  293. out that has been returned by some @code{mailer-daemon} as
  294. undeliverable.
  295. @vindex message-ignored-bounced-headers
  296. Headers that match the @code{message-ignored-bounced-headers} regexp
  297. will be removed before popping up the buffer. The default is
  298. @samp{^\\(Received\\|Return-Path\\|Delivered-To\\):}.
  299. @node Mailing Lists
  300. @section Mailing Lists
  301. @cindex Mail-Followup-To
  302. Sometimes while posting to mailing lists, the poster needs to direct
  303. followups to the post to specific places. The Mail-Followup-To (MFT)
  304. was created to enable just this. Three example scenarios where this is
  305. useful:
  306. @itemize @bullet
  307. @item
  308. A mailing list poster can use MFT to express that responses should be
  309. sent to just the list, and not the poster as well. This will happen
  310. if the poster is already subscribed to the list.
  311. @item
  312. A mailing list poster can use MFT to express that responses should be
  313. sent to the list and the poster as well. This will happen if the poster
  314. is not subscribed to the list.
  315. @item
  316. If a message is posted to several mailing lists, MFT may also be used
  317. to direct the following discussion to one list only, because
  318. discussions that are spread over several lists tend to be fragmented
  319. and very difficult to follow.
  320. @end itemize
  321. Gnus honors the MFT header in other's messages (i.e., while following
  322. up to someone else's post) and also provides support for generating
  323. sensible MFT headers for outgoing messages as well.
  324. @c @menu
  325. @c * Honoring an MFT post:: What to do when one already exists
  326. @c * Composing with a MFT header:: Creating one from scratch.
  327. @c @end menu
  328. @c @node Composing with a MFT header
  329. @subsection Composing a correct MFT header automagically
  330. The first step in getting Gnus to automagically generate a MFT header
  331. in posts you make is to give Gnus a list of the mailing lists
  332. addresses you are subscribed to. You can do this in more than one
  333. way. The following variables would come in handy.
  334. @table @code
  335. @vindex message-subscribed-addresses
  336. @item message-subscribed-addresses
  337. This should be a list of addresses the user is subscribed to. Its
  338. default value is @code{nil}. Example:
  339. @lisp
  340. (setq message-subscribed-addresses
  341. '("ding@@gnus.org" "bing@@noose.org"))
  342. @end lisp
  343. @vindex message-subscribed-regexps
  344. @item message-subscribed-regexps
  345. This should be a list of regexps denoting the addresses of mailing
  346. lists subscribed to. Default value is @code{nil}. Example: If you
  347. want to achieve the same result as above:
  348. @lisp
  349. (setq message-subscribed-regexps
  350. '("\\(ding@@gnus\\)\\|\\(bing@@noose\\)\\.org")
  351. @end lisp
  352. @vindex message-subscribed-address-functions
  353. @item message-subscribed-address-functions
  354. This can be a list of functions to be called (one at a time!!) to
  355. determine the value of MFT headers. It is advisable that these
  356. functions not take any arguments. Default value is @code{nil}.
  357. There is a pre-defined function in Gnus that is a good candidate for
  358. this variable. @code{gnus-find-subscribed-addresses} is a function
  359. that returns a list of addresses corresponding to the groups that have
  360. the @code{subscribed} (@pxref{Group Parameters, ,Group Parameters,
  361. gnus, The Gnus Manual}) group parameter set to a non-@code{nil} value.
  362. This is how you would do it.
  363. @lisp
  364. (setq message-subscribed-address-functions
  365. '(gnus-find-subscribed-addresses))
  366. @end lisp
  367. @vindex message-subscribed-address-file
  368. @item message-subscribed-address-file
  369. You might be one organized human freak and have a list of addresses of
  370. all subscribed mailing lists in a separate file! Then you can just
  371. set this variable to the name of the file and life would be good.
  372. @end table
  373. You can use one or more of the above variables. All their values are
  374. ``added'' in some way that works :-)
  375. Now you are all set. Just start composing a message as you normally do.
  376. And just send it; as always. Just before the message is sent out, Gnus'
  377. MFT generation thingy kicks in and checks if the message already has a
  378. MFT field. If there is one, it is left alone. (Except if it's empty;
  379. in that case, the field is removed and is not replaced with an
  380. automatically generated one. This lets you disable MFT generation on a
  381. per-message basis.) If there is none, then the list of recipient
  382. addresses (in the To: and Cc: headers) is checked to see if one of them
  383. is a list address you are subscribed to. If none of them is a list
  384. address, then no MFT is generated; otherwise, a MFT is added to the
  385. other headers and set to the value of all addresses in To: and Cc:
  386. @kindex C-c C-f C-a
  387. @findex message-generate-unsubscribed-mail-followup-to
  388. @kindex C-c C-f C-m
  389. @findex message-goto-mail-followup-to
  390. Hm. ``So'', you ask, ``what if I send an email to a list I am not
  391. subscribed to? I want my MFT to say that I want an extra copy.'' (This
  392. is supposed to be interpreted by others the same way as if there were no
  393. MFT, but you can use an explicit MFT to override someone else's
  394. to-address group parameter.) The function
  395. @code{message-generate-unsubscribed-mail-followup-to} might come in
  396. handy. It is bound to @kbd{C-c C-f C-a} by default. In any case, you
  397. can insert a MFT of your own choice; @kbd{C-c C-f C-m}
  398. (@code{message-goto-mail-followup-to}) will help you get started.
  399. @c @node Honoring an MFT post
  400. @subsection Honoring an MFT post
  401. @vindex message-use-mail-followup-to
  402. When you followup to a post on a mailing list, and the post has a MFT
  403. header, Gnus' action will depend on the value of the variable
  404. @code{message-use-mail-followup-to}. This variable can be one of:
  405. @table @code
  406. @item use
  407. Always honor MFTs. The To: and Cc: headers in your followup will be
  408. derived from the MFT header of the original post. This is the default.
  409. @item nil
  410. Always dishonor MFTs (just ignore the darned thing)
  411. @item ask
  412. Gnus will prompt you for an action.
  413. @end table
  414. It is considered good netiquette to honor MFT, as it is assumed the
  415. fellow who posted a message knows where the followups need to go
  416. better than you do.
  417. @node Commands
  418. @chapter Commands
  419. @menu
  420. * Buffer Entry:: Commands after entering a Message buffer.
  421. * Header Commands:: Commands for moving headers or changing headers.
  422. * Movement:: Moving around in message buffers.
  423. * Insertion:: Inserting things into message buffers.
  424. * MIME:: @acronym{MIME} considerations.
  425. * IDNA:: Non-@acronym{ASCII} domain name considerations.
  426. * Security:: Signing and encrypting messages.
  427. * Various Commands:: Various things.
  428. * Sending:: Actually sending the message.
  429. * Mail Aliases:: How to use mail aliases.
  430. * Spelling:: Having Emacs check your spelling.
  431. @end menu
  432. @node Buffer Entry
  433. @section Buffer Entry
  434. @cindex undo
  435. @kindex C-_
  436. You most often end up in a Message buffer when responding to some other
  437. message of some sort. Message does lots of handling of quoted text, and
  438. may remove signatures, reformat the text, or the like---depending on
  439. which used settings you're using. Message usually gets things right,
  440. but sometimes it stumbles. To help the user unwind these stumblings,
  441. Message sets the undo boundary before each major automatic action it
  442. takes. If you press the undo key (usually located at @kbd{C-_}) a few
  443. times, you will get back the un-edited message you're responding to.
  444. @node Header Commands
  445. @section Header Commands
  446. @subsection Commands for moving to headers
  447. These following commands move to the header in question. If it doesn't
  448. exist, it will be inserted.
  449. @table @kbd
  450. @item C-c ?
  451. @kindex C-c ?
  452. @findex describe-mode
  453. Describe the message mode.
  454. @item C-c C-f C-t
  455. @kindex C-c C-f C-t
  456. @findex message-goto-to
  457. Go to the @code{To} header (@code{message-goto-to}).
  458. @item C-c C-f C-o
  459. @kindex C-c C-f C-o
  460. @findex message-goto-from
  461. Go to the @code{From} header (@code{message-goto-from}). (The ``o''
  462. in the key binding is for Originator.)
  463. @item C-c C-f C-b
  464. @kindex C-c C-f C-b
  465. @findex message-goto-bcc
  466. Go to the @code{Bcc} header (@code{message-goto-bcc}).
  467. @item C-c C-f C-w
  468. @kindex C-c C-f C-w
  469. @findex message-goto-fcc
  470. Go to the @code{Fcc} header (@code{message-goto-fcc}).
  471. @item C-c C-f C-c
  472. @kindex C-c C-f C-c
  473. @findex message-goto-cc
  474. Go to the @code{Cc} header (@code{message-goto-cc}).
  475. @item C-c C-f C-s
  476. @kindex C-c C-f C-s
  477. @findex message-goto-subject
  478. Go to the @code{Subject} header (@code{message-goto-subject}).
  479. @item C-c C-f C-r
  480. @kindex C-c C-f C-r
  481. @findex message-goto-reply-to
  482. Go to the @code{Reply-To} header (@code{message-goto-reply-to}).
  483. @item C-c C-f C-n
  484. @kindex C-c C-f C-n
  485. @findex message-goto-newsgroups
  486. Go to the @code{Newsgroups} header (@code{message-goto-newsgroups}).
  487. @item C-c C-f C-d
  488. @kindex C-c C-f C-d
  489. @findex message-goto-distribution
  490. Go to the @code{Distribution} header (@code{message-goto-distribution}).
  491. @item C-c C-f C-f
  492. @kindex C-c C-f C-f
  493. @findex message-goto-followup-to
  494. Go to the @code{Followup-To} header (@code{message-goto-followup-to}).
  495. @item C-c C-f C-k
  496. @kindex C-c C-f C-k
  497. @findex message-goto-keywords
  498. Go to the @code{Keywords} header (@code{message-goto-keywords}).
  499. @item C-c C-f C-u
  500. @kindex C-c C-f C-u
  501. @findex message-goto-summary
  502. Go to the @code{Summary} header (@code{message-goto-summary}).
  503. @item C-c C-f C-i
  504. @kindex C-c C-f C-i
  505. @findex message-insert-or-toggle-importance
  506. This inserts the @samp{Importance:} header with a value of
  507. @samp{high}. This header is used to signal the importance of the
  508. message to the receiver. If the header is already present in the
  509. buffer, it cycles between the three valid values according to RFC
  510. 1376: @samp{low}, @samp{normal} and @samp{high}.
  511. @item C-c C-f C-a
  512. @kindex C-c C-f C-a
  513. @findex message-generate-unsubscribed-mail-followup-to
  514. Insert a reasonable @samp{Mail-Followup-To:} header
  515. (@pxref{Mailing Lists}) in a post to an
  516. unsubscribed list. When making original posts to a mailing list you are
  517. not subscribed to, you have to type in a @samp{Mail-Followup-To:} header
  518. by hand. The contents, usually, are the addresses of the list and your
  519. own address. This function inserts such a header automatically. It
  520. fetches the contents of the @samp{To:} header in the current mail
  521. buffer, and appends the current @code{user-mail-address}.
  522. If the optional argument @code{include-cc} is non-@code{nil}, the
  523. addresses in the @samp{Cc:} header are also put into the
  524. @samp{Mail-Followup-To:} header.
  525. @end table
  526. @subsection Commands to change headers
  527. @table @kbd
  528. @item C-c C-o
  529. @kindex C-c C-o
  530. @findex message-sort-headers
  531. @vindex message-header-format-alist
  532. Sort headers according to @code{message-header-format-alist}
  533. (@code{message-sort-headers}).
  534. @item C-c C-t
  535. @kindex C-c C-t
  536. @findex message-insert-to
  537. Insert a @code{To} header that contains the @code{Reply-To} or
  538. @code{From} header of the message you're following up
  539. (@code{message-insert-to}).
  540. @item C-c C-n
  541. @kindex C-c C-n
  542. @findex message-insert-newsgroups
  543. Insert a @code{Newsgroups} header that reflects the @code{Followup-To}
  544. or @code{Newsgroups} header of the article you're replying to
  545. (@code{message-insert-newsgroups}).
  546. @item C-c C-l
  547. @kindex C-c C-l
  548. @findex message-to-list-only
  549. Send a message to the list only. Remove all addresses but the list
  550. address from @code{To:} and @code{Cc:} headers.
  551. @item C-c M-n
  552. @kindex C-c M-n
  553. @findex message-insert-disposition-notification-to
  554. Insert a request for a disposition
  555. notification. (@code{message-insert-disposition-notification-to}).
  556. This means that if the recipient supports RFC 2298 she might send you a
  557. notification that she received the message.
  558. @item M-x message-insert-importance-high
  559. @kindex M-x message-insert-importance-high
  560. @findex message-insert-importance-high
  561. @cindex Importance
  562. Insert an @samp{Importance} header with a value of @samp{high},
  563. deleting headers if necessary.
  564. @item M-x message-insert-importance-low
  565. @kindex M-x message-insert-importance-low
  566. @findex message-insert-importance-low
  567. @cindex Importance
  568. Insert an @samp{Importance} header with a value of @samp{low}, deleting
  569. headers if necessary.
  570. @item C-c C-f s
  571. @kindex C-c C-f s
  572. @findex message-change-subject
  573. @cindex Subject
  574. Change the current @samp{Subject} header. Ask for new @samp{Subject}
  575. header and append @samp{(was: <Old Subject>)}. The old subject can be
  576. stripped on replying, see @code{message-subject-trailing-was-query}
  577. (@pxref{Message Headers}).
  578. @item C-c C-f x
  579. @kindex C-c C-f x
  580. @findex message-cross-post-followup-to
  581. @vindex message-cross-post-default
  582. @vindex message-cross-post-note-function
  583. @cindex X-Post
  584. @cindex cross-post
  585. Set up the @samp{FollowUp-To} header with a target newsgroup for a
  586. cross-post, add that target newsgroup to the @samp{Newsgroups} header if
  587. it is not a member of @samp{Newsgroups}, and insert a note in the body.
  588. If @code{message-cross-post-default} is @code{nil} or if this command is
  589. called with a prefix-argument, only the @samp{FollowUp-To} header will
  590. be set but the target newsgroup will not be added to the
  591. @samp{Newsgroups} header. The function to insert a note is controlled
  592. by the @code{message-cross-post-note-function} variable.
  593. @item C-c C-f t
  594. @kindex C-c C-f t
  595. @findex message-reduce-to-to-cc
  596. Replace contents of @samp{To} header with contents of @samp{Cc}
  597. header (or the @samp{Bcc} header, if there is no @samp{Cc} header).
  598. @item C-c C-f w
  599. @kindex C-c C-f w
  600. @findex message-insert-wide-reply
  601. Insert @samp{To} and @samp{Cc} headers as if you were doing a wide
  602. reply even if the message was not made for a wide reply first.
  603. @item C-c C-f a
  604. @kindex C-c C-f a
  605. @findex message-add-archive-header
  606. @vindex message-archive-header
  607. @vindex message-archive-note
  608. @cindex X-No-Archive
  609. Insert @samp{X-No-Archive: Yes} in the header and a note in the body.
  610. The header and the note can be customized using
  611. @code{message-archive-header} and @code{message-archive-note}. When
  612. called with a prefix argument, ask for a text to insert. If you don't
  613. want the note in the body, set @code{message-archive-note} to
  614. @code{nil}.
  615. @end table
  616. @node Movement
  617. @section Movement
  618. @table @kbd
  619. @item C-c C-b
  620. @kindex C-c C-b
  621. @findex message-goto-body
  622. Move to the beginning of the body of the message
  623. (@code{message-goto-body}).
  624. @item C-c C-i
  625. @kindex C-c C-i
  626. @findex message-goto-signature
  627. Move to the signature of the message (@code{message-goto-signature}).
  628. @item C-a
  629. @kindex C-a
  630. @findex message-beginning-of-line
  631. @vindex message-beginning-of-line
  632. If at beginning of header value, go to beginning of line, else go to
  633. beginning of header value. (The header value comes after the header
  634. name and the colon.) This behavior can be disabled by toggling
  635. the variable @code{message-beginning-of-line}.
  636. @end table
  637. @node Insertion
  638. @section Insertion
  639. @table @kbd
  640. @item C-c C-y
  641. @kindex C-c C-y
  642. @findex message-yank-original
  643. Yank the message that's being replied to into the message buffer
  644. (@code{message-yank-original}).
  645. @item C-c C-M-y
  646. @kindex C-c C-M-y
  647. @findex message-yank-buffer
  648. Prompt for a buffer name and yank the contents of that buffer into the
  649. message buffer (@code{message-yank-buffer}).
  650. @item C-c C-q
  651. @kindex C-c C-q
  652. @findex message-fill-yanked-message
  653. Fill the yanked message (@code{message-fill-yanked-message}). Warning:
  654. Can severely mess up the yanked text if its quoting conventions are
  655. strange. You'll quickly get a feel for when it's safe, though. Anyway,
  656. just remember that @kbd{C-x u} (@code{undo}) is available and you'll be
  657. all right.
  658. @item C-c C-w
  659. @kindex C-c C-w
  660. @findex message-insert-signature
  661. Insert a signature at the end of the buffer
  662. (@code{message-insert-signature}).
  663. @item C-c M-h
  664. @kindex C-c M-h
  665. @findex message-insert-headers
  666. Insert the message headers (@code{message-insert-headers}).
  667. @item C-c M-m
  668. @kindex C-c M-m
  669. @findex message-mark-inserted-region
  670. Mark some region in the current article with enclosing tags. See
  671. @code{message-mark-insert-begin} and @code{message-mark-insert-end}.
  672. When called with a prefix argument, use slrn style verbatim marks
  673. (@samp{#v+} and @samp{#v-}).
  674. @item C-c M-f
  675. @kindex C-c M-f
  676. @findex message-mark-insert-file
  677. Insert a file in the current article with enclosing tags.
  678. See @code{message-mark-insert-begin} and @code{message-mark-insert-end}.
  679. When called with a prefix argument, use slrn style verbatim marks
  680. (@samp{#v+} and @samp{#v-}).
  681. @end table
  682. @node MIME
  683. @section MIME
  684. @cindex MML
  685. @cindex MIME
  686. @cindex multipart
  687. @cindex attachment
  688. Message is a @acronym{MIME}-compliant posting agent. The user generally
  689. doesn't have to do anything to make the @acronym{MIME} happen---Message will
  690. automatically add the @code{Content-Type} and
  691. @code{Content-Transfer-Encoding} headers.
  692. @findex mml-attach-file
  693. @kindex C-c C-a
  694. The most typical thing users want to use the multipart things in
  695. @acronym{MIME} for is to add ``attachments'' to mail they send out.
  696. This can be done with the @kbd{C-c C-a} command (@kbd{M-x mml-attach-file}),
  697. which will prompt for a file name and a @acronym{MIME} type.
  698. @vindex mml-dnd-protocol-alist
  699. @vindex mml-dnd-attach-options
  700. If your Emacs supports drag and drop, you can also drop the file in the
  701. Message buffer. The variable @code{mml-dnd-protocol-alist} specifies
  702. what kind of action is done when you drop a file into the Message
  703. buffer. The variable @code{mml-dnd-attach-options} controls which
  704. @acronym{MIME} options you want to specify when dropping a file. If it
  705. is a list, valid members are @code{type}, @code{description} and
  706. @code{disposition}. @code{disposition} implies @code{type}. If it is
  707. @code{nil}, don't ask for options. If it is @code{t}, ask the user
  708. whether or not to specify options.
  709. You can also create arbitrarily complex multiparts using the @acronym{MML}
  710. language (@pxref{Composing, , Composing, emacs-mime, The Emacs MIME
  711. Manual}).
  712. @node IDNA
  713. @section IDNA
  714. @cindex IDNA
  715. @cindex internationalized domain names
  716. @cindex non-ascii domain names
  717. @acronym{IDNA} is a standard way to encode non-@acronym{ASCII} domain
  718. names into a readable @acronym{ASCII} string. The details can be
  719. found in RFC 3490.
  720. Message is a @acronym{IDNA}-compliant posting agent. The user
  721. generally doesn't have to do anything to make the @acronym{IDNA}
  722. happen---Message will encode non-@acronym{ASCII} domain names in @code{From},
  723. @code{To}, and @code{Cc} headers automatically.
  724. Until @acronym{IDNA} becomes more well known, Message queries you
  725. whether @acronym{IDNA} encoding of the domain name really should
  726. occur. Some users might not be aware that domain names can contain
  727. non-@acronym{ASCII} now, so this gives them a safety net if they accidentally
  728. typed a non-@acronym{ASCII} domain name.
  729. @vindex message-use-idna
  730. The @code{message-use-idna} variable control whether @acronym{IDNA} is
  731. used. If the variable is @code{nil} no @acronym{IDNA} encoding will
  732. ever happen, if it is set to the symbol @code{ask} the user will be
  733. queried, and if set to @code{t} (which is the default if @acronym{IDNA}
  734. is fully available) @acronym{IDNA} encoding happens automatically.
  735. @findex message-idna-to-ascii-rhs
  736. If you want to experiment with the @acronym{IDNA} encoding, you can
  737. invoke @kbd{M-x message-idna-to-ascii-rhs RET} in the message buffer
  738. to have the non-@acronym{ASCII} domain names encoded while you edit
  739. the message.
  740. Note that you must have @uref{http://www.gnu.org/software/libidn/, GNU
  741. Libidn} installed in order to use this functionality.
  742. @node Security
  743. @section Security
  744. @cindex Security
  745. @cindex S/MIME
  746. @cindex PGP
  747. @cindex PGP/MIME
  748. @cindex sign
  749. @cindex encrypt
  750. @cindex secure
  751. By default, e-mails are transmitted without any protection around the
  752. Internet, which implies that they can be read and changed by lots of
  753. different parties. In particular, they are analyzed under bulk
  754. surveillance, which violates basic human rights. To defend those
  755. rights, digital self-defense is necessary (in addition to legal
  756. changes), and encryption and digital signatures are powerful
  757. techniques for self-defense. In essence, encryption ensures that
  758. only the intended recipient will be able to read a message, while
  759. digital signatures make sure that modifications to messages can be
  760. detected by the recipient.
  761. Nowadays, there are two major incompatible e-mail encryption
  762. standards, namely @acronym{OpenPGP} and @acronym{S/MIME}. Both of
  763. these standards are implemented by the @uref{https://www.gnupg.org/,
  764. GNU Privacy Guard (GnuPG)}, which needs to be installed as external
  765. software in addition to GNU Emacs. Before you can start to encrypt,
  766. decrypt, and sign messages, you need to create a so-called key-pair,
  767. which consists of a private key and a public key. Your @emph{public} key
  768. (also known as @emph{certificate}, in particular with @acronym{S/MIME}), is
  769. used by others (a) to encrypt messages intended for you and (b) to verify
  770. digital signatures created by you. In contrast, you use your @emph{private}
  771. key (a) to decrypt messages and (b) to sign messages. (You may want to
  772. think of your public key as an open safe that you offer to others such
  773. that they can deposit messages and lock the door, while your private
  774. key corresponds to the opening combination for the safe.)
  775. Thus, you need to perform the following steps for e-mail encryption,
  776. typically outside Emacs. See, for example, the
  777. @uref{https://www.gnupg.org/gph/en/manual.html, The GNU Privacy
  778. Handbook} for details covering the standard @acronym{OpenPGP} with
  779. @acronym{GnuPG}.
  780. @enumerate
  781. @item
  782. Install GnuPG.
  783. @item
  784. Create a key-pair for your own e-mail address.
  785. @item
  786. Distribute your public key, e.g., via upload to key servers.
  787. @item
  788. Import the public keys for the recipients to which you want to send
  789. encrypted e-mails.
  790. @end enumerate
  791. Whether to use the standard @acronym{OpenPGP} or @acronym{S/MIME} is
  792. beyond the scope of this documentation. Actually, you can use one
  793. standard for one set of recipients and the other standard for
  794. different recipients (depending their preferences or capabilities).
  795. In case you are not familiar with all those acronyms: The standard
  796. @acronym{OpenPGP} is also called @acronym{PGP} (Pretty Good Privacy).
  797. The command line tools offered by @acronym{GnuPG} for
  798. @acronym{OpenPGP} are called @command{gpg} and @command{gpg2}, while
  799. the one for @acronym{S/MIME} is called @command{gpgsm}. An
  800. alternative, but discouraged, tool for @acronym{S/MIME} is
  801. @command{openssl}. To make matters worse, e-mail messages can be
  802. formed in two different ways with @acronym{OpenPGP}, namely
  803. @acronym{PGP} (RFC 1991/4880) and @acronym{PGP/MIME} (RFC 2015/3156).
  804. The good news, however, is the following: In GNU Emacs, Message
  805. supports all those variants, comes with reasonable defaults that can
  806. be customized according to your needs, and invokes the proper command
  807. line tools behind the scenes for encryption, decryption, as well as
  808. creation and verification of digital signatures.
  809. Message uses the @acronym{MML} language for the creation of signed
  810. and/or encrypted messages as explained in the following.
  811. @menu
  812. * Signing and encryption:: Signing and encrypting commands.
  813. * Using S/MIME:: Using S/MIME
  814. * Using OpenPGP:: Using OpenPGP
  815. * Passphrase caching:: How to cache passphrases
  816. * PGP Compatibility:: Compatibility with older implementations
  817. * Encrypt-to-self:: Reading your own encrypted messages
  818. * Bcc Warning:: Do not use encryption with Bcc headers
  819. @end menu
  820. @node Signing and encryption
  821. @subsection Signing and encrypting commands
  822. Instructing @acronym{MML} to perform security operations on a
  823. @acronym{MIME} part is done using the @kbd{C-c C-m s} key map for
  824. signing and the @kbd{C-c C-m c} key map for encryption, as follows.
  825. @table @kbd
  826. @item C-c C-m s s
  827. @kindex C-c C-m s s
  828. @findex mml-secure-message-sign-smime
  829. Digitally sign current message using @acronym{S/MIME}.
  830. @item C-c C-m s o
  831. @kindex C-c C-m s o
  832. @findex mml-secure-message-sign-pgp
  833. Digitally sign current message using @acronym{PGP}.
  834. @item C-c C-m s p
  835. @kindex C-c C-m s p
  836. @findex mml-secure-message-sign-pgpmime
  837. Digitally sign current message using @acronym{PGP/MIME}.
  838. @item C-c C-m c s
  839. @kindex C-c C-m c s
  840. @findex mml-secure-message-encrypt-smime
  841. Digitally encrypt current message using @acronym{S/MIME}.
  842. @item C-c C-m c o
  843. @kindex C-c C-m c o
  844. @findex mml-secure-message-encrypt-pgp
  845. Digitally encrypt current message using @acronym{PGP}.
  846. @item C-c C-m c p
  847. @kindex C-c C-m c p
  848. @findex mml-secure-message-encrypt-pgpmime
  849. Digitally encrypt current message using @acronym{PGP/MIME}.
  850. @item C-c C-m C-n
  851. @kindex C-c C-m C-n
  852. @findex mml-unsecure-message
  853. Remove security related @acronym{MML} tags from message.
  854. @end table
  855. These commands do not immediately sign or encrypt the message, they
  856. merely insert the proper @acronym{MML} secure tag to instruct the
  857. @acronym{MML} engine to perform that operation when the message is
  858. actually sent. They may perform other operations too, such as locating
  859. and retrieving a @acronym{S/MIME} certificate of the person you wish to
  860. send encrypted mail to. When the mml parsing engine converts your
  861. @acronym{MML} into a properly encoded @acronym{MIME} message, the secure
  862. tag will be replaced with either a part or a multipart tag. If your
  863. message contains other mml parts, a multipart tag will be used; if no
  864. other parts are present in your message a single part tag will be used.
  865. This way, message mode will do the Right Thing (TM) with
  866. signed/encrypted multipart messages.
  867. Since signing and especially encryption often is used when sensitive
  868. information is sent, you may want to have some way to ensure that your
  869. mail is actually signed or encrypted. After invoking the above
  870. sign/encrypt commands, it is possible to preview the raw article by
  871. using @kbd{C-u C-c RET P} (@code{mml-preview}). Then you can
  872. verify that your long rant about what your ex-significant other or
  873. whomever actually did with that funny looking person at that strange
  874. party the other night, actually will be sent encrypted.
  875. @emph{Note!} Neither @acronym{PGP/MIME} nor @acronym{S/MIME} encrypt/signs
  876. RFC822 headers. They only operate on the @acronym{MIME} object. Keep this
  877. in mind before sending mail with a sensitive Subject line.
  878. By default, when encrypting a message, Gnus will use the
  879. ``signencrypt'' mode, which means the message is both signed and
  880. encrypted. If you would like to disable this for a particular
  881. message, give the @code{mml-secure-message-encrypt-*} command a prefix
  882. argument, e.g., @kbd{C-u C-c C-m c p}.
  883. Actually using the security commands above is not very difficult. At
  884. least not compared with making sure all involved programs talk with each
  885. other properly. Thus, we now describe what external libraries or
  886. programs are required to make things work, and some small general hints.
  887. @node Using S/MIME
  888. @subsection Using S/MIME
  889. @acronym{S/MIME} requires an external implementation, such as
  890. @uref{https://www.gnupg.org/, GNU Privacy Guard} or
  891. @uref{https://www.openssl.org/, OpenSSL}. The default Emacs interface
  892. to the S/MIME implementation is EasyPG (@pxref{Top,,EasyPG Assistant
  893. User's Manual, epa, EasyPG Assistant User's Manual}), which has been
  894. included in Emacs since version 23 and which relies on the command
  895. line tool @command{gpgsm} provided by @acronym{GnuPG}. That tool
  896. implements certificate management, including certificate revocation
  897. and expiry, while such tasks need to be performed manually, if OpenSSL
  898. is used.
  899. The choice between EasyPG and OpenSSL is controlled by the variable
  900. @code{mml-smime-use}, which needs to be set to the value @code{epg}
  901. for EasyPG. Depending on your version of Emacs that value may be the
  902. default; if not, you can either customize that variable or place the
  903. following line in your @file{.emacs} file (that line needs to be
  904. placed above other code related to message/gnus/encryption):
  905. @lisp
  906. (require 'epg)
  907. @end lisp
  908. Moreover, you may want to customize the variables
  909. @code{mml-default-encrypt-method} and
  910. @code{mml-default-sign-method} to the string @code{"smime"}.
  911. That's all if you want to use S/MIME with EasyPG, and that's the
  912. recommended way of using S/MIME with Message.
  913. If you think about using OpenSSL instead of EasyPG, please read the
  914. BUGS section in the manual for the @command{smime} command coming with
  915. OpenSSL first. If you still want to use OpenSSL, the following
  916. applies.
  917. @emph{Note!} The remainder of this section assumes you have a basic
  918. familiarity with modern cryptography, @acronym{S/MIME}, various PKCS
  919. standards, OpenSSL and so on.
  920. The @acronym{S/MIME} support in Message (and @acronym{MML}) can use
  921. OpenSSL@. OpenSSL performs the actual @acronym{S/MIME} sign/encrypt
  922. operations. OpenSSL can be found at @uref{http://www.openssl.org/}.
  923. OpenSSL 0.9.6 and later should work. Version 0.9.5a cannot extract mail
  924. addresses from certificates, and it insert a spurious CR character into
  925. @acronym{MIME} separators so you may wish to avoid it if you would like
  926. to avoid being regarded as someone who send strange mail. (Although by
  927. sending @acronym{S/MIME} messages you've probably already lost that
  928. contest.)
  929. To be able to send encrypted mail, a personal certificate is not
  930. required. Message (@acronym{MML}) need a certificate for the person to whom you
  931. wish to communicate with though. You're asked for this when you type
  932. @kbd{C-c C-m c s}. Currently there are two ways to retrieve this
  933. certificate, from a local file or from DNS@. If you chose a local
  934. file, it need to contain a X.509 certificate in @acronym{PEM} format.
  935. If you chose DNS, you're asked for the domain name where the
  936. certificate is stored, the default is a good guess. To my belief,
  937. Message (@acronym{MML}) is the first mail agent in the world to support
  938. retrieving @acronym{S/MIME} certificates from DNS, so you're not
  939. likely to find very many certificates out there. At least there
  940. should be one, stored at the domain @code{simon.josefsson.org}. LDAP
  941. is a more popular method of distributing certificates, support for it
  942. is planned. (Meanwhile, you can use @code{ldapsearch} from the
  943. command line to retrieve a certificate into a file and use it.)
  944. As for signing messages, OpenSSL can't perform signing operations
  945. without some kind of configuration. Especially, you need to tell it
  946. where your private key and your certificate is stored. @acronym{MML}
  947. uses an Emacs interface to OpenSSL, aptly named @code{smime.el}, and it
  948. contain a @code{custom} group used for this configuration. So, try
  949. @kbd{M-x customize-group RET smime RET} and look around.
  950. Currently there is no support for talking to a CA (or RA) to create
  951. your own certificate. None is planned either. You need to do this
  952. manually with OpenSSL or using some other program. I used Netscape
  953. and got a free @acronym{S/MIME} certificate from one of the big CA's on the
  954. net. Netscape is able to export your private key and certificate in
  955. PKCS #12 format. Use OpenSSL to convert this into a plain X.509
  956. certificate in PEM format as follows.
  957. @example
  958. $ openssl pkcs12 -in ns.p12 -clcerts -nodes > key+cert.pem
  959. @end example
  960. The @file{key+cert.pem} file should be pointed to from the
  961. @code{smime-keys} variable. You should now be able to send signed mail.
  962. @emph{Note!} Your private key is now stored unencrypted in the file,
  963. so take care in handling it. Storing encrypted keys on the disk are
  964. supported, and Gnus will ask you for a passphrase before invoking
  965. OpenSSL@. Read the OpenSSL documentation for how to achieve this. If
  966. you use unencrypted keys (e.g., if they are on a secure storage, or if
  967. you are on a secure single user machine) simply press @code{RET} at
  968. the passphrase prompt.
  969. @node Using OpenPGP
  970. @subsection Using OpenPGP
  971. Use of OpenPGP requires an external software, such
  972. as @uref{https://www.gnupg.org/, GNU Privacy Guard}. Pre-OpenPGP
  973. implementations such as PGP 2.x and PGP 5.x are also supported. The
  974. default Emacs interface to the PGP implementation is EasyPG
  975. (@pxref{Top,,EasyPG Assistant User's Manual, epa, EasyPG Assistant
  976. User's Manual}), but PGG (@pxref{Top, ,PGG, pgg, PGG Manual}) and
  977. Mailcrypt are also supported. @xref{PGP Compatibility}.
  978. As stated earlier, messages encrypted with OpenPGP can be formatted
  979. according to two different standards, namely @acronym{PGP} or
  980. @acronym{PGP/MIME}. The variables
  981. @code{mml-default-encrypt-method} and
  982. @code{mml-default-sign-method} determine which variant to prefer,
  983. @acronym{PGP/MIME} by default.
  984. @node Passphrase caching
  985. @subsection Passphrase caching
  986. @cindex gpg-agent
  987. Message with EasyPG internally calls GnuPG (the @command{gpg} or
  988. @command{gpgsm} command) to perform
  989. data encryption, and in certain cases (decrypting or signing for
  990. example), @command{gpg}/@command{gpgsm} requires user's passphrase.
  991. Currently the recommended way to supply your passphrase is to use the
  992. @command{gpg-agent} program.
  993. In particular, the @command{gpg-agent} program supports passphrase
  994. caching so that you do not need to enter your passphrase for every
  995. decryption/sign operation. @xref{Agent Options, , , gnupg, Using the
  996. GNU Privacy Guard}.
  997. How to use @command{gpg-agent} in Emacs depends on your version of
  998. GnuPG. With GnuPG version 2.1, @command{gpg-agent} is started
  999. automatically if necessary. With older versions you may need to run
  1000. the following command from the shell before starting Emacs.
  1001. @example
  1002. eval `gpg-agent --daemon`
  1003. @end example
  1004. This will invoke @command{gpg-agent} and set the environment variable
  1005. @code{GPG_AGENT_INFO} to allow @command{gpg} to communicate with it.
  1006. It might be good idea to put this command in your @file{.xsession} or
  1007. @file{.bash_profile}. @xref{Invoking GPG-AGENT, , , gnupg, Using the
  1008. GNU Privacy Guard}.
  1009. Once your @command{gpg-agent} is set up, it will ask you for a
  1010. passphrase as needed for @command{gpg}. Under the X Window System,
  1011. you will see a new passphrase input dialog appear. The dialog is
  1012. provided by PIN Entry (the @command{pinentry} command), reasonably
  1013. recent versions of which can also cooperate with Emacs on a text
  1014. console. If that does not work, you may need to put a passphrase into
  1015. gpg-agent's cache beforehand. The following command does the trick.
  1016. @example
  1017. gpg --use-agent --sign < /dev/null > /dev/null
  1018. @end example
  1019. @node PGP Compatibility
  1020. @subsection Compatibility with older implementations
  1021. @vindex gpg-temp-directory
  1022. Note, if you are using the @code{gpg.el} you must make sure that the
  1023. directory specified by @code{gpg-temp-directory} have permissions
  1024. 0700.
  1025. Creating your own key is described in detail in the documentation of
  1026. your PGP implementation, so we refer to it.
  1027. If you have imported your old PGP 2.x key into GnuPG, and want to send
  1028. signed and encrypted messages to your fellow PGP 2.x users, you'll
  1029. discover that the receiver cannot understand what you send. One
  1030. solution is to use PGP 2.x instead (e.g., if you use @code{pgg}, set
  1031. @code{pgg-default-scheme} to @code{pgp}). You could also convince your
  1032. fellow PGP 2.x users to convert to GnuPG@.
  1033. @vindex mml-signencrypt-style-alist
  1034. As a final workaround, you can make the sign and encryption work in
  1035. two steps; separately sign, then encrypt a message. If you would like
  1036. to change this behavior you can customize the
  1037. @code{mml-signencrypt-style-alist} variable. For example:
  1038. @lisp
  1039. (setq mml-signencrypt-style-alist '(("smime" separate)
  1040. ("pgp" separate)
  1041. ("pgpauto" separate)
  1042. ("pgpmime" separate)))
  1043. @end lisp
  1044. This causes to sign and encrypt in two passes, thus generating a
  1045. message that can be understood by PGP version 2.
  1046. (Refer to @uref{http://www.gnupg.org/gph/en/pgp2x.html} for more
  1047. information about the problem.)
  1048. @node Encrypt-to-self
  1049. @subsection Encrypt-to-self
  1050. By default, messages are encrypted to all recipients (@code{To},
  1051. @code{Cc}, @code{Bcc} headers). Thus, you will not be able to decrypt
  1052. your own messages. To make sure that messages are also encrypted to
  1053. your own key(s), several alternative solutions exist:
  1054. @enumerate
  1055. @item
  1056. Use the @code{encrypt-to} option in the file @file{gpg.conf} (for
  1057. OpenPGP) or @file{gpgsm.conf} (for @acronym{S/MIME} with EasyPG).
  1058. @xref{Invoking GPG, , , gnupg, Using the GNU Privacy Guard}, or
  1059. @xref{Invoking GPGSM, , , gnupg, Using the GNU Privacy Guard}.
  1060. @item
  1061. Include your own e-mail address (for which you created a key-pair)
  1062. among the recipients.
  1063. @item
  1064. Customize the variable @code{mml-secure-openpgp-encrypt-to-self} (for
  1065. OpenPGP) or @code{mml-secure-smime-encrypt-to-self} (for
  1066. @acronym{S/MIME} with EasyPG).
  1067. @end enumerate
  1068. @node Bcc Warning
  1069. @subsection Bcc Warning
  1070. The @code{Bcc} header is meant to hide recipients of messages.
  1071. However, when encrypted messages are used, the e-mail addresses of all
  1072. @code{Bcc}-headers are given away to all recipients without
  1073. warning, which is a bug.
  1074. @vindex mml-secure-safe-bcc-list
  1075. But now Message got to warn if @code{Bcc} recipients are found in an
  1076. encrypted message when you are just about to send it. If you are sure
  1077. those @code{Bcc} addresses are safe to expose, set the
  1078. @code{mml-secure-safe-bcc-list} variable, that is a list of e-mail
  1079. addresses. See
  1080. @uref{https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18718}.
  1081. @node Various Commands
  1082. @section Various Commands
  1083. @table @kbd
  1084. @item C-c C-r
  1085. @kindex C-c C-r
  1086. @findex message-caesar-buffer-body
  1087. Caesar rotate (aka. rot13) the current message
  1088. (@code{message-caesar-buffer-body}). If narrowing is in effect, just
  1089. rotate the visible portion of the buffer. A numerical prefix says how
  1090. many places to rotate the text. The default is 13.
  1091. @item C-c C-e
  1092. @kindex C-c C-e
  1093. @findex message-elide-region
  1094. @vindex message-elide-ellipsis
  1095. Elide the text between point and mark (@code{message-elide-region}).
  1096. The text is killed and replaced with the contents of the variable
  1097. @code{message-elide-ellipsis}. The default value is to use an ellipsis
  1098. (@samp{[...]}).
  1099. This is a format-spec string, and you can use @samp{%l} to say how
  1100. many lines were removed, and @samp{%c} to say how many characters were
  1101. removed.
  1102. @item C-c M-k
  1103. @kindex C-c M-k
  1104. @findex message-kill-address
  1105. Kill the address under point.
  1106. @item C-c C-z
  1107. @kindex C-c C-z
  1108. @findex message-kill-to-signature
  1109. Kill all the text up to the signature, or if that's missing, up to the
  1110. end of the message (@code{message-kill-to-signature}).
  1111. @item C-c C-v
  1112. @kindex C-c C-v
  1113. @findex message-delete-not-region
  1114. Delete all text in the body of the message that is outside the region
  1115. (@code{message-delete-not-region}).
  1116. @item M-RET
  1117. @kindex M-RET
  1118. @findex message-newline-and-reformat
  1119. Insert four newlines, and then reformat if inside quoted text.
  1120. Here's an example:
  1121. @example
  1122. > This is some quoted text. And here's more quoted text.
  1123. @end example
  1124. If point is before @samp{And} and you press @kbd{M-RET}, you'll get:
  1125. @example
  1126. > This is some quoted text.
  1127. *
  1128. > And here's more quoted text.
  1129. @end example
  1130. @samp{*} says where point will be placed.
  1131. @item C-c M-r
  1132. @kindex C-c M-r
  1133. @findex message-rename-buffer
  1134. Rename the buffer (@code{message-rename-buffer}). If given a prefix,
  1135. prompt for a new buffer name.
  1136. @item TAB
  1137. @kindex TAB
  1138. @findex message-tab
  1139. @vindex message-tab-body-function
  1140. If @code{message-tab-body-function} is non-@code{nil}, execute the
  1141. function it specifies. Otherwise use the function bound to @kbd{TAB} in
  1142. @code{text-mode-map} or @code{global-map}.
  1143. @end table
  1144. @node Sending
  1145. @section Sending
  1146. @table @kbd
  1147. @item C-c C-c
  1148. @kindex C-c C-c
  1149. @findex message-send-and-exit
  1150. Send the message and bury the current buffer
  1151. (@code{message-send-and-exit}).
  1152. @item C-c C-s
  1153. @kindex C-c C-s
  1154. @findex message-send
  1155. Send the message (@code{message-send}).
  1156. @item C-c C-d
  1157. @kindex C-c C-d
  1158. @findex message-dont-send
  1159. Bury the message buffer and exit (@code{message-dont-send}).
  1160. @item C-c C-k
  1161. @kindex C-c C-k
  1162. @findex message-kill-buffer
  1163. Kill the message buffer and exit (@code{message-kill-buffer}).
  1164. @end table
  1165. @node Mail Aliases
  1166. @section Mail Aliases
  1167. @cindex mail aliases
  1168. @cindex aliases
  1169. @cindex completion
  1170. @cindex ecomplete
  1171. @vindex message-mail-alias-type
  1172. The @code{message-mail-alias-type} variable controls what type of mail
  1173. alias expansion to use. Currently two forms are supported:
  1174. @code{mailabbrev} and @code{ecomplete}. If this variable is
  1175. @code{nil}, no mail alias expansion will be performed.
  1176. @code{mailabbrev} works by parsing the @file{/etc/mailrc} and
  1177. @file{~/.mailrc} files. These files look like:
  1178. @example
  1179. alias lmi "Lars Magne Ingebrigtsen <larsi@@ifi.uio.no>"
  1180. alias ding "ding@@ifi.uio.no (ding mailing list)"
  1181. @end example
  1182. After adding lines like this to your @file{~/.mailrc} file, you should
  1183. be able to just write @samp{lmi} in the @code{To} or @code{Cc} (and so
  1184. on) headers and press @kbd{SPC} to expand the alias.
  1185. No expansion will be performed upon sending of the message---all
  1186. expansions have to be done explicitly.
  1187. If you're using @code{ecomplete}, all addresses from @code{To} and
  1188. @code{Cc} headers will automatically be put into the
  1189. @file{~/.ecompleterc} file. When you enter text in the @code{To} and
  1190. @code{Cc} headers, @code{ecomplete} will check out the values stored
  1191. there and ``electrically'' say what completions are possible. To
  1192. choose one of these completions, use the @kbd{M-n} command to move
  1193. down to the list. Use @kbd{M-n} and @kbd{M-p} to move down and up the
  1194. list, and @kbd{RET} to choose a completion.
  1195. @node Spelling
  1196. @section Spelling
  1197. @cindex spelling
  1198. @findex ispell-message
  1199. There are two popular ways to have Emacs spell-check your messages:
  1200. @code{ispell} and @code{flyspell}. @code{ispell} is the older and
  1201. probably more popular package. You typically first write the message,
  1202. and then run the entire thing through @code{ispell} and fix all the
  1203. typos. To have this happen automatically when you send a message, put
  1204. something like the following in your @file{.emacs} file:
  1205. @lisp
  1206. (add-hook 'message-send-hook 'ispell-message)
  1207. @end lisp
  1208. @vindex ispell-message-dictionary-alist
  1209. If you're in the habit of writing in different languages, this can be
  1210. controlled by the @code{ispell-message-dictionary-alist} variable:
  1211. @lisp
  1212. (setq ispell-message-dictionary-alist
  1213. '(("^Newsgroups:.*\\bde\\." . "deutsch8")
  1214. (".*" . "default")))
  1215. @end lisp
  1216. @code{ispell} depends on having the external @samp{ispell} command
  1217. installed.
  1218. The other popular method is using @code{flyspell}. This package checks
  1219. your spelling while you're writing, and marks any mis-spelled words in
  1220. various ways.
  1221. To use @code{flyspell}, put something like the following in your
  1222. @file{.emacs} file:
  1223. @lisp
  1224. (defun my-message-setup-routine ()
  1225. (flyspell-mode 1))
  1226. (add-hook 'message-setup-hook 'my-message-setup-routine)
  1227. @end lisp
  1228. @code{flyspell} depends on having the external @samp{ispell} command
  1229. installed.
  1230. @node Variables
  1231. @chapter Variables
  1232. @menu
  1233. * Message Headers:: General message header stuff.
  1234. * Mail Headers:: Customizing mail headers.
  1235. * Mail Variables:: Other mail variables.
  1236. * News Headers:: Customizing news headers.
  1237. * News Variables:: Other news variables.
  1238. * Insertion Variables:: Customizing how things are inserted.
  1239. * Various Message Variables:: Other message variables.
  1240. * Sending Variables:: Variables for sending.
  1241. * Message Buffers:: How Message names its buffers.
  1242. * Message Actions:: Actions to be performed when exiting.
  1243. @end menu
  1244. @node Message Headers
  1245. @section Message Headers
  1246. Message is quite aggressive on the message generation front. It has to
  1247. be---it's a combined news and mail agent. To be able to send combined
  1248. messages, it has to generate all headers itself (instead of letting the
  1249. mail/news system do it) to ensure that mail and news copies of messages
  1250. look sufficiently similar.
  1251. @table @code
  1252. @item message-generate-headers-first
  1253. @vindex message-generate-headers-first
  1254. If @code{t}, generate all required headers before starting to
  1255. compose the message. This can also be a list of headers to generate:
  1256. @lisp
  1257. (setq message-generate-headers-first
  1258. '(References))
  1259. @end lisp
  1260. @vindex message-required-headers
  1261. The variables @code{message-required-headers},
  1262. @code{message-required-mail-headers} and
  1263. @code{message-required-news-headers} specify which headers are
  1264. required.
  1265. Note that some headers will be removed and re-generated before posting,
  1266. because of the variable @code{message-deletable-headers} (see below).
  1267. @item message-draft-headers
  1268. @vindex message-draft-headers
  1269. When running Message from Gnus, the message buffers are associated
  1270. with a draft group. @code{message-draft-headers} says which headers
  1271. should be generated when a draft is written to the draft group.
  1272. @item message-from-style
  1273. @vindex message-from-style
  1274. Specifies how @code{From} headers should look. There are four valid
  1275. values:
  1276. @table @code
  1277. @item nil
  1278. Just the address---@samp{king@@grassland.com}.
  1279. @item parens
  1280. @samp{king@@grassland.com (Elvis Parsley)}.
  1281. @item angles
  1282. @samp{Elvis Parsley <king@@grassland.com>}.
  1283. @item default
  1284. Look like @code{angles} if that doesn't require quoting, and
  1285. @code{parens} if it does. If even @code{parens} requires quoting, use
  1286. @code{angles} anyway.
  1287. @end table
  1288. @item message-deletable-headers
  1289. @vindex message-deletable-headers
  1290. Headers in this list that were previously generated by Message will be
  1291. deleted before posting. Let's say you post an article. Then you decide
  1292. to post it again to some other group, you naughty boy, so you jump back
  1293. to the @file{*post-buf*} buffer, edit the @code{Newsgroups} line, and
  1294. ship it off again. By default, this variable makes sure that the old
  1295. generated @code{Message-ID} is deleted, and a new one generated. If
  1296. this isn't done, the entire empire would probably crumble, anarchy would
  1297. prevail, and cats would start walking on two legs and rule the world.
  1298. Allegedly.
  1299. @item message-default-headers
  1300. @vindex message-default-headers
  1301. Header lines to be inserted in outgoing messages before you edit the
  1302. message, so you can edit or delete their lines. If set to a string, it
  1303. is directly inserted. If set to a function, it is called and its
  1304. result is inserted.
  1305. @item message-subject-re-regexp
  1306. @vindex message-subject-re-regexp
  1307. @cindex Aw
  1308. @cindex Sv
  1309. @cindex Re
  1310. Responses to messages have subjects that start with @samp{Re: }. This
  1311. is @emph{not} an abbreviation of the English word ``response'', but is
  1312. Latin, and means ``in response to''. Some illiterate nincompoops have
  1313. failed to grasp this fact, and have ``internationalized'' their software
  1314. to use abominations like @samp{Aw: } (``antwort'') or @samp{Sv: }
  1315. (``svar'') instead, which is meaningless and evil. However, you may
  1316. have to deal with users that use these evil tools, in which case you may
  1317. set this variable to a regexp that matches these prefixes. Myself, I
  1318. just throw away non-compliant mail.
  1319. Here's an example of a value to deal with these headers when
  1320. responding to a message:
  1321. @lisp
  1322. (setq message-subject-re-regexp
  1323. (concat
  1324. "^[ \t]*"
  1325. "\\("
  1326. "\\("
  1327. "[Aa][Nn][Tt][Ww]\\.?\\|" ; antw
  1328. "[Aa][Ww]\\|" ; aw
  1329. "[Ff][Ww][Dd]?\\|" ; fwd
  1330. "[Oo][Dd][Pp]\\|" ; odp
  1331. "[Rr][Ee]\\|" ; re
  1332. "[Rr][\311\351][Ff]\\.?\\|" ; ref
  1333. "[Ss][Vv]" ; sv
  1334. "\\)"
  1335. "\\(\\[[0-9]*\\]\\)"
  1336. "*:[ \t]*"
  1337. "\\)"
  1338. "*[ \t]*"
  1339. ))
  1340. @end lisp
  1341. @item message-subject-trailing-was-query
  1342. @vindex message-subject-trailing-was-query
  1343. @vindex message-subject-trailing-was-ask-regexp
  1344. @vindex message-subject-trailing-was-regexp
  1345. Controls what to do with trailing @samp{(was: <old subject>)} in subject
  1346. lines. If @code{nil}, leave the subject unchanged. If it is the symbol
  1347. @code{ask}, query the user what to do. In this case, the subject is
  1348. matched against @code{message-subject-trailing-was-ask-regexp}. If
  1349. @code{message-subject-trailing-was-query} is @code{t}, always strip the
  1350. trailing old subject. In this case,
  1351. @code{message-subject-trailing-was-regexp} is used.
  1352. @item message-alternative-emails
  1353. @vindex message-alternative-emails
  1354. Regexp or predicate function matching alternative email addresses.
  1355. The first address in the To, Cc or From headers of the original
  1356. article matching this variable is used as the From field of outgoing
  1357. messages, replacing the default From value.
  1358. For example, if you have two secondary email addresses john@@home.net
  1359. and john.doe@@work.com and want to use them in the From field when
  1360. composing a reply to a message addressed to one of them, you could set
  1361. this variable like this:
  1362. @lisp
  1363. (setq message-alternative-emails
  1364. (regexp-opt '("john@@home.net" "john.doe@@work.com")))
  1365. @end lisp
  1366. This variable has precedence over posting styles and anything that runs
  1367. off @code{message-setup-hook}.
  1368. @item message-allow-no-recipients
  1369. @vindex message-allow-no-recipients
  1370. Specifies what to do when there are no recipients other than
  1371. @code{Gcc} or @code{Fcc}. If it is @code{always}, the posting is
  1372. allowed. If it is @code{never}, the posting is not allowed. If it is
  1373. @code{ask} (the default), you are prompted.
  1374. @item message-hidden-headers
  1375. @vindex message-hidden-headers
  1376. A regexp, a list of regexps, or a list where the first element is
  1377. @code{not} and the rest are regexps. It says which headers to keep
  1378. hidden when composing a message.
  1379. @lisp
  1380. (setq message-hidden-headers
  1381. '(not "From" "Subject" "To" "Cc" "Newsgroups"))
  1382. @end lisp
  1383. Headers are hidden using narrowing, you can use @kbd{M-x widen} to
  1384. expose them in the buffer.
  1385. @item message-header-synonyms
  1386. @vindex message-header-synonyms
  1387. A list of lists of header synonyms. E.g., if this list contains a
  1388. member list with elements @code{Cc} and @code{To}, then
  1389. @code{message-carefully-insert-headers} will not insert a @code{To}
  1390. header when the message is already @code{Cc}ed to the recipient.
  1391. @end table
  1392. @node Mail Headers
  1393. @section Mail Headers
  1394. @table @code
  1395. @item message-required-mail-headers
  1396. @vindex message-required-mail-headers
  1397. @xref{News Headers}, for the syntax of this variable. It is
  1398. @code{(From Subject Date (optional . In-Reply-To) Message-ID
  1399. (optional . User-Agent))} by default.
  1400. @item message-ignored-mail-headers
  1401. @vindex message-ignored-mail-headers
  1402. Regexp of headers to be removed before mailing. The default is@*
  1403. @samp{^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|@*
  1404. ^X-Gnus-Agent-Meta-Information:}.
  1405. @item message-default-mail-headers
  1406. @vindex message-default-mail-headers
  1407. This string is inserted at the end of the headers in all message
  1408. buffers that are initialized as mail.
  1409. @item message-generate-hashcash
  1410. @vindex message-generate-hashcash
  1411. Variable that indicates whether @samp{X-Hashcash} headers
  1412. should be computed for the message. @xref{Hashcash, ,Hashcash,gnus,
  1413. The Gnus Manual}. If @code{opportunistic}, only generate the headers
  1414. when it doesn't lead to the user having to wait.
  1415. @end table
  1416. @node Mail Variables
  1417. @section Mail Variables
  1418. @table @code
  1419. @item message-send-mail-function
  1420. @vindex message-send-mail-function
  1421. @findex message-send-mail-function
  1422. @findex message-send-mail-with-sendmail
  1423. @findex message-send-mail-with-mh
  1424. @findex message-send-mail-with-qmail
  1425. @findex message-smtpmail-send-it
  1426. @findex smtpmail-send-it
  1427. @findex feedmail-send-it
  1428. @findex message-send-mail-with-mailclient
  1429. Function used to send the current buffer as mail. The default is
  1430. @code{message-send-mail-with-sendmail}, or @code{smtpmail-send-it}
  1431. according to the system. Other valid values include
  1432. @code{message-send-mail-with-mailclient},
  1433. @code{message-send-mail-with-mh}, @code{message-send-mail-with-qmail},
  1434. @code{message-smtpmail-send-it} and @code{feedmail-send-it}.
  1435. The function
  1436. @code{message-send-mail-with-sendmail} pipes your article to the
  1437. @code{sendmail} binary for further queuing and sending. When your local
  1438. system is not configured for sending mail using @code{sendmail}, and you
  1439. have access to a remote @acronym{SMTP} server, you can set
  1440. @code{message-send-mail-function} to @code{smtpmail-send-it} and make
  1441. sure to setup the @code{smtpmail} package correctly. An example:
  1442. @lisp
  1443. (setq message-send-mail-function 'smtpmail-send-it
  1444. smtpmail-default-smtp-server "YOUR SMTP HOST")
  1445. @end lisp
  1446. To the thing similar to this, there is
  1447. @code{message-smtpmail-send-it}. It is useful if your @acronym{ISP}
  1448. requires the @acronym{POP}-before-@acronym{SMTP} authentication.
  1449. @xref{POP before SMTP, , POP before SMTP, gnus, The Gnus Manual}.
  1450. @cindex X-Message-SMTP-Method
  1451. If you have a complex @acronym{SMTP} setup, and want some messages to
  1452. go via one mail server, and other messages to go through another, you
  1453. can use the @samp{X-Message-SMTP-Method} header. These are the
  1454. supported values:
  1455. @table @samp
  1456. @item smtpmail
  1457. @example
  1458. X-Message-SMTP-Method: smtp smtp.fsf.org 587
  1459. @end example
  1460. This will send the message via @samp{smtp.fsf.org}, using port 587.
  1461. @example
  1462. X-Message-SMTP-Method: smtp smtp.fsf.org 587 other-user
  1463. @end example
  1464. This is the same as the above, but uses @samp{other-user} as the user
  1465. name when authenticating. This is handy if you have several
  1466. @acronym{SMTP} accounts on the same server.
  1467. @item sendmail
  1468. @example
  1469. X-Message-SMTP-Method: sendmail
  1470. @end example
  1471. This will send the message via the locally installed sendmail/exim/etc
  1472. installation.
  1473. @end table
  1474. @item message-mh-deletable-headers
  1475. @vindex message-mh-deletable-headers
  1476. Most versions of MH doesn't like being fed messages that contain the
  1477. headers in this variable. If this variable is non-@code{nil} (which is
  1478. the default), these headers will be removed before mailing when sending
  1479. messages via MH@. Set it to @code{nil} if your MH can handle these
  1480. headers.
  1481. @item message-qmail-inject-program
  1482. @vindex message-qmail-inject-program
  1483. @cindex qmail
  1484. Location of the qmail-inject program.
  1485. @item message-qmail-inject-args
  1486. @vindex message-qmail-inject-args
  1487. Arguments passed to qmail-inject programs.
  1488. This should be a list of strings, one string for each argument. It
  1489. may also be a function.
  1490. E.g., if you wish to set the envelope sender address so that bounces
  1491. go to the right place or to deal with listserv's usage of that address, you
  1492. might set this variable to @code{'("-f" "you@@some.where")}.
  1493. @item message-sendmail-f-is-evil
  1494. @vindex message-sendmail-f-is-evil
  1495. @cindex sendmail
  1496. Non-@code{nil} means don't add @samp{-f username} to the sendmail
  1497. command line. Doing so would be even more evil than leaving it out.
  1498. @item message-sendmail-envelope-from
  1499. @vindex message-sendmail-envelope-from
  1500. When @code{message-sendmail-f-is-evil} is @code{nil}, this specifies
  1501. the address to use in the @acronym{SMTP} envelope. If it is
  1502. @code{nil}, use @code{user-mail-address}. If it is the symbol
  1503. @code{header}, use the @samp{From} header of the message.
  1504. @item message-mailer-swallows-blank-line
  1505. @vindex message-mailer-swallows-blank-line
  1506. Set this to non-@code{nil} if the system's mailer runs the header and
  1507. body together. (This problem exists on SunOS 4 when sendmail is run
  1508. in remote mode.) The value should be an expression to test whether
  1509. the problem will actually occur.
  1510. @item message-send-mail-partially-limit
  1511. @vindex message-send-mail-partially-limit
  1512. @cindex split large message
  1513. The limitation of messages sent as message/partial. The lower bound
  1514. of message size in characters, beyond which the message should be sent
  1515. in several parts. If it is @code{nil} (which is the default), the
  1516. size is unlimited.
  1517. @end table
  1518. @node News Headers
  1519. @section News Headers
  1520. @vindex message-required-news-headers
  1521. @code{message-required-news-headers} a list of header symbols. These
  1522. headers will either be automatically generated, or, if that's
  1523. impossible, they will be prompted for. The following symbols are valid:
  1524. @table @code
  1525. @item From
  1526. @cindex From
  1527. @findex user-full-name
  1528. @findex user-mail-address
  1529. This required header will be filled out with the result of the
  1530. @code{message-make-from} function, which depends on the
  1531. @code{message-from-style}, @code{user-full-name},
  1532. @code{user-mail-address} variables.
  1533. @item Subject
  1534. @cindex Subject
  1535. This required header will be prompted for if not present already.
  1536. @item Newsgroups
  1537. @cindex Newsgroups
  1538. This required header says which newsgroups the article is to be posted
  1539. to. If it isn't present already, it will be prompted for.
  1540. @item Organization
  1541. @cindex organization
  1542. @vindex message-user-organization
  1543. @vindex message-user-organization-file
  1544. This optional header will be filled out depending on the
  1545. @code{message-user-organization} variable.
  1546. @code{message-user-organization-file} will be used if this variable is
  1547. @code{t}. This variable can also be a string (in which case this string
  1548. will be used), or it can be a function (which will be called with no
  1549. parameters and should return a string to be used).
  1550. @item Lines
  1551. @cindex Lines
  1552. This optional header will be computed by Message.
  1553. @item Message-ID
  1554. @cindex Message-ID
  1555. @vindex message-user-fqdn
  1556. @vindex mail-host-address
  1557. @vindex user-mail-address
  1558. @findex system-name
  1559. @cindex Sun
  1560. @cindex i-did-not-set--mail-host-address--so-tickle-me
  1561. This required header will be generated by Message. A unique ID will be
  1562. created based on the date, time, user name (for the local part) and the
  1563. domain part. For the domain part, message will look (in this order) at
  1564. @code{message-user-fqdn}, @code{system-name}, @code{mail-host-address}
  1565. and @code{message-user-mail-address} (i.e., @code{user-mail-address})
  1566. until a probably valid fully qualified domain name (FQDN) was found.
  1567. @item User-Agent
  1568. @cindex User-Agent
  1569. This optional header will be filled out according to the
  1570. @code{message-newsreader} local variable.
  1571. @item In-Reply-To
  1572. This optional header is filled out using the @code{Date} and @code{From}
  1573. header of the article being replied to.
  1574. @item Expires
  1575. @cindex Expires
  1576. @vindex message-expires
  1577. This extremely optional header will be inserted according to the
  1578. @code{message-expires} variable. It is highly deprecated and shouldn't
  1579. be used unless you know what you're doing.
  1580. @item Distribution
  1581. @cindex Distribution
  1582. @vindex message-distribution-function
  1583. This optional header is filled out according to the
  1584. @code{message-distribution-function} variable. It is a deprecated and
  1585. much misunderstood header.
  1586. @item Path
  1587. @cindex path
  1588. @vindex message-user-path
  1589. This extremely optional header should probably never be used.
  1590. However, some @emph{very} old servers require that this header is
  1591. present. @code{message-user-path} further controls how this
  1592. @code{Path} header is to look. If it is @code{nil}, use the server name
  1593. as the leaf node. If it is a string, use the string. If it is neither
  1594. a string nor @code{nil}, use the user name only. However, it is highly
  1595. unlikely that you should need to fiddle with this variable at all.
  1596. @end table
  1597. @cindex Mime-Version
  1598. In addition, you can enter conses into this list. The @sc{car} of this cons
  1599. should be a symbol. This symbol's name is the name of the header, and
  1600. the @sc{cdr} can either be a string to be entered verbatim as the value of
  1601. this header, or it can be a function to be called. This function should
  1602. take no arguments, and return a string to be inserted. For
  1603. instance, if you want to insert @code{Mime-Version: 1.0}, you should
  1604. enter @code{(Mime-Version . "1.0")} into the list.
  1605. If the list contains a cons where the @sc{car} of the cons is
  1606. @code{optional}, the @sc{cdr} of this cons will only be inserted if it is
  1607. non-@code{nil}.
  1608. If you want to delete an entry from this list, the following Lisp
  1609. snippet might be useful. Adjust accordingly if you want to remove
  1610. another element.
  1611. @lisp
  1612. (setq message-required-news-headers
  1613. (delq 'Message-ID message-required-news-headers))
  1614. @end lisp
  1615. Other variables for customizing outgoing news articles:
  1616. @table @code
  1617. @item message-syntax-checks
  1618. @vindex message-syntax-checks
  1619. Controls what syntax checks should not be performed on outgoing posts.
  1620. To disable checking of long signatures, for instance, add
  1621. @lisp
  1622. (signature . disabled)
  1623. @end lisp
  1624. to this list.
  1625. Valid checks are:
  1626. @table @code
  1627. @item approved
  1628. @cindex approved
  1629. Check whether the article has an @code{Approved} header, which is
  1630. something only moderators should include.
  1631. @item continuation-headers
  1632. Check whether there are continuation header lines that don't begin with
  1633. whitespace.
  1634. @item control-chars
  1635. Check for invalid characters.
  1636. @item empty
  1637. Check whether the article is empty.
  1638. @item existing-newsgroups
  1639. Check whether the newsgroups mentioned in the @code{Newsgroups} and
  1640. @code{Followup-To} headers exist.
  1641. @item from
  1642. Check whether the @code{From} header seems nice.
  1643. @item illegible-text
  1644. Check whether there is any non-printable character in the body.
  1645. @item invisible-text
  1646. Check whether there is any invisible text in the buffer.
  1647. @item long-header-lines
  1648. Check for too long header lines.
  1649. @item long-lines
  1650. @cindex long lines
  1651. Check for too long lines in the body.
  1652. @item message-id
  1653. Check whether the @code{Message-ID} looks syntactically ok.
  1654. @item multiple-headers
  1655. Check for the existence of multiple equal headers.
  1656. @item new-text
  1657. Check whether there is any new text in the messages.
  1658. @item newsgroups
  1659. Check whether the @code{Newsgroups} header exists and is not empty.
  1660. @item quoting-style
  1661. Check whether text follows last quoted portion.
  1662. @item repeated-newsgroups
  1663. Check whether the @code{Newsgroups} and @code{Followup-to} headers
  1664. contains repeated group names.
  1665. @item reply-to
  1666. Check whether the @code{Reply-To} header looks ok.
  1667. @item sender
  1668. @cindex Sender
  1669. Insert a new @code{Sender} header if the @code{From} header looks odd.
  1670. @item sendsys
  1671. @cindex sendsys
  1672. Check for the existence of version and sendsys commands.
  1673. @item shoot
  1674. Check whether the domain part of the @code{Message-ID} header looks ok.
  1675. @item shorten-followup-to
  1676. Check whether to add a @code{Followup-to} header to shorten the number
  1677. of groups to post to.
  1678. @item signature
  1679. Check the length of the signature.
  1680. @item size
  1681. Check for excessive size.
  1682. @item subject
  1683. Check whether the @code{Subject} header exists and is not empty.
  1684. @item subject-cmsg
  1685. Check the subject for commands.
  1686. @item valid-newsgroups
  1687. Check whether the @code{Newsgroups} and @code{Followup-to} headers
  1688. are valid syntactically.
  1689. @end table
  1690. All these conditions are checked by default, except for @code{sender}
  1691. for which the check is disabled by default if
  1692. @code{message-insert-canlock} is non-@code{nil} (@pxref{Canceling News}).
  1693. @item message-ignored-news-headers
  1694. @vindex message-ignored-news-headers
  1695. Regexp of headers to be removed before posting. The default is@*
  1696. @samp{^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|@*
  1697. ^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:}.
  1698. @item message-default-news-headers
  1699. @vindex message-default-news-headers
  1700. This string is inserted at the end of the headers in all message
  1701. buffers that are initialized as news.
  1702. @end table
  1703. @node News Variables
  1704. @section News Variables
  1705. @table @code
  1706. @item message-send-news-function
  1707. @vindex message-send-news-function
  1708. Function used to send the current buffer as news. The default is
  1709. @code{message-send-news}.
  1710. @item message-post-method
  1711. @vindex message-post-method
  1712. Gnusish @dfn{select method} (see the Gnus manual for details) used for
  1713. posting a prepared news message.
  1714. @end table
  1715. @node Insertion Variables
  1716. @section Insertion Variables
  1717. @table @code
  1718. @item message-cite-style
  1719. @vindex message-cite-style
  1720. The overall style to be used when replying to messages. This controls
  1721. things like where the reply should be put relative to the original,
  1722. how the citation is formatted, where the signature goes, etc.
  1723. Value is either @code{nil} (no variable overrides) or a let-style list
  1724. of pairs @code{(VARIABLE VALUE)} to override default values.
  1725. See @code{gnus-posting-styles} to set this variable for specific
  1726. groups. Presets to impersonate popular mail agents are available in the
  1727. @code{message-cite-style-*} variables.
  1728. @item message-cite-reply-position
  1729. @vindex message-cite-reply-position
  1730. Where the reply should be positioned. Available styles are
  1731. @code{traditional} to reply inline, @code{above} for top-posting, and
  1732. @code{below} for bottom-posting
  1733. @item message-ignored-cited-headers
  1734. @vindex message-ignored-cited-headers
  1735. All headers that match this regexp will be removed from yanked
  1736. messages. The default is @samp{.}, which means that all headers will be
  1737. removed.
  1738. @item message-cite-prefix-regexp
  1739. @vindex message-cite-prefix-regexp
  1740. Regexp matching the longest possible citation prefix on a line.
  1741. @item message-citation-line-function
  1742. @vindex message-citation-line-function
  1743. @cindex attribution line
  1744. Function called to insert the citation line. The default is
  1745. @code{message-insert-citation-line}, which will lead to citation lines
  1746. that look like:
  1747. @example
  1748. Hallvard B Furuseth <h.b.furuseth@@usit.uio.no> writes:
  1749. @end example
  1750. @c FIXME: Add 'message-insert-formatted-citation-line' and
  1751. @c 'message-citation-line-format'.
  1752. Point will be at the beginning of the body of the message when this
  1753. function is called.
  1754. Note that Gnus provides a feature where clicking on @samp{writes:} hides the
  1755. cited text. If you change the citation line too much, readers of your
  1756. messages will have to adjust their Gnus, too. See the variable
  1757. @code{gnus-cite-attribution-suffix}. @xref{Article Highlighting, ,
  1758. Article Highlighting, gnus, The Gnus Manual}, for details.
  1759. @item message-yank-prefix
  1760. @vindex message-yank-prefix
  1761. @cindex yanking
  1762. @cindex quoting
  1763. When you are replying to or following up an article, you normally want
  1764. to quote the person you are answering. Inserting quoted text is done by
  1765. @dfn{yanking}, and each line you yank will have
  1766. @code{message-yank-prefix} prepended to it (except for quoted lines
  1767. which use @code{message-yank-cited-prefix} and empty lines which use
  1768. @code{message-yank-empty-prefix}). The default is @samp{> }.
  1769. @item message-yank-cited-prefix
  1770. @vindex message-yank-cited-prefix
  1771. @cindex yanking
  1772. @cindex cited
  1773. @cindex quoting
  1774. When yanking text from an article which contains already cited text,
  1775. each line will be prefixed with the contents of this variable. The
  1776. default is @samp{>}. See also @code{message-yank-prefix}.
  1777. @item message-yank-empty-prefix
  1778. @vindex message-yank-empty-prefix
  1779. @cindex yanking
  1780. @cindex quoting
  1781. When yanking text from an article, each empty line will be prefixed with
  1782. the contents of this variable. The default is @samp{>}. You can set
  1783. this variable to an empty string to split the cited text into paragraphs
  1784. automatically. See also @code{message-yank-prefix}.
  1785. @item message-indentation-spaces
  1786. @vindex message-indentation-spaces
  1787. Number of spaces to indent yanked messages.
  1788. @item message-cite-function
  1789. @vindex message-cite-function
  1790. @findex message-cite-original
  1791. @findex message-cite-original-without-signature
  1792. Function for citing an original message. The default is
  1793. @code{message-cite-original}, which simply inserts the original message
  1794. and prepends @samp{> } to each line.
  1795. @code{message-cite-original-without-signature} does the same, but elides
  1796. the signature.
  1797. @item message-indent-citation-function
  1798. @vindex message-indent-citation-function
  1799. Function for modifying a citation just inserted in the mail buffer.
  1800. This can also be a list of functions. Each function can find the
  1801. citation between @code{(point)} and @code{(mark t)}. And each function
  1802. should leave point and mark around the citation text as modified.
  1803. @item message-mark-insert-begin
  1804. @vindex message-mark-insert-begin
  1805. String to mark the beginning of some inserted text.
  1806. @item message-mark-insert-end
  1807. @vindex message-mark-insert-end
  1808. String to mark the end of some inserted text.
  1809. @item message-signature
  1810. @vindex message-signature
  1811. String to be inserted at the end of the message buffer. If @code{t}
  1812. (which is the default), the @code{message-signature-file} file will be
  1813. inserted instead. If a function, the result from the function will be
  1814. used instead. If a form, the result from the form will be used instead.
  1815. If this variable is @code{nil}, no signature will be inserted at all.
  1816. @item message-signature-file
  1817. @vindex message-signature-file
  1818. File containing the signature to be inserted at the end of the buffer.
  1819. If a path is specified, the value of
  1820. @code{message-signature-directory} is ignored, even if set.
  1821. The default is @file{~/.signature}.
  1822. @item message-signature-directory
  1823. @vindex message-signature-directory
  1824. Name of directory containing signature files. Comes in handy if you
  1825. have many such files, handled via Gnus posting styles for instance.
  1826. If @code{nil} (the default), @code{message-signature-file} is expected
  1827. to specify the directory if needed.
  1828. @item message-signature-insert-empty-line
  1829. @vindex message-signature-insert-empty-line
  1830. If @code{t} (the default value) an empty line is inserted before the
  1831. signature separator.
  1832. @end table
  1833. Note that RFC1036bis says that a signature should be preceded by the three
  1834. characters @samp{-- } on a line by themselves. This is to make it
  1835. easier for the recipient to automatically recognize and process the
  1836. signature. So don't remove those characters, even though you might feel
  1837. that they ruin your beautiful design, like, totally.
  1838. Also note that no signature should be more than four lines long.
  1839. Including @acronym{ASCII} graphics is an efficient way to get
  1840. everybody to believe that you are silly and have nothing important to
  1841. say.
  1842. @node Various Message Variables
  1843. @section Various Message Variables
  1844. @table @code
  1845. @item message-default-charset
  1846. @vindex message-default-charset
  1847. @cindex charset
  1848. Symbol naming a @acronym{MIME} charset. Non-@acronym{ASCII} characters
  1849. in messages are assumed to be encoded using this charset. The default
  1850. is @code{iso-8859-1} on non-@sc{mule} Emacsen; otherwise @code{nil},
  1851. which means ask the user. (This variable is used only on non-@sc{mule}
  1852. Emacsen.) @xref{Charset Translation, , Charset Translation, emacs-mime,
  1853. Emacs MIME Manual}, for details on the @sc{mule}-to-@acronym{MIME}
  1854. translation process.
  1855. @item message-fill-column
  1856. @vindex message-fill-column
  1857. @cindex auto-fill
  1858. Local value for the column beyond which automatic line-wrapping should
  1859. happen for message buffers. If non-@code{nil} (the default), also turn on
  1860. auto-fill in message buffers.
  1861. @item message-signature-separator
  1862. @vindex message-signature-separator
  1863. Regexp matching the signature separator. It is @samp{^-- *$} by
  1864. default.
  1865. @item mail-header-separator
  1866. @vindex mail-header-separator
  1867. String used to separate the headers from the body. It is @samp{--text
  1868. follows this line--} by default.
  1869. @item message-directory
  1870. @vindex message-directory
  1871. Directory used by many mailish things. The default is @file{~/Mail/}.
  1872. All other mail file variables are derived from @code{message-directory}.
  1873. @item message-auto-save-directory
  1874. @vindex message-auto-save-directory
  1875. Directory where Message auto-saves buffers if Gnus isn't running. If
  1876. @code{nil}, Message won't auto-save. The default is @file{~/Mail/drafts/}.
  1877. @item message-signature-setup-hook
  1878. @vindex message-signature-setup-hook
  1879. Hook run when initializing the message buffer. It is run after the
  1880. headers have been inserted but before the signature has been inserted.
  1881. @item message-setup-hook
  1882. @vindex message-setup-hook
  1883. Hook run as the last thing when the message buffer has been initialized,
  1884. but before yanked text is inserted.
  1885. @item message-header-setup-hook
  1886. @vindex message-header-setup-hook
  1887. Hook called narrowed to the headers after initializing the headers.
  1888. For instance, if you're running Gnus and wish to insert a
  1889. @samp{Mail-Copies-To} header in all your news articles and all messages
  1890. you send to mailing lists, you could do something like the following:
  1891. @lisp
  1892. (defun my-message-header-setup-hook ()
  1893. (let ((group (or gnus-newsgroup-name "")))
  1894. (when (or (message-fetch-field "newsgroups")
  1895. (gnus-group-find-parameter group 'to-address)
  1896. (gnus-group-find-parameter group 'to-list))
  1897. (insert "Mail-Copies-To: never\n"))))
  1898. (add-hook 'message-header-setup-hook
  1899. 'my-message-header-setup-hook)
  1900. @end lisp
  1901. @item message-send-hook
  1902. @vindex message-send-hook
  1903. Hook run before sending messages.
  1904. If you want to add certain headers before sending, you can use the
  1905. @code{message-add-header} function in this hook. For instance:
  1906. @findex message-add-header
  1907. @lisp
  1908. (add-hook 'message-send-hook 'my-message-add-content)
  1909. (defun my-message-add-content ()
  1910. (message-add-header "X-In-No-Sense: Nonsense")
  1911. (message-add-header "X-Whatever: no"))
  1912. @end lisp
  1913. This function won't add the header if the header is already present.
  1914. @item message-send-mail-hook
  1915. @vindex message-send-mail-hook
  1916. Hook run before sending mail messages. This hook is run very late:
  1917. just before the message is actually sent as mail.
  1918. @item message-send-news-hook
  1919. @vindex message-send-news-hook
  1920. Hook run before sending news messages. This hook is run very late:
  1921. just before the message is actually sent as news.
  1922. @item message-sent-hook
  1923. @vindex message-sent-hook
  1924. Hook run after sending messages.
  1925. @item message-cancel-hook
  1926. @vindex message-cancel-hook
  1927. Hook run when canceling news articles.
  1928. @item message-mode-syntax-table
  1929. @vindex message-mode-syntax-table
  1930. Syntax table used in message mode buffers.
  1931. @item message-cite-articles-with-x-no-archive
  1932. @vindex message-cite-articles-with-x-no-archive
  1933. If non-@code{nil}, don't strip quoted text from articles that have
  1934. @samp{X-No-Archive} set. Even if this variable isn't set, you can
  1935. undo the stripping by hitting the @code{undo} keystroke.
  1936. @item message-strip-special-text-properties
  1937. @vindex message-strip-special-text-properties
  1938. Emacs has a number of special text properties which can break message
  1939. composing in various ways. If this option is set, message will strip
  1940. these properties from the message composition buffer. However, some
  1941. packages requires these properties to be present in order to work. If
  1942. you use one of these packages, turn this option off, and hope the
  1943. message composition doesn't break too bad.
  1944. @item message-send-method-alist
  1945. @vindex message-send-method-alist
  1946. @findex message-mail-p
  1947. @findex message-news-p
  1948. @findex message-send-via-mail
  1949. @findex message-send-via-news
  1950. Alist of ways to send outgoing messages. Each element has the form:
  1951. @lisp
  1952. (@var{type} @var{predicate} @var{function})
  1953. @end lisp
  1954. @table @var
  1955. @item type
  1956. A symbol that names the method.
  1957. @item predicate
  1958. A function called without any parameters to determine whether the
  1959. message is a message of type @var{type}. The function will be called in
  1960. the buffer where the message is.
  1961. @item function
  1962. A function to be called if @var{predicate} returns non-@code{nil}.
  1963. @var{function} is called with one parameter---the prefix.
  1964. @end table
  1965. The default is:
  1966. @lisp
  1967. ((news message-news-p message-send-via-news)
  1968. (mail message-mail-p message-send-via-mail))
  1969. @end lisp
  1970. The @code{message-news-p} function returns non-@code{nil} if the message
  1971. looks like news, and the @code{message-send-via-news} function sends the
  1972. message according to the @code{message-send-news-function} variable
  1973. (@pxref{News Variables}). The @code{message-mail-p} function returns
  1974. non-@code{nil} if the message looks like mail, and the
  1975. @code{message-send-via-mail} function sends the message according to the
  1976. @code{message-send-mail-function} variable (@pxref{Mail Variables}).
  1977. All the elements in this alist will be tried in order, so a message
  1978. containing both a valid @samp{Newsgroups} header and a valid @samp{To}
  1979. header, for example, will be sent as news, and then as mail.
  1980. @end table
  1981. @node Sending Variables
  1982. @section Sending Variables
  1983. @table @code
  1984. @item message-fcc-handler-function
  1985. @vindex message-fcc-handler-function
  1986. A function called to save outgoing articles. This function will be
  1987. called with the name of the file to store the article in. The default
  1988. function is @code{message-output} which saves in Unix mailbox format.
  1989. @item message-courtesy-message
  1990. @vindex message-courtesy-message
  1991. When sending combined messages, this string is inserted at the start of
  1992. the mailed copy. If the string contains the format spec @samp{%s}, the
  1993. newsgroups the article has been posted to will be inserted there. If
  1994. this variable is @code{nil}, no such courtesy message will be added.
  1995. The default value is @samp{"The following message is a courtesy copy of
  1996. an article\\nthat has been posted to %s as well.\\n\\n"}.
  1997. @item message-fcc-externalize-attachments
  1998. @vindex message-fcc-externalize-attachments
  1999. If @code{nil}, attach files as normal parts in Fcc copies; if it is
  2000. non-@code{nil}, attach local files as external parts.
  2001. @item message-interactive
  2002. @vindex message-interactive
  2003. If non-@code{nil} wait for and display errors when sending a message;
  2004. if @code{nil} let the mailer mail back a message to report errors.
  2005. @item message-confirm-send
  2006. @vindex message-confirm-send
  2007. When non-@code{nil}, Gnus will ask for confirmation when sending a
  2008. message.
  2009. @end table
  2010. @node Message Buffers
  2011. @section Message Buffers
  2012. Message will generate new buffers with unique buffer names when you
  2013. request a message buffer. When you send the message, the buffer isn't
  2014. normally killed off. Its name is changed and a certain number of old
  2015. message buffers are kept alive.
  2016. @table @code
  2017. @item message-generate-new-buffers
  2018. @vindex message-generate-new-buffers
  2019. Controls whether to create a new message buffer to compose a message.
  2020. Valid values include:
  2021. @table @code
  2022. @item nil
  2023. Generate the buffer name in the Message way (e.g., *mail*, *news*, *mail
  2024. to whom*, *news on group*, etc.)@: and continue editing in the existing
  2025. buffer of that name. If there is no such buffer, it will be newly
  2026. created.
  2027. @item unique
  2028. @item t
  2029. Create the new buffer with the name generated in the Message way.
  2030. @item unsent
  2031. Similar to @code{unique} but the buffer name begins with "*unsent ".
  2032. @item standard
  2033. Similar to @code{nil} but the buffer name is simpler like *mail
  2034. message*.
  2035. @end table
  2036. @table @var
  2037. @item function
  2038. If this is a function, call that function with three parameters: The
  2039. type, the To address and the group name (any of these may be
  2040. @code{nil}). The function should return the new buffer name.
  2041. @end table
  2042. The default value is @code{unsent}.
  2043. @item message-max-buffers
  2044. @vindex message-max-buffers
  2045. This variable says how many old message buffers to keep. If there are
  2046. more message buffers than this, the oldest buffer will be killed. The
  2047. default is 10. If this variable is @code{nil}, no old message buffers
  2048. will ever be killed.
  2049. @item message-send-rename-function
  2050. @vindex message-send-rename-function
  2051. After sending a message, the buffer is renamed from, for instance,
  2052. @samp{*reply to Lars*} to @samp{*sent reply to Lars*}. If you don't
  2053. like this, set this variable to a function that renames the buffer in a
  2054. manner you like. If you don't want to rename the buffer at all, you can
  2055. say:
  2056. @lisp
  2057. (setq message-send-rename-function 'ignore)
  2058. @end lisp
  2059. @item message-kill-buffer-on-exit
  2060. @findex message-kill-buffer-on-exit
  2061. If non-@code{nil}, kill the buffer immediately on exit.
  2062. @end table
  2063. @node Message Actions
  2064. @section Message Actions
  2065. When Message is being used from a news/mail reader, the reader is likely
  2066. to want to perform some task after the message has been sent. Perhaps
  2067. return to the previous window configuration or mark an article as
  2068. replied.
  2069. @vindex message-kill-actions
  2070. @vindex message-postpone-actions
  2071. @vindex message-exit-actions
  2072. @vindex message-send-actions
  2073. The user may exit from the message buffer in various ways. The most
  2074. common is @kbd{C-c C-c}, which sends the message and exits. Other
  2075. possibilities are @kbd{C-c C-s} which just sends the message, @kbd{C-c
  2076. C-d} which postpones the message editing and buries the message buffer,
  2077. and @kbd{C-c C-k} which kills the message buffer. Each of these actions
  2078. have lists associated with them that contains actions to be executed:
  2079. @code{message-send-actions}, @code{message-exit-actions},
  2080. @code{message-postpone-actions}, and @code{message-kill-actions}.
  2081. Message provides a function to interface with these lists:
  2082. @code{message-add-action}. The first parameter is the action to be
  2083. added, and the rest of the arguments are which lists to add this action
  2084. to. Here's an example from Gnus:
  2085. @lisp
  2086. (message-add-action
  2087. `(set-window-configuration ,(current-window-configuration))
  2088. 'exit 'postpone 'kill)
  2089. @end lisp
  2090. This restores the Gnus window configuration when the message buffer is
  2091. killed, postponed or exited.
  2092. An @dfn{action} can be either: a normal function, or a list where the
  2093. @sc{car} is a function and the @sc{cdr} is the list of arguments, or
  2094. a form to be @code{eval}ed.
  2095. @node Appendices
  2096. @chapter Appendices
  2097. @menu
  2098. * Responses:: Standard rules for determining where responses go.
  2099. @end menu
  2100. @node Responses
  2101. @section Responses
  2102. To determine where a message is to go, the following algorithm is used
  2103. by default.
  2104. @table @dfn
  2105. @item reply
  2106. A @dfn{reply} is when you want to respond @emph{just} to the person who
  2107. sent the message via mail. There will only be one recipient. To
  2108. determine who the recipient will be, the following headers are
  2109. consulted, in turn:
  2110. @table @code
  2111. @item Reply-To
  2112. @item From
  2113. @end table
  2114. @item wide reply
  2115. A @dfn{wide reply} is a mail response that includes @emph{all} entities
  2116. mentioned in the message you are responding to. All mailboxes from the
  2117. following headers will be concatenated to form the outgoing
  2118. @code{To}/@code{Cc} headers:
  2119. @table @code
  2120. @item From
  2121. (unless there's a @code{Reply-To}, in which case that is used instead).
  2122. @item Cc
  2123. @item To
  2124. @end table
  2125. If a @code{Mail-Copies-To} header is present, it will also be included
  2126. in the list of mailboxes. If this header is @samp{never}, that means
  2127. that the @code{From} (or @code{Reply-To}) mailbox will be suppressed.
  2128. @item followup
  2129. A @dfn{followup} is a response sent via news. The following headers
  2130. (listed in order of precedence) determine where the response is to be
  2131. sent:
  2132. @table @code
  2133. @item Followup-To
  2134. @item Newsgroups
  2135. @end table
  2136. If a @code{Mail-Copies-To} header is present, it will be used as the
  2137. basis of the new @code{Cc} header, except if this header is
  2138. @samp{never}.
  2139. @end table
  2140. @node GNU Free Documentation License
  2141. @chapter GNU Free Documentation License
  2142. @include doclicense.texi
  2143. @node Index
  2144. @chapter Index
  2145. @printindex cp
  2146. @node Key Index
  2147. @chapter Key Index
  2148. @printindex ky
  2149. @bye
  2150. @c End: