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
* 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).