sendmail.elc 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. (provide (quote sendmail))
  2. (defvar mail-aliases t "\
  3. Alias of mail address aliases,
  4. or t meaning should be initialized from .mailrc.")
  5. (defvar mail-abbrevs-loaded nil)
  6. (defvar mail-mode-map nil)
  7. (autoload (quote build-mail-aliases) "mailalias" "\
  8. Read mail aliases from ~/.mailrc and set mail-aliases." nil)
  9. (autoload (quote expand-mail-aliases) "mailalias" "\
  10. Expand all mail aliases in suitable header fields found between BEG and END.
  11. Suitable header fields are To, CC and BCC." nil)
  12. (defun mail-setup (to subject in-reply-to cc replybuffer) (byte-code "Á=…‰ˆÎÏ!…Ð ˆ ‰ˆebˆÑcˆŠ ƒ2Ò Ó\"ˆÔÕed\")‚4Ö ˆ…M`ÔÒ×Ó#ˆØd\"*ˆ …YÒÙ Ó#ˆÒÚ
  13. †bÛÓ#ˆ …pÒÜÝ Ó#ˆ …|ÒÞ Ó#ˆÒ Ó\")ˆ …Šdbˆ †œ
  14. †œ †œßÂ!ˆàá!‡" [mail-aliases t nil mail-reply-buffer replybuffer to fill-prefix cc opos in-reply-to subject mail-self-blind mail-archive-file-name mail-header-separator file-exists-p "~/.mailrc" build-mail-aliases "To: " insert "
  15. " " " fill-region newline "CC: " fill-region-as-paragraph "In-reply-to: " "Subject: " "" "BCC: " user-login-name "FCC: " set-buffer-modified-p run-hooks mail-setup-hook] 16))
  16. (defun mail-mode nil "\
  17. Major mode for editing mail to be sent.
  18. Like Text Mode but with these additional commands:
  19. C-c C-s mail-send (send the message) C-c C-c mail-send-and-exit
  20. C-c C-f move to a header field (and create it if there isn't):
  21. C-c C-f C-t move to To: C-c C-f C-s move to Subj:
  22. C-c C-f C-b move to BCC: C-c C-f C-c move to CC:
  23. C-c C-w mail-signature (insert ~/.signature at end).
  24. C-c C-y mail-yank-original (insert current message, in Rmail).
  25. C-c C-q mail-fill-yanked-message (fill what was yanked)." (interactive) (byte-code "ÁˆÍ ˆÎÀ!ˆÁ‰ˆÏ
  26. !ˆÐ !ˆ ‰ˆÑ‰ˆÒ‰ˆÉ‰ˆÎÌ!ˆÎÊ!ˆÓ Ô
  27. R‰
  28. ˆÓ Ô R‰ ˆÕÖ×\"‡" [mail-reply-buffer nil text-mode-syntax-table mail-mode-map local-abbrev-table text-mode-abbrev-table major-mode mode-name buffer-offer-save t paragraph-start mail-header-separator paragraph-separate kill-all-local-variables make-local-variable set-syntax-table use-local-map mail-mode "Mail" "^" "$\\|^[ ]*[-_][-_][-_]+$\\|" run-hooks text-mode-hook mail-mode-hook] 10))
  29. (if mail-mode-map nil (setq mail-mode-map (make-sparse-keymap)) (define-key mail-mode-map "?" (quote describe-mode)) (define-key mail-mode-map "" (quote mail-to)) (define-key mail-mode-map "" (quote mail-bcc)) (define-key mail-mode-map "" (quote mail-cc)) (define-key mail-mode-map "" (quote mail-subject)) (define-key mail-mode-map "" (quote mail-signature)) (define-key mail-mode-map "" (quote mail-yank-original)) (define-key mail-mode-map "" (quote mail-fill-yanked-message)) (define-key mail-mode-map "" (quote mail-send-and-exit)) (define-key mail-mode-map "" (quote mail-send)))
  30. (defun mail-send-and-exit (arg) "\
  31. Send message like mail-send, then, if no errors, exit from mail buffer." (interactive "P") (byte-code "ˆà ˆÄp!ˆ†ÅÁ!ƒÆÇp!!‚È ‡" [arg t nil mail-send bury-buffer one-window-p switch-to-buffer other-buffer delete-window] 7))
  32. (defun one-window-p (&optional nomini) (byte-code "Á …
  33. Âà !ƒÄ ‚ÄÄ !=‡" [nomini selected-window zerop minibuffer-depth next-window] 8))
  34. (defun mail-send nil "\
  35. Send the message in the current buffer.
  36. If mail-interactive is non-nil, wait for success indication
  37. or error messages, and inform user.
  38. Otherwise any failure is reported in a message back to
  39. the user from the mailer." (interactive) (byte-code "ÁˆÂÃ!ˆÄ!ˆÅÁ!ˆÆ ˆÂÇ!‡" [send-mail-function nil message "Sending..." funcall set-buffer-modified-p delete-auto-save-file-if-necessary "Sending...done"] 6))
  40. (defun sendmail-send-it nil (byte-code " ƒ
  41. ËÌ!‚ ÍËÎ!ÄÄpÏŽŠ
  42. qˆÐ ˆÑ!ˆdbˆhÒU†0ÒcˆebˆÓÔÕ!ÖQ!ˆ×Ö!ˆØÙ!ˆÚ ‰ˆ…TÛe \"ˆebˆÓÜ É#…c` W…m×Ö!ˆ‚XˆÉebˆÓÝ É#…~Þ !ˆebˆÓß É#…¢ŠebˆÓà É#)?…¢áÙ!ˆâãä Ö#ˆebˆÓå É#…±×æ!ˆ …½ŠqˆÐ ))ˆçèéêedëÊ!ƒÐ
  43. ‚ÑìÄÄíî&ïð ñ\"…äòä D ?…êó#\"ˆ …ŠqˆebˆÓôÄÉ#…×õ!ˆ‚øˆö÷ !?…øùúed\"\")))-‡" [errbuf mail-interactive tembuf case-fold-search nil delimline mailbuf mail-header-separator mail-aliases t sendmail-program generate-new-buffer " sendmail errors" 0 " sendmail temp" ((byte-code "Â!ˆÃ !…  !‡" [tembuf errbuf kill-buffer bufferp] 4)) erase-buffer insert-buffer-substring 10 re-search-forward "^" regexp-quote "
  44. " replace-match backward-char 1 point-marker expand-mail-aliases "
  45. *" "^FCC:" mail-do-fcc "^From:" "^Sender:" forward-line insert "Sender: " user-login-name "^Subject:[ ]*
  46. " "" apply call-process-region append list boundp "/usr/lib/sendmail" "-oi" "-t" equal user-real-login-name "root" "-f" ("-oem" "-odb") "
  47. * *" "; " zerop buffer-size error "Sending...failed to %s" buffer-substring] 38))
  48. (defun mail-do-fcc (header-end) (byte-code "ÆpÇÈ!ÄŠebˆÉÊ Ä#…4Ë`Ì ˆÍÎ!ˆ`\"B‰ˆÏÐÑ!ÒÓ!ˆ`\"ˆ‚ˆ
  49. qˆÔ ˆÕÖ× ØÙ Ú%ˆÛ !ˆdbˆÜcˆÝbˆÆÞÖÆÄ#…fßà!ˆácˆ‚T)ˆ…|âed@Ä$ˆA‰ˆ‚h)ˆã
  50. !,‡" [fcc-list rmailbuf tembuf case-fold-search t header-end nil generate-new-buffer " rmail output" re-search-forward "^FCC:[ ]*" buffer-substring end-of-line skip-chars-backward " " delete-region match-beginning 0 forward-line 1 erase-buffer insert "
  51. From " user-login-name " " current-time-string "
  52. " insert-buffer-substring 10 2 search-forward forward-char -5 62 write-region kill-buffer] 21))
  53. (defun mail-to nil "\
  54. Move point to end of To-field." (interactive) (byte-code "ÀˆÁ ˆÂÃ!‡" [nil expand-abbrev mail-position-on-field "To"] 3))
  55. (defun mail-subject nil "\
  56. Move point to end of Subject-field." (interactive) (byte-code "ÀˆÁ ˆÂÃ!‡" [nil expand-abbrev mail-position-on-field "Subject"] 3))
  57. (defun mail-cc nil "\
  58. Move point to end of CC-field. Create a CC field if none." (interactive) (byte-code "ÁˆÂ ˆÃÄÀ\"†ÃÅ!ˆÆc‡" [t nil expand-abbrev mail-position-on-field "cc" "to" "
  59. CC: "] 4))
  60. (defun mail-bcc nil "\
  61. Move point to end of BCC-field. Create a BCC field if none." (interactive) (byte-code "ÁˆÂ ˆÃÄÀ\"†ÃÅ!ˆÆc‡" [t nil expand-abbrev mail-position-on-field "bcc" "to" "
  62. BCC: "] 4))
  63. (defun mail-position-on-field (field &optional soft) (byte-code "ÅÂebˆÇÈ ÈQ!ˆÉÊ!‰ˆebˆËÌÍ !ÎQÂ#ƒ5ËÏÅÐ#ˆÑ ˆÒÈ!ˆÂ‚H†FbˆÒÈ!ˆÓÈ Ô#ˆÅ*‡" [end case-fold-search t mail-header-separator field nil soft search-forward "
  64. " match-beginning 0 re-search-forward "^" regexp-quote ":" "^[^ ]" move beginning-of-line skip-chars-backward insert ": "] 12))
  65. (defun mail-signature nil "\
  66. Sign letter with contents of ~/.signature file." (interactive) (byte-code "ÀˆŠdbˆÁÂÃ!!)‡" [nil insert-file-contents expand-file-name "~/.signature"] 3))
  67. (defun mail-fill-yanked-message (&optional justifyp) "\
  68. Fill the paragraphs of a message yanked into this one.
  69. Numeric argument means justify as well." (interactive "P") (byte-code "ÁˆŠebˆÄÅÅQÁÂ#ˆÆ`d Â$)‡" [mail-header-separator nil t justifyp search-forward "
  70. " fill-individual-paragraphs] 6))
  71. (defun mail-yank-original (arg) "\
  72. Insert the message being replied to, if any (in rmail).
  73. Puts point before the text and mark after.
  74. Indents each nonblank line ARG spaces (default 3).
  75. Just \\[universal-argument] as argument means don't indent
  76. and don't delete any header fields." (interactive "P") (byte-code "È…;`Ä!ˆÅ!ˆ
  77. :ƒÂ/Æ Ç \"ˆÈ Ç
  78. ƒ-É
  79. !‚.Ê#ˆË ˆl?…:Ìc)‡" [mail-reply-buffer start arg nil delete-windows-on insert-buffer mail-yank-clear-headers mark indent-rigidly prefix-numeric-value 3 exchange-point-and-mark 10] 10))
  80. (defun mail-yank-clear-headers (start end) (byte-code "ŠbˆÆÇ Â#…4ŒÈ`\"ˆbˆÂÉ ÅÂ#)…3Ê ˆË`ÉÌ!ˆÍÎ!ˆ`\"ˆ‚))‡" [start end t case-fold-search mail-yank-ignored-headers nil search-forward "
  81. " narrow-to-region re-search-forward beginning-of-line delete-region "
  82. [^ ]" forward-char -1] 10))
  83. (defun mail (&optional noerase to subject in-reply-to cc replybuffer) "\
  84. Edit a message to be sent. Argument means resume editing (don't erase).
  85. Returns with message buffer seleted; value t if message freshly initialized.
  86. While editing message, type C-c C-c to send the message and exit.
  87. Various special commands starting with C-c are available in sendmail mode
  88. to move to message header fields. Type C-c? for a list of them.
  89. If mail-self-blind is non-nil, a BCC to yourself is inserted
  90. when the message is initialized.
  91. If mail-setup-hook is bound, its value is called with no arguments
  92. after the message is initialized. It can add more default fields.
  93. When calling from a program, the second through fifth arguments
  94. TO, SUBJECT, CC and IN-REPLY-TO specify if non-nil
  95. the initial contents of those header fields.
  96. These arguments should not have final newlines.
  97. The sixth argument REPLYBUFFER is a buffer whose contents
  98. should be yanked if the user types C-c y." (interactive "P") (byte-code "ɈÊË!ˆÌÍ!‰ˆÎ !ˆÏ ˆ
  99. ?…2Ð ?†!ÑÒ!…2Ó ˆÔ %ˆÈ‡" [default-directory auto-save-default noerase to subject in-reply-to cc replybuffer t nil switch-to-buffer "*mail*" expand-file-name "~/" auto-save-mode mail-mode buffer-modified-p y-or-n-p "Unsent message being composed; erase it? " erase-buffer mail-setup] 13))
  100. (defun mail-other-window (&optional noerase to subject in-reply-to cc replybuffer) "\
  101. Like \"mail\" command, but display mail buffer in another window." (interactive "P") (byte-code "ȈÁÉÊ!)ˆË
  102. &‡" [pop-up-windows t noerase to subject in-reply-to cc replybuffer nil pop-to-buffer "*mail*" mail] 8))