all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Duane Winner <duanewinner@att.net>
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	[thread overview]
Message-ID: <2h_xd.17273$uM5.13591@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: <0hXxd.16785$uM5.7110@bgtnsc05-news.ops.worldnet.att.net>

Duane Winner wrote:
> Bob Babcock wrote:
> 
>> Duane Winner <duanewinner@att.net> wrote in
>> 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	other threads:[~2004-12-21 18:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-19  9:11 How to send a mail using smtp? Jack
2004-12-19 12:29 ` Daniel Pittman
2004-12-19 13:08 ` D P Schreber
2004-12-19 13:43   ` Jack
2004-12-19 14:43     ` D P Schreber
2004-12-20 13:25       ` Jianbo Zhu
2004-12-20 22:02         ` Duane Winner
2004-12-21  6:50           ` Bob Babcock
2004-12-21 15:26             ` Duane Winner
2004-12-21 18:51               ` Duane Winner [this message]
2004-12-21 19:12                 ` How to send a mail using smtp? - solved! (but need help with "Mail From:") Tim McNamara
2004-12-21 19:28                 ` Bob Babcock
2004-12-21 22:48                   ` Kevin Rodgers
2004-12-22  4:25                     ` Bob Babcock
2004-12-22 17:58                       ` Kevin Rodgers
     [not found] ` <mailman.7260.1103461994.27204.help-gnu-emacs@gnu.org>
2004-12-19 16:09   ` How to send a mail using smtp? Tim McNamara
2004-12-19 17:21     ` D P Schreber
2004-12-19 23:04     ` Daniel Pittman
2004-12-20  0:18       ` Daniel Pittman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='2h_xd.17273$uM5.13591@bgtnsc05-news.ops.worldnet.att.net' \
    --to=duanewinner@att.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.