Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

changing smtp server?

0 views
Skip to first unread message

someusernamehere

unread,
Aug 10, 2007, 1:28:29 PM8/10/07
to
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
((....................
....................))

;; 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)

someusernamehere

unread,
Aug 10, 2007, 1:31:26 PM8/10/07
to
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 "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

Adam Sjøgren

unread,
Aug 10, 2007, 1:54:41 PM8/10/07
to
On Fri, 10 Aug 2007 17:31:26 -0000, someusernamehere wrote:

> 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

someusernamehere

unread,
Aug 10, 2007, 1:59:14 PM8/10/07
to
On 10 ago, 12:54, a...@koldfront.dk (Adam Sjøgren) wrote:
> On Fri, 10 Aug 2007 17:31:26 -0000, someusernamehere wrote:
> > I want to send news with the from fuck-s...@foo.com,

>
> Please don't.
>
> If you must use an email-adress that isn't yours, use the .invalid
> top-level domain.

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

Adam Sjøgren

unread,
Aug 10, 2007, 2:06:58 PM8/10/07
to
On Fri, 10 Aug 2007 17:59:14 -0000, someusernamehere wrote:

>> 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!"

someusernamehere

unread,
Aug 10, 2007, 2:22:27 PM8/10/07
to
On 10 ago, 13:06, a...@koldfront.dk (Adam Sjøgren) wrote:
> On Fri, 10 Aug 2007 17:59:14 -0000, someusernamehere wrote:
> >> 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 ( invalid-f...@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?
>


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

Adam Sjøgren

unread,
Aug 10, 2007, 3:02:56 PM8/10/07
to
On Fri, 10 Aug 2007 18:22:27 -0000, someusernamehere wrote:

> 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

Tassilo Horn

unread,
Aug 10, 2007, 3:37:50 PM8/10/07
to info-gnu...@gnu.org
someusernamehere <someuser...@gmail.com> writes:

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)

0 new messages