From: Richard G Riley <rileyrgdev@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: SMTP library problem
Date: Sun, 09 Mar 2008 18:26:31 +0100 [thread overview]
Message-ID: <fr16kb$lp7$1@registered.motzarella.org> (raw)
In-Reply-To: mailman.8558.1204987691.18990.help-gnu-emacs@gnu.org
David <de_bb@arcor.de> writes:
> Stephen Berman <Stephen.Berman@gmx.net> writes:
>> Ok, I set smtpmail-default-smtp-server to "localhost" and
>> smtpmail-auth-credentials to '(("localhost" 2000 "myusername"
>> "mypassword")), and indeed it did work -- almost. Since the mail goes
>> through localhost, it gets picked up by the postfix server running on my
>> system.
>
> You local postfix listens on another port (25), so it should not pick up
> the mail. You must have done something wrong in your smtpmail.el
> configuration. Here's how it should work:
>
> (setq smtpmail-default-smtp-server "localhost")
> (setq smtpmail-smtp-service 2000)
> (require 'smtpmail)
> (setq send-mail-function 'smtpmail-send-it)
> (setq message-send-mail-function 'smtpmail-send-it)
> (setq smtpmail-debug-info t)
> (setq smtpmail-auth-credentials
> '(("localhost" 2000 "name" "pass")))
>
> Note that smtp-server and smtp-service are set before the 'require'
> (though I'm not sure if this is still necessary).
>
>> I have postfix configured to relay mail from localhost to
>> another server (mail.gmx.net), which is what I use for most of my
>> email.
>
> I guess you could configure postfix to use different smart hosts
> dependent on the sender address, but I don't know postfix and it's
> OT here anyway.
I use msmtp for this.
,----
| (defun msmtp-change-smtp ()
|
| (setq sendmail-program "/usr/bin/msmtp")
| (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
| (setq smtpmail-smtp-server "smtp.gmail.com")
| (setq message-sendmail-envelope-from 'header)
|
| (if (message-mail-p)
| (save-excursion
| (let* ((from
| (save-restriction
| (message-narrow-to-headers)
| (message-fetch-field "from")))
| (account
| (cond
| ((string-match ".*rileyrgdev.*" from)"rileyrgdev")
*snip*
| ))
| )
| (setq message-sendmail-extra-arguments (list "-a" account))
| )))
| )
|
|
|
| (add-hook 'message-send-hook 'msmtp-change-smtp)
`----
and then, ~/.msmtp
,----
| defaults
| host smtp.gmail.com
| port 587
| auth on
| tls on
| tls_certcheck off
| logfile /tmp/msmtp.log
|
|
| account rileyrgdev
| user rileyrgdev@gmail.com
| password ******
| host myparticular.smtp.host
| from rileyrgdev@gmail.com
|
| ** SNIP**
|
| account default : rileyrgdev
`----
next prev parent reply other threads:[~2008-03-09 17:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 18:09 SMTP library problem James Long
2008-03-05 11:11 ` Stephen Berman
2008-03-05 12:54 ` David
2008-03-05 19:41 ` Stephen Berman
2008-03-05 23:03 ` David
2008-03-06 0:13 ` Stephen Berman
2008-03-06 11:17 ` David
2008-03-07 14:26 ` Stephen Berman
2008-03-07 15:03 ` David
2008-03-07 22:03 ` Stephen Berman
2008-03-08 14:47 ` David
2008-03-08 23:29 ` Stephen Berman
2008-03-09 12:15 ` David
2008-03-09 15:35 ` Stephen Berman
[not found] ` <mailman.8558.1204987691.18990.help-gnu-emacs@gnu.org>
2008-03-09 17:26 ` Richard G Riley [this message]
2008-03-12 20:22 ` SMTP library problem [RESOLVED] Stephen Berman
[not found] <mailman.8306.1204670276.18990.help-gnu-emacs@gnu.org>
2008-03-05 6:42 ` SMTP library problem Volkan YAZICI
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='fr16kb$lp7$1@registered.motzarella.org' \
--to=rileyrgdev@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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.