help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to send a mail using smtp? - solved! (but need help with "Mail F


From: Duane Winner
Subject: Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
Date: Tue, 21 Dec 2004 18:51:42 GMT
User-agent: Mozilla Thunderbird 1.0 (X11/20041210)

Duane Winner wrote:
Bob Babcock wrote:

Duane Winner <duanewinner@att.net> wrote in
41C74C31.8040305@att.net:">news:41C74C31.8040305@att.net:

I have been trying to get smtpmail to work with authentication, and
have been having the same problem.



I was told that a newer version of smtpmail.el was necessary to get this to work. I think the version that worked came from http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mail/


I grabbed this and put it in /usr/local/share/emacs/21.3/lisp/mail/smtpmail.el (replacing current version).

Still have the problem, though.


OK -- good news: I got authentication working with smtpmail.el -- I didn't realize that I needed to byte-compile smtpmail.el. I am now connecting to my ISP's smtp server and successfully authenticating and sending.

But now I am having a problem with the "From:" format. All of my outbound emails are addressed as "From: me@localhost" instead of being rewritten the proper user@domain (myaccount@myisp.net)

First, how I got authentication working:

1. Download the latest smtpmail.el from:
http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mail/
to a temporary directory to which you have read/write privs.

2. In emacs, type:
M-x byte-compile-file <RETURN>
Enter <path-to>/smtpmail.el

3. Now have an smtpmail.el and smtpmail.elc. Copy them to /usr/local/share/emacs/21.3/lisp/mail
(This is my path on FreeBSD 5.2.1 -- change to your correct path).

4. My obfuscated .emacs:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Please add these lines in your .emacs(_emacs) or use customize.
;;
(setq send-mail-function 'smtpmail-send-it) ; if you use `mail'
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-default-smtp-server "localhost")
(setq smtpmail-smtp-service 465)
(setq smtpmail-local-domain "att.net")
(setq smtpmail-sendto-domain "att.net")
(setq smtpmail-debug-info t)
(setq smtpmail-debug-verb t)
(setq smtpmail-auth-credentials
      '(("localhost" 465 "myaccountname" "mypassword")))
;;(setq smtpmail-starttls-credentials
;;      '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert")))
;; Where the 25 equals the value of `smtpmail-smtp-service', it can be an
;; integer or a string, just as long as they match (eq).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Note I am going to localhost on port 465 -- this is because my ISP uses SSL. I am using an stunnel connection from my localhost:465 to myisp:465. Next step: see if smtpmail-startttls-credentials works so I don't have to use stunnel.

5. My debug output:

MAIL FROM:<dwinner@localhost> SIZE=212^M
250 ok^M
RCPT TO:<duanewinner@att.net>^M
250 ok^M
DATA^M
354 ok^M
Date: 21 Dec 2004 13:44:29 -0500^M
Message-ID: <86d5x3ze2a. fsf@localhost>^M
From: Duane Winner <dwinner@localhost>^M
To: duanewinner@att.net^M
Subject: test #328^M
^M
more test stuff^M
from me^M
.^M
250 ok ; id=2004122118443011100j8luue^M
QUIT^M
221 myisp.isp.net^M


6. So now my only problem is controlling the "MAIL FROM:" and "From:" fields so that they return "myispaccountname@myisp.domain.net" instead of "mylocalaccountname@mylocalhost".

Any ideas?

Thanks again,
Duane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]