;ELC   
;;; Compiled by root@tweety.build.redhat.com on Tue Dec 14 03:50:02 2004
;;; from file /usr/src/build/496412-noarch/BUILD/flim-1.14.7/smtp.el
;;; in Emacs version 21.3.1
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`smtp.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307\310\311\312\313%\210\306\314\310\315\312\307%\207" [require custom mail-utils sasl luna mel custom-declare-group smtp nil "SMTP protocol for sending mail." :group mail smtp-extensions "SMTP service extensions (RFC1869)."] 6)
#@30 Specify default SMTP server.
(custom-declare-variable 'smtp-default-server 'nil '(#$ . 941) :type '(choice (const nil) string) :group 'smtp)
#@135 The name of the host running SMTP server.
It can also be a function
called from `smtp-via-smtp' with arguments SENDER and RECIPIENTS.
(custom-declare-variable 'smtp-server '(or (getenv "SMTPSERVER") smtp-default-server) '(#$ . 1089) :type '(choice (string :tag "Name") (function :tag "Function")) :group 'smtp)
#@95 If non-nil, smtp.el send a mail by myself without smtp-server.
This option requires "dig.el".
(custom-declare-variable 'smtp-send-by-myself 'nil '(#$ . 1406) :type 'boolean :group 'smtp)
#@42 SMTP service port number.  "smtp" or 25.
(custom-declare-variable 'smtp-service '"smtp" '(#$ . 1599) :type '(choice (integer :tag "25" 25) (string :tag "smtp" "smtp")) :group 'smtp)
#@130 Local domain name without a host name.
If the function (system-name) returns the full internet address,
don't define this value.
(custom-declare-variable 'smtp-local-domain 'nil '(#$ . 1788) :type '(choice (const nil) string) :group 'smtp)
#@50 Fully qualified domain name used for Message-ID.
(custom-declare-variable 'smtp-fqdn 'nil '(#$ . 2034) :type '(choice (const nil) string) :group 'smtp)
#@56 If non-nil, use ESMTP 8BITMIME (RFC1652) if available.
(custom-declare-variable 'smtp-use-8bitmime 't '(#$ . 2192) :type 'boolean :group 'smtp-extensions)
#@52 If non-nil, use ESMTP SIZE (RFC1870) if available.
(custom-declare-variable 'smtp-use-size 't '(#$ . 2353) :type 'boolean :group 'smtp-extensions)
#@50 If non-nil, use STARTTLS (RFC2595) if available.
(custom-declare-variable 'smtp-use-starttls 'nil '(#$ . 2506) :type 'boolean :group 'smtp-extensions)
#@63 If non-nil, do not use STARTTLS if STARTTLS is not available.
(custom-declare-variable 'smtp-use-starttls-ignore-error 'nil '(#$ . 2663) :type 'boolean :group 'smtp-extensions)
#@65 The program to run in a subprocess to open an TLSv1 connection.
(custom-declare-variable 'smtp-starttls-program '"starttls" '(#$ . 2846) :group 'smtp-extensions)
#@39 Extra arguments to `starttls-program'
(custom-declare-variable 'smtp-starttls-extra-args 'nil '(#$ . 3014) :group 'smtp-extensions)
#@61 If non-nil, use SMTP Authentication (RFC2554) if available.
(custom-declare-variable 'smtp-use-sasl 'nil '(#$ . 3152) :type 'boolean :group 'smtp-extensions)
#@46 Identification to be used for authorization.
(custom-declare-variable 'smtp-sasl-user-name '(user-login-name) '(#$ . 3316) :type 'string :group 'smtp-extensions)
#@32 Properties set to SASL client.
(custom-declare-variable 'smtp-sasl-properties 'nil '(#$ . 3484) :type 'string :group 'smtp-extensions)
#@36 List of authentication mechanisms.
(custom-declare-variable 'smtp-sasl-mechanisms 'nil '(#$ . 3625) :type '(repeat string) :group 'smtp-extensions)
#@486 Format string used to show progress message while sending mails.
It allows the following special format specifiers:

%b means show the number of bytes which has been sent
   and the total bytes of a mail.
%k means show the number of kilobytes which has been sent
   and the total kilobytes of a mail.
%l means show the number of lines which has been sent
   and the total lines of a mail.

For instance, the value "Sending (%k)..." shows like
"Sending (45k/123k)..." in the echo area.
(custom-declare-variable 'smtp-progress-message-format 'nil '(#$ . 3780) :type '(radio (string :format "%v\n" :size 0 :value "Sending (%k)...") (const :tag "Don't show progress message" nil)) :group 'smtp)
(byte-code "\301B\301\207" [current-load-list sasl-mechanisms] 2)
#@720 *Function used for connecting to a SMTP server.
The function will be called with the same four arguments as
`open-network-stream' and should return a process object.
Here is an example:

(setq smtp-open-connection-function
      #'(lambda (name buffer host service)
	  (let ((process-connection-type nil))
	    (start-process name buffer "ssh" "-C" host
			   "nc" host service))))

It connects to a SMTP server using "ssh" before actually connecting
to the SMTP port.  Where the command "nc" is the netcat executable;
see http://www.atstake.com/research/tools/index.html#network_utilities
for details.  In addition, you will have to modify the value for
`smtp-end-of-line' to "\n" if you use "telnet" instead of "nc".
(defvar smtp-open-connection-function 'open-network-stream (#$ . -4546))
(byte-code "\301B\304\301!\204\f \305\302B\304\302!\204 \305\303B\304\303!\204$ \306\305\207" [current-load-list smtp-read-point smtp-connection-alist smtp-submit-package-function boundp nil smtp-submit-package] 2)
#@211 *String to use as end-of-line marker when talking to a SMTP server.
This is "\r\n" by default, but it may have to be "\n" when using a non
native connection function.  See also `smtp-open-connection-function'.
(defvar smtp-end-of-line "\n" (#$ . -5570))
(byte-code "\300\301\302\303#\210\304\301!\207" [luna-define-class-function smtp-package (standard-object) (sender recipients buffer) luna-define-internal-accessors] 4)
#@221 Create a new package structure.
A package is a unit of SMTP message
SENDER specifies the package sender, a string.
RECIPIENTS is a list of recipients.
BUFFER may be a buffer or a buffer name which contains mail message.
(defalias 'smtp-make-package #[(sender recipients buffer) "\303\304\305\306	\307\n&\207" [sender recipients buffer luna-make-entity smtp-package :sender :recipients :buffer] 8 (#$ . 6001)])
#@41 Return the size of PACKAGE, an integer.
(defalias 'smtp-package-buffer-internal-size #[(package) "\212\302Hq\210\303 \304ed\"\\\305\\eb\210\306\307\310\311#\203! 	T\202 	*\207" [package size 4 buffer-size count-lines 2 re-search-forward "^\\." nil t] 4 (#$ . 6419)])
(byte-code "\300\301\302\303#\210\304\301!\207" [luna-define-class-function smtp-connection (standard-object) (process server service extensions encoder decoder) luna-define-internal-accessors] 4)
#@162 Create a new connection structure.
PROCESS is an internal subprocess-object.  SERVER is name of the host
to connect to.  SERVICE is name of the service desired.
(defalias 'smtp-make-connection #[(process server service) "\303\304\305\306	\307\n&\207" [process server service luna-make-entity smtp-connection :process :server :service] 8 (#$ . 6894)])
#@55 Say whether the CONNECTION to server has been opened.
(defalias 'smtp-connection-opened #[(connection) "\301\302#\207" [connection luna-apply-generic smtp-connection-opened] 4 (#$ . 7253)])
(byte-code "\300\301\302\303\304\305\"#\207" [put smtp-connection-opened luna-method-cache make-vector 31 0] 6)
#@33 Close the CONNECTION to server.
(defalias 'smtp-close-connection #[(connection) "\301\302#\207" [connection luna-apply-generic smtp-close-connection] 4 (#$ . 7563)])
(byte-code "\305\306\307\310\311\312\"#\210\313\314\315N\316;\204 \317!\320	\321H\"*\316\307N\n\2035 \322!\2035 \323\324\n\"\210\fM\210\305\325\326#\210+\327\314\315N\306;\204P \317!\320	\321H\"*\306\307N\n\203l \322!\203l \323\330\n\"\210\fM\210\305\325\326#\210+\326\207" [member-name class cache sym func put smtp-close-connection luna-method-cache make-vector 31 0 #[(connection) "\302H\303	!\304>\205 \305)\207" [connection process 2 process-status (open run) t] 2] smtp-connection luna-class smtp-connection-opened symbol-name intern 1 fboundp mapatoms #[(s) "K	J>\205\f \303	\n\"\207" [sym s cache unintern] 3] luna-method-qualifier nil #[(connection) "\302H\303	!)\207" [connection process 2 delete-process] 2] #[(s) "K	J>\205\f \303	\n\"\207" [sym s cache unintern] 3]] 6)
#@44 Return user's fully qualified domain name.
(defalias 'smtp-make-fqdn #[nil "\203 \207\301 \n\203 	\303\nQ\202\" \304\305	\"\203 	\202\" \306\307!)\207" [smtp-fqdn system-name smtp-local-domain "." string-match "[^.]\\.[^.]" error "Cannot generate valid FQDN"] 3 (#$ . 8551)])
#@43 Find the connection delivering to BUFFER.
(defalias 'smtp-find-connection #[(buffer) "	\236\304\211\205 A@\305\n!\203 \n\202 \306	\"\304*\207" [buffer smtp-connection-alist connection entry nil smtp-connection-opened delq] 4 (#$ . 8839)])
(byte-code "\300\301\302\"\210\300\303\302\"\207" [autoload starttls-open-stream "starttls" starttls-negotiate] 3)
#@232 Open a SMTP connection for a service to a host.
Return a newly allocated connection-object.
BUFFER is the buffer to associate with the connection.  SERVER is name
of the host to connect to.  SERVICE is name of the service desired.
(defalias 'smtp-open-connection #[(buffer server service) "\306\307	\n%\310\211\205\" \311\n#\312\313\"\210	\fD\fB\f\f*\207" [smtp-open-connection-function buffer server service connection process binary-funcall "SMTP" nil smtp-make-connection set-process-filter smtp-process-filter smtp-connection-alist] 7 (#$ . 9210)])
(byte-code "\300\301\302\"\210\300\303\302\"\207" [autoload dig-invoke "dig" dig-extract-rr] 3)
(defalias 'smtp-find-mx #[(domain &optional doerror) "\303\304	\305\"\211\203 \306\307\"\210\310\311\"\202, \304	\312\"\203\" 	\202, \n\205, \313\314\315	\"!)\207" [server domain doerror nil smtp-dig "MX" string-match " \\([^ ]*\\)$" match-string 1 "A" error format "SMTP cannot resolve %s"] 4])
(defalias 'smtp-dig #[(domain type) "\303\304	\n\"\211q\210\305	\n\"\306!\210)\207" [dig-buf domain type nil dig-invoke dig-extract-rr kill-buffer] 3])
(defalias 'smtp-find-server #[(recipients) "\212\305\306\"\307\211\211\f\211A@\211\2035 \310\n@\f\"\211\203, \311A\nA\"\241\210\202\f \311	\nC\"\202\f 	-\207" [recipients rlist rets ret rec mapcar #[(recipient) "\302\303\304	\"\203 \305\306\307	\"!\211\203 	CB\202! \310\311\312	\"!)\207" [server recipient nil string-match "@\\([^	\n ]*\\)" smtp-find-mx match-string 1 error format "cannot find server for %s."] 4] nil assoc append] 4])
#@51 Like `smtp-send-buffer', but sucks in any errors.
(defalias 'smtp-via-smtp #[(sender recipients buffer) "\300\301\302\217\207" [nil (byte-code "\303	\n#\210\304\207" [sender recipients buffer smtp-send-buffer t] 4) ((smtp-error))] 3 (#$ . 10785)])
(make-obsolete 'smtp-via-smtp "It's old API.")
#@178 Send a message.
SENDER is an envelope sender address.
RECIPIENTS is a list of envelope recipient addresses.
BUFFER may be a buffer or a buffer name which contains mail message.
(defalias 'smtp-send-buffer #[(sender recipients buffer) "\203\n \306	\n#\207\307\f!\203 \f	\n\"\202 \f\206 \310\311!\312	\n#\2037 \313\2029 \212\314\315\316\"!q\210\317 \210\320 \210\321p!\204W \322p#\210\323\324!\210e!.\207" [smtp-send-by-myself sender recipients buffer smtp-server server smtp-send-buffer-by-myself functionp error "`smtp-server' not defined" smtp-make-package starttls-open-stream get-buffer-create format "*trace of SMTP session to %s*" erase-buffer buffer-disable-undo smtp-find-connection smtp-open-connection make-local-variable smtp-read-point package smtp-starttls-program starttls-program smtp-starttls-extra-args starttls-extra-args smtp-use-starttls smtp-open-connection-function smtp-service smtp-submit-package-function] 4 (#$ . 11088)])
(defalias 'smtp-submit-package #[(package) "\304\216\305!\210\306\307\310\217\210	\203, \311\312p!\313H\236\203$ \314!\210\315!\210\202, \n\204, \316\317!\210\2034 \320!\210\321!\210\322!\210\323!)\207" [package smtp-use-starttls smtp-use-starttls-ignore-error smtp-use-sasl ((byte-code "\302p!\303!\203 \304	!\210\305!\210)\302\207" [connection package smtp-find-connection smtp-connection-opened smtp-primitive-quit smtp-close-connection] 2)) smtp-primitive-greeting nil (smtp-primitive-ehlo package) ((smtp-response-error (smtp-primitive-helo package))) starttls smtp-find-connection 5 smtp-primitive-starttls smtp-primitive-ehlo error "STARTTLS is not supported on this server" smtp-primitive-auth smtp-primitive-mailfrom smtp-primitive-rcptto smtp-primitive-data] 3])
#@188 Send a message by myself.
SENDER is an envelope sender address.
RECIPIENTS is a list of envelope recipient addresses.
BUFFER may be a buffer or a buffer name which contains mail message.
(defalias 'smtp-send-buffer-by-myself #[(sender recipients buffer) "\306!	\203 \307\202\f \n\310\211\211@\205x \211@@)\211@A)\f\203/ \204: \311\312\313\314\315\316#\"!\210\317#\212\320\312\321\f\"!q\210\322 \210\323 \210\324p!\204^ \325p\f#\210\326\327!\210e\310\330!\210+A\211\202 ,\207" [recipients smtp-use-starttls smtp-open-connection-function package server servers smtp-find-server starttls-open-stream nil error format "Cannot send <%s>" mapconcat concat ">,<" smtp-make-package get-buffer-create "*trace of SMTP session to %s*" erase-buffer buffer-disable-undo smtp-find-connection smtp-open-connection make-local-variable smtp-read-point t x sender buffer smtp-service smtp-use-starttls-ignore-error smtp-use-sasl smtp-submit-package-function] 8 (#$ . 12861)])
(defalias 'smtp-primitive-greeting #[(package) "\302p!\303!\211@\304U?\205 \305	!*\207" [connection response smtp-find-connection smtp-read-response 220 smtp-response-error] 3])
(defalias 'smtp-primitive-ehlo #[(package) "\302p!\303\304\305\306\307 \"\"\210\310!\211@\311U\204 \312	!\210\313\314\315	A\"I*\207" [connection response smtp-find-connection nil smtp-send-command format "EHLO %s" smtp-make-fqdn smtp-read-response 250 smtp-response-error 5 mapcar #[(extension) "\302!\211\303	@\227!@\240\210	)\207" [extension extensions split-string read-from-string] 4]] 6])
(defalias 'smtp-primitive-helo #[(package) "\302p!\303\304\305\306\307 \"\"\210\310!\211@\311U?\205 \312	!*\207" [connection response smtp-find-connection nil smtp-send-command format "HELO %s" smtp-make-fqdn smtp-read-response 250 smtp-response-error] 6])
(defalias 'smtp-primitive-auth #[(package) "\306p!\307\310H\236A\n\206 \311	!\312\312\312\312\f\204( \313\314!\210\315\f\316\317H$ \203= \320 \"\210\321\f!\322\312\"\323\324!\203` \325\326\327\324!\330\"#\202e \325\331\"\"\210\332\333\215.\207" [connection mechanisms smtp-sasl-mechanisms sasl-mechanisms mechanism client smtp-find-connection auth 5 sasl-find-mechanism nil error "No authentication mechanism available" sasl-make-client "smtp" 3 sasl-client-set-properties sasl-mechanism-name sasl-next-step smtp-send-command sasl-step-data format "AUTH %s %s" base64-encode-string t "AUTH %s" done (byte-code "\304!\211@\305U\203 \306\n\"\211\204 \307\310\311\"\210\312	!\210	@\313U\204( \312	!\210\314\315	A@!\"\210\306\n\"\316\317!\203G \320\317!\321\"\202H \322\"\210\202  " [connection response client step smtp-read-response 235 sasl-next-step throw done nil smtp-response-error 334 sasl-step-set-data base64-decode-string smtp-send-command sasl-step-data base64-encode-string t ""] 6) name step response smtp-sasl-user-name smtp-sasl-properties] 8])
(defalias 'smtp-primitive-starttls #[(package) "\302p!\303\304\305\"\210\306!\211@\307U\204 \310	!\210\311\312H!*\207" [connection response smtp-find-connection nil smtp-send-command "STARTTLS" smtp-read-response 220 smtp-response-error starttls-negotiate 2] 4])
(defalias 'smtp-primitive-mailfrom #[(package) "\306p!\211\307H\n\310H\311\311\203\" \312	\236\203\" \313\314\315\n!\"\2031 \316	\236\2031 \f\317P\320\f\203? \313\321\f#\202C \313\322\"\"\210\323!\211@\324U?\205T \325!-\207" [connection extensions package sender extension response smtp-find-connection 5 2 nil size format "SIZE=%d" smtp-package-buffer-internal-size 8bitmime " BODY=8BITMIME" smtp-send-command "MAIL FROM:<%s> %s" "MAIL FROM:<%s>" smtp-read-response 250 smtp-response-error smtp-use-size smtp-use-8bitmime] 7])
(defalias 'smtp-primitive-rcptto #[(package) "\304p!	\305H\306\n\205, \307\310\311\n\211A@\"\"\210\312!\211@\313>\204\n \314!\210\202\n +\207" [connection package recipients response smtp-find-connection 3 nil smtp-send-command format "RCPT TO:<%s>" smtp-read-response (250 251) smtp-response-error] 7])
(defalias 'smtp-primitive-data #[(package) "\305p!\306\306\306\307\310\"\210\311!\211@\312U\204 \313	!\210\212\f\314Hq\210\315 eb\210m\204D \316`\306\210`{\"\210\317\320!\210\321\n\"\202* )\307\322\"\210\311!\211@\323U?\205Y \313	!,\207" [connection response def prev package smtp-find-connection nil smtp-send-command "DATA" smtp-read-response 354 smtp-response-error 4 smtp-parse-progress-message-format smtp-send-data beginning-of-line 2 smtp-show-progress-message "." 250] 5])
(defalias 'smtp-primitive-quit #[(package) "\302p!\303\304\305\"\210\306!\211@\307U?\205 \310	!*\207" [connection response smtp-find-connection nil smtp-send-command "QUIT" smtp-read-response 221 smtp-response-error] 4])
(defalias 'smtp-process-filter #[(process output) "\212\302!q\210db\210	c)\207" [process output process-buffer] 2])
(byte-code "\300\301\302\303#\210\300\301\304\305#\210\300\306\302\307#\210\300\306\304\310#\207" [put smtp-error error-message "SMTP error" error-conditions (smtp-error error) smtp-response-error "SMTP response error" (smtp-response-error smtp-error error)] 4)
(defalias 'smtp-response-error #[(response) "\301\302\"\207" [response signal smtp-response-error] 3])
(defalias 'smtp-read-response #[(connection) "\306H\307\310\n\203^ \fb\210\311\310\307#\204# \312\313H!\210\fb\210\202 \203; \f`\313Z{\f`|\210!\261\210)	\f\314\\`\313Z{C\244\f`b\210\315\316!\203 \317\320 !	B\310\211\204\f 	+\207" [connection response response-continue decoder smtp-read-point smtp-end-of-line 7 t nil search-forward accept-process-output 2 4 looking-at "[1-5][0-9][0-9] " read point-marker string] 5])
(defalias 'smtp-send-command #[(connection command) "\212\306H\307H\310\n!q\210db\210\fP\211c\210`	\203\" 	!\311\n\"+\207" [connection encoder process command smtp-end-of-line smtp-read-point 2 6 process-buffer process-send-string] 4])
(defalias 'smtp-send-data #[(connection data) "\305H\306H\307!\310=\203 \311\fQ\202 \fP	\203$ 	!\312\n\"*\207" [connection encoder process data smtp-end-of-line 2 6 string-to-char 46 "." process-send-string] 3])
#@55 Get address list suitable for smtp RCPT TO:<address>.
(defalias 'smtp-deduce-address-list #[(smtp-text-buffer header-start header-end) "\306\307\211\211\310\311!\312\216\212q\210\313\314 \210\212#q\210\315$%\")c\210eb\210\212\316\317%\313#\2037 \320\2029 \321)\316	%\313#\203o \322\306!\210\323\224\324y\210\325\326!\203` `%W\203` \324y\210\202M \327 \f\330\331\n{!Q\202: \314 \210\330\f\332\261\210\333ed\334\335\313%\210\333ed\336\335\313%\210\333ed\337\335\313%\210eb\210\316\340%\313#\203\243 \322\330!\210\202\223 eb\210\307&\316\341d\313#\203\301 \342u\210\324\224\324\225{&B&\202\251 &.\207" [smtp-address-buffer addr-regexp this-line-end this-line simple-address-list case-fold-search "" nil generate-new-buffer " *smtp-mail*" ((kill-buffer smtp-address-buffer)) t erase-buffer buffer-substring-no-properties re-search-forward "^RESENT-TO:" "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)" "^\\(TO:\\|CC:\\|BCC:\\)" replace-match 0 1 looking-at "^[ 	]+" point-marker " " mail-strip-quoted-names "\n" subst-char-in-region 10 32 44 9 "[ 	]+" " \\([^ ]+\\) " -1 smtp-text-buffer header-start header-end recipient-address-list] 6 (#$ . 19059)])
#@159 Parse the `smtp-progress-message-format' variable.
Return nil, or a cons of an ordinary format string and a type including
nil, the symbols `b', `k' and `l'.
(defalias 'smtp-parse-progress-message-format #[nil "\205} \304\305\306\307\n#\203y 	\204k \310\224\203k \304\225\311\312\310\"!\313	\314=\2035 \315\316\317 !P\202c 	\320=\203[ \317 \321Y\203P \322\316\317 \321\\\323\245!\324Q\202c \314\315\316\317 !P\202c \315\316\325ed\"!P\305\211$\202\n \304\225T\313\326\305\211$\202\n 	+B\207" [smtp-progress-message-format type index format 0 nil string-match "%\\([bkl]\\)\\|%\\([^%bkl]\\|\\'\\)" 1 intern match-string replace-match b "%d/" number-to-string buffer-size k 512 "%dk/" 1024 "k" count-lines "%\\&"] 6 (#$ . 20239)])
#@223 Show progress message while sending mails.
DEF is a cons cell which is pre-computed by the
`smtp-parse-progress-message-format' function or nil.
PREV is a number shown last time or nil.
Return a number computed this time.
(defalias 'smtp-show-progress-message #[(def prev) "@\205t @A\211\306=\203 `eZ\2021 \n\307=\203' `eZ\310Z\311\245\2021 \n\312=\2051 \313e`\"\314\203H \203H \n\307=\203H X\204r \315\316!\203a \317\320\203[ \321	\"\202\\ 	\"\210\202r \203m \322	\"\210\202r \322\323	\"\210,\207" [def fmt type value message-log-max prev b k -512 1024 l count-lines nil featurep xemacs display-message no-log format message "%s"] 6 (#$ . 20990)])
(provide 'smtp)
