aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2017-01-26 22:51:19 +0100
committerLars Ingebrigtsen2017-01-26 22:51:19 +0100
commit77bbca8c82f6e553c42abbfafca28f55fc995d00 (patch)
tree5e8fac2a9a6a1054edb9d4af0951e8226ac34f14
parent47e82854ba12d5ac79ed66b90ba727e1b1c44d52 (diff)
downloademacs-77bbca8c82f6e553c42abbfafca28f55fc995d00.tar.gz
emacs-77bbca8c82f6e553c42abbfafca28f55fc995d00.zip
Fill too long mail headers
* lisp/gnus/message.el (message--fold-long-headers): New function to fold too-long headers (bug#21608). (message-send-mail): Use it to fill headers longer than 998 characters (which is the protocol limit).
-rw-r--r--lisp/gnus/message.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 50d2380dd7b..e45ab1080a5 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4552,6 +4552,9 @@ This function could be useful in `message-setup-hook'."
4552 (forward-line 1) 4552 (forward-line 1)
4553 (unless (y-or-n-p "Send anyway? ") 4553 (unless (y-or-n-p "Send anyway? ")
4554 (error "Failed to send the message"))))) 4554 (error "Failed to send the message")))))
4555 ;; Fold too-long header lines. They should be no longer than
4556 ;; 998 octets long.
4557 (message--fold-long-headers)
4555 ;; Let the user do all of the above. 4558 ;; Let the user do all of the above.
4556 (run-hooks 'message-header-hook)) 4559 (run-hooks 'message-header-hook))
4557 (setq options message-options) 4560 (setq options message-options)
@@ -4648,6 +4651,14 @@ If you always want Gnus to send messages in one piece, set
4648 (setq message-options options) 4651 (setq message-options options)
4649 (push 'mail message-sent-message-via))) 4652 (push 'mail message-sent-message-via)))
4650 4653
4654(defun message--fold-long-headers ()
4655 (goto-char (point-min))
4656 (while (not (eobp))
4657 (when (and (looking-at "[^:]+:")
4658 (> (- (line-end-position) (point)) 998))
4659 (mail-header-fold-field))
4660 (forward-line 1)))
4661
4651(defvar sendmail-program) 4662(defvar sendmail-program)
4652(defvar smtpmail-smtp-server) 4663(defvar smtpmail-smtp-server)
4653(defvar smtpmail-smtp-service) 4664(defvar smtpmail-smtp-service)