Function: message-make-fqdn

message-make-fqdn is a byte-compiled function defined in message.el.gz.

Signature

(message-make-fqdn)

Documentation

Return user's fully qualified domain name.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message-make-fqdn ()
  "Return user's fully qualified domain name."
  (let* ((sysname (system-name))
	 (user-mail (message-user-mail-address))
	 (user-domain
	  (if (and user-mail
		   (string-match "@\\(.*\\)\\'" user-mail))
	      (match-string 1 user-mail)))
	 (case-fold-search t))
    (cond
     ((and message-user-fqdn
	   (stringp message-user-fqdn)
	   (not (string-match message-bogus-system-names message-user-fqdn)))
      ;; `message-user-fqdn' seems to be valid
      message-user-fqdn)
     ;; A system name without any dots is unlikely to be a good fully
     ;; qualified domain name.
     ((and (string-search "." sysname)
	   (not (string-match message-bogus-system-names sysname)))
      ;; `system-name' returned the right result.
      sysname)
     ;; Try `mail-host-address'.
     ((and (stringp mail-host-address)
	   (not (string-match message-bogus-system-names mail-host-address)))
      mail-host-address)
     ;; We try `user-mail-address' as a backup.
     ((and user-domain
	   (stringp user-domain)
	   (not (string-match message-bogus-system-names user-domain)))
      user-domain)
     ;; Default to this bogus thing.
     (t
      (concat sysname ".mail-host-address-is-not-set")))))