(defun fs-change-smtp ()
"Change the SMTP server according to the current from line."
(save-excursion
(let ((from
(save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))))
(message "From is `%s', setting `smtpmail-smtp-server' to `%s'"
from
(cond
((string-match "f...@bar.org" from)
;; Use stmp-auth
(message "Using smtp-auth")
;; Sending mail
((....................
....................))
;; Use other server
(message "Using other server")
((.......................
.......................))
(t
(error
(concat "Don't know which mail server to use for
"
from))))))))
; (add-hook 'message-setup-hook 'fs-change-smtp)
(defun fs-change-smtp ()
"Change the SMTP server according to the current from line."
(save-excursion
(let ((from
(save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))))
(message "From is `%s', setting `smtpmail-smtp-server' to `%s'"
from
(cond
((string-match "f...@bar.org" from)
;; Use stmp-auth
(message "Using smtp-auth")
;; Sending mail
((....................
....................))
((string-match "fo...@bar2.org" from)
;; Use other server
(message "Using other server")
((.......................
.......................))
(t
(error
(concat "Don't know which mail server to use for
"
from))))))))
(add-hook 'message-setup-hook 'fs-change-smtp)
For change among smtp servers depending the "from" header, but.....
what abou when I want to send News????, I want to send news with the
from fuck...@foo.com, but this is not defined in the function fs-
change-smtp then I get an "Don't know which mail server to use for ",
how I can fix this?
thanks
> I want to send news with the from fuck...@foo.com,
Please don't.
If you must use an email-adress that isn't yours, use the .invalid
top-level domain.
> how I can fix this?
You could use posting-styles for that; the example in the manual
illustrates a way to do it:
(message-news-p ;; A function symbol
(signature my-news-signature))
See (Info-goto-node "(Gnus)Posting Styles") or
<http://gnus.org/manual/gnus_139.html#SEC139> for the details.
Best regards,
--
"How come we play war and not peace?" Adam Sjøgren
"Too few role models." as...@koldfront.dk
What is this??
>
> > how I can fix this?
>
> You could use posting-styles for that; the example in the manual
> illustrates a way to do it:
>
> (message-news-p ;; A function symbol
> (signature my-news-signature))
>
> See (Info-goto-node "(Gnus)Posting Styles") or
> <http://gnus.org/manual/gnus_139.html#SEC139> for the details.
Which I mean is about the function posted by my, what/how indicate
that the invalid from ( invali...@foo.bar or whatever) must send
mail across newsserver
>> If you must use an email-adress that isn't yours, use the .invalid
>> top-level domain.
> What is this??
<http://www.ietf.org/rfc/rfc2606.txt>
>> See (Info-goto-node "(Gnus)Posting Styles") or
>> <http://gnus.org/manual/gnus_139.html#SEC139> for the details.
> Which I mean is about the function posted by my, what/how indicate
> that the invalid from ( invali...@foo.bar or whatever) must send
> mail across newsserver
I do not understand your question this time around.
You want to specify a from-address that will be used when you write a
news-article, right?
If that is what you want, you can do so by using posting-styles as
explained in the manual; linked to above.
Best regards,
--
"Hey, maybe they could figure out a way to make me Adam Sjøgren
care about how many stop bits I'm using, that'd be as...@koldfront.dk
so retro!"
Nope, I have now configured these in posting styles, which I want is:
Hey I have this on my .gnus file:
;; function that change between smtp servers
(defun fs-change-smtp ()
"Change the SMTP server according to the current from line."
(save-excursion
(let ((from
(save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))))
(message "From is `%s', setting `smtpmail-smtp-server' to `%s'"
from
(cond
((string-match "f...@bar.org" from)
;; Use stmp-auth
(message "Using smtp-auth")
;; Sending mail
((....................
....................))
((string-match "f...@bar2.org" from)
;; Use other server
(message "Using other server")
((.......................
.......................))
(t
(error
(concat "Don't know which mail server to use for
"
from))))))))
(add-hook 'message-setup-hook 'fs-change-smtp)
For change among smtp servers depending the "from" header, but.....
what abou when I want to send News????, I want to send news with the
from fuck-s...@foo.com, but this is not defined in the function fs-
change-smtp then I get an "Don't know which mail server to use for ",
how I can fix this?
thanks
> I want to send news with the from fuck-s...@foo.com, but this is not
> defined in the function fs- change-smtp then I get an "Don't know
> which mail server to use for ",
> how I can fix this?
Define it?
I give up. Your puzzles are too tough.
Best regards,
--
"Be?" Adam Sjøgren
"Be. Be period. Is." as...@koldfront.dk
Replace the `error' in the function above with `message'. Then the
"Dont't know..." message will still be printed, but no erros will be
signalled. That's ok because for news you don't use smtp servers
anyway.
Oh, wait. There's a better solution. Take the function as-is, but add
it to `message-send-mail-hook' instead of `message-setup-hook'.
Bye,
Tassilo
--
My work on free software is motivated by an idealistic goal: spreading
freedom and cooperation. I want to encourage free software to spread,
replacing proprietary software that forbids cooperation, and thus make
our society better. (Richard M. Stallman)