Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* changing smtp server?
@ 2007-08-10 17:31 someusernamehere
  2007-08-10 17:54 ` Adam Sjøgren
  0 siblings, 1 reply; 8+ messages in thread
From: someusernamehere @ 2007-08-10 17:31 UTC (permalink / raw)
  To: info-gnus-english

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 "foo@bar.org" from)
                  ;; Use stmp-auth
                  (message "Using smtp-auth")
                   ;; Sending mail
                   ((....................
                      ....................))
                   ((string-match "foo2@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-spam@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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: changing smtp server?
  2007-08-10 17:31 changing smtp server? someusernamehere
@ 2007-08-10 17:54 ` Adam Sjøgren
  2007-08-10 17:59   ` someusernamehere
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Sjøgren @ 2007-08-10 17:54 UTC (permalink / raw)
  To: info-gnus-english

On Fri, 10 Aug 2007 17:31:26 -0000, someusernamehere wrote:

> I want to send news with the from fuck-spam@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."                                  asjo@koldfront.dk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: changing smtp server?
  2007-08-10 17:54 ` Adam Sjøgren
@ 2007-08-10 17:59   ` someusernamehere
  2007-08-10 18:06     ` Adam Sjøgren
  0 siblings, 1 reply; 8+ messages in thread
From: someusernamehere @ 2007-08-10 17:59 UTC (permalink / raw)
  To: info-gnus-english

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 828 bytes --]

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 ( invalid-from@foo.bar or whatever)  must send
mail across newsserver

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: changing smtp server?
  2007-08-10 17:59   ` someusernamehere
@ 2007-08-10 18:06     ` Adam Sjøgren
  2007-08-10 18:22       ` someusernamehere
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Sjøgren @ 2007-08-10 18:06 UTC (permalink / raw)
  To: info-gnus-english

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-from@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     asjo@koldfront.dk
  so retro!"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: changing smtp server?
  2007-08-10 18:06     ` Adam Sjøgren
@ 2007-08-10 18:22       ` someusernamehere
  2007-08-10 19:02         ` Adam Sjøgren
  2007-08-10 19:37         ` Tassilo Horn
  0 siblings, 2 replies; 8+ messages in thread
From: someusernamehere @ 2007-08-10 18:22 UTC (permalink / raw)
  To: info-gnus-english

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2291 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: changing smtp server?
  2007-08-10 18:22       ` someusernamehere
@ 2007-08-10 19:02         ` Adam Sjøgren
  2007-08-10 19:37         ` Tassilo Horn
  1 sibling, 0 replies; 8+ messages in thread
From: Adam Sjøgren @ 2007-08-10 19:02 UTC (permalink / raw)
  To: info-gnus-english

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."                                    asjo@koldfront.dk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: changing smtp server?
  2007-08-10 18:22       ` someusernamehere
  2007-08-10 19:02         ` Adam Sjøgren
@ 2007-08-10 19:37         ` Tassilo Horn
  1 sibling, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2007-08-10 19:37 UTC (permalink / raw)
  To: info-gnus-english

someusernamehere <someusernamehere@gmail.com> writes:

> (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?

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)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* changing smtp server?
@ 2007-08-10 17:28 someusernamehere
  0 siblings, 0 replies; 8+ messages in thread
From: someusernamehere @ 2007-08-10 17:28 UTC (permalink / raw)
  To: info-gnus-english

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 "foo@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)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-08-10 19:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-10 17:31 changing smtp server? someusernamehere
2007-08-10 17:54 ` Adam Sjøgren
2007-08-10 17:59   ` someusernamehere
2007-08-10 18:06     ` Adam Sjøgren
2007-08-10 18:22       ` someusernamehere
2007-08-10 19:02         ` Adam Sjøgren
2007-08-10 19:37         ` Tassilo Horn
  -- strict thread matches above, loose matches on Subject: below --
2007-08-10 17:28 someusernamehere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).