
This might be more appropriately directed to msmtp-users, but as there's the following in the ~/.msmtprc that came with grml, I thought I'd check here first.
# use ssh-tunnel # ============== # set up tunnel via ssh: # ssh -l mika -L 9999:your.rootserver.tld:25 user@sshserver.tld -N -f # # host localhost # port 9999
Wanting to tunnel msmtp through ssh, I tried this in my ~/.msmtprc:
from username1@mydomain.net ssh -l john -L 9999:mydomain.net:25 username1@mydomain.net -N -f host localhost port 9999
And in ~/.muttrc : set sendmail="/usr/bin/msmtp"
But got the following error when attempting to send a message:
msmtp: /home/john/.msmtprc: line 25: unknown command ssh
Probably I'm overlooking something(s) obvious regarding the use of ssh and msmtp... Should that ssh command be invoked independently of msmtp somehow, maybe in a wrapper script? Should I be looking at the set_sendmail.sh script?
Any pointers much appreciated.
John

On Thu, Oct 09, 2008 at 02:08:02PM -0700 or thereabouts, John Magolske wrote:
Wanting to tunnel msmtp through ssh, I tried this in my ~/.msmtprc:
from username1@mydomain.net ssh -l john -L 9999:mydomain.net:25 username1@mydomain.net -N -f host localhost port 9999
Don't know if it will help but perhaps you need a preconnect command:
preconnect "ssh -l john -L 9999:mydomain.net:25 username1@mydomain.net -N -f sleep 5"
regards Moss

* John Magolske listmail@b79.net [20081010 00:36]:
This might be more appropriately directed to msmtp-users, but as there's the following in the ~/.msmtprc that came with grml, I thought I'd check here first.
# use ssh-tunnel # ============== # set up tunnel via ssh: # ssh -l mika -L 9999:your.rootserver.tld:25 user@sshserver.tld -N -f # # host localhost # port 9999
Wanting to tunnel msmtp through ssh, I tried this in my ~/.msmtprc:
from username1@mydomain.net ssh -l john -L 9999:mydomain.net:25 username1@mydomain.net -N -f host localhost port 9999
And in ~/.muttrc : set sendmail="/usr/bin/msmtp"
But got the following error when attempting to send a message:
msmtp: /home/john/.msmtprc: line 25: unknown command ssh
Probably I'm overlooking something(s) obvious regarding the use of ssh and msmtp... Should that ssh command be invoked independently of msmtp somehow, maybe in a wrapper script? Should I be looking at the set_sendmail.sh script?
Yes, the ssh command needs to be executed from inside a shell.
I tried to clarify that in grml's ~/.msmtprc now:
http://git.grml.org/?p=grml-etc.git;a=commit;h=65583d0649c308956e68c192d6ca1...
regards, -mika-
Teilnehmer (3)
-
John Magolske
-
Maurice McCarthy
-
Michael Prokop