;;; @@ optional header fields
;;;
-(defvar mime-edit-insert-x-emacs-field t
- "*If non-nil, insert X-Emacs header field.")
-
-(defvar mime-edit-x-emacs-value
- (if (featurep 'xemacs)
- (concat emacs-version (if (featurep 'mule)
- " with mule"
- " without mule"))
- (let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
- (substring emacs-version 0 (match-beginning 0))
- emacs-version)))
- (if (featurep 'mule)
- (if (boundp 'enable-multibyte-characters)
- (concat "Emacs " ver
- (if enable-multibyte-characters
- (concat ", MULE " mule-version)
- " (with raw setting)")
- (if (featurep 'meadow)
- (concat ", " (Meadow-version))
- ))
- (concat "MULE " mule-version " based on Emacs " ver))
- ver)))
- "Body of X-Emacs field.
-If variable `mime-edit-insert-x-emacs-field' is not nil, it is
+(defvar mime-edit-insert-user-agent-field t
+ "*If non-nil, insert User-Agent header field.")
+
+(defvar mime-edit-user-agent-value
+ (concat (car mime-user-interface-version)
+ "/"
+ (mapconcat #'number-to-string
+ (cddr mime-user-interface-version) ".")
+ " ("
+ (cadr mime-user-interface-version)
+ ") "
+ (car mime-library-version)
+ "/"
+ (mapconcat #'number-to-string
+ (cddr mime-library-version) ".")
+ " ("
+ (cadr mime-library-version)
+ ") "
+ (if (featurep 'xemacs)
+ (concat "XEmacs"
+ (if (string-match "\\s +\\\"" emacs-version)
+ (concat "/"
+ (substring emacs-version 0
+ (match-beginning 0))
+ " (" xemacs-codename ")")
+ " (" emacs-version ")")
+ (if (featurep 'mule) " MULE"))
+ (let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
+ (substring emacs-version 0 (match-beginning 0))
+ emacs-version)))
+ (if (featurep 'mule)
+ (if (boundp 'enable-multibyte-characters)
+ (concat "Emacs/" ver
+ (if enable-multibyte-characters
+ (concat " MULE/" mule-version)
+ " (with unibyte mode)")
+ (if (featurep 'meadow)
+ (let ((mver (Meadow-version)))
+ (if (string-match "^Meadow-" mver)
+ (concat " Meadow/"
+ (substring mver
+ (match-end 0)))
+ ))))
+ (concat "MULE/" mule-version
+ " (based on Emacs " ver ")"))
+ ver))))
+ "Body of User-Agent field.
+If variable `mime-edit-insert-user-agent-field' is not nil, it is
inserted into message header.")
\f
(let ((contype (car ret)) ;Content-Type
(encoding (nth 1 ret)) ;Content-Transfer-Encoding
)
- ;; Insert X-Emacs field
- (and mime-edit-insert-x-emacs-field
- (or (mail-position-on-field "X-Emacs")
- (insert mime-edit-x-emacs-value)
+ ;; Insert User-Agent field
+ (and mime-edit-insert-user-agent-field
+ (or (mail-position-on-field "User-Agent")
+ (insert mime-edit-user-agent-value)
))
;; Make primary MIME headers.
(or (mail-position-on-field "MIME-Version")
(defvar mime-edit-again-ignored-field-regexp
(concat "^\\(" "Content-.*\\|Mime-Version"
- (if mime-edit-insert-x-emacs-field "\\|X-Emacs")
+ (if mime-edit-insert-user-agent-field "\\|User-Agent")
"\\):")
"Regexp for deleted header fields when `mime-edit-again' is called.")