Lloyd Zusman | 18 Sep 2006 02:11

Remote sendmail via ssh?

Is there a way to tell Wanderlust to send outgoing mail via a remote
instance of sendmail that is accessed via ssh?  By "remote", I mean that
sendmail is running on a host that is different from the one on which
Wanderlust is running.

Thanks in advance.

--

-- 
 Lloyd Zusman
 ljz <at> asfast.com
 God bless you.

bremner | 18 Sep 2006 02:36
Picon

Re: Remote sendmail via ssh?

>>>>> "Lloyd" == Lloyd Zusman <ljz <at> asfast.com> writes:

    Lloyd> Is there a way to tell Wanderlust to send outgoing mail via
    Lloyd> a remote instance of sendmail that is accessed via ssh?  By
    Lloyd> "remote", I mean that sendmail is running on a host that is
    Lloyd> different from the one on which Wanderlust is running.

Yes, you should be able to adapt the following:

(defvar db-this-host (getenv "HOST") "Name of current host")

(defun db-exec-string (host cmd)
  (cond ((string-equal host db-this-host) cmd )
	(t (concat "ssh " host " " cmd))))

;; Smtp via ssh
(setq smtp-open-connection-function 'smtp-open-shell-stream)
(setq wl-smtp-posting-server "remotehost.remotedomain")
(setq wl-smtp-posting-port 25)

(defun smtp-open-shell-stream (name buffer host service)
  (start-process-shell-command
    name buffer (db-exec-string host "/usr/sbin/exim4 -bs")))

Lloyd Zusman | 18 Sep 2006 02:59

Re: Remote sendmail via ssh?

bremner <at> unb.ca writes:

>>>>>> "Lloyd" == Lloyd Zusman <ljz <at> asfast.com> writes:
>
>     Lloyd> Is there a way to tell Wanderlust to send outgoing mail via
>     Lloyd> a remote instance of sendmail that is accessed via ssh?  By
>     Lloyd> "remote", I mean that sendmail is running on a host that is
>     Lloyd> different from the one on which Wanderlust is running.
>
> Yes, you should be able to adapt the following:
>
> (defvar db-this-host (getenv "HOST") "Name of current host")
>
> (defun db-exec-string (host cmd)
>   (cond ((string-equal host db-this-host) cmd )
> 	(t (concat "ssh " host " " cmd))))
>
> ;; Smtp via ssh
> (setq smtp-open-connection-function 'smtp-open-shell-stream)
> (setq wl-smtp-posting-server "remotehost.remotedomain")
> (setq wl-smtp-posting-port 25)
>
> (defun smtp-open-shell-stream (name buffer host service)
>   (start-process-shell-command
>     name buffer (db-exec-string host "/usr/sbin/exim4 -bs")))

Thank you!

I forgot to mention that I only want to do this within certain folders,
and in the others, to just send outgoing mail via my standard local smtp
(Continue reading)


Gmane