]> git.madduck.net Git - etc/offlineimap.git/blob - .offlineimap/preauthtunnel.sh

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

c99f59b2bfa839aa83dfed05e37b8d9c8ae23d3e
[etc/offlineimap.git] / .offlineimap / preauthtunnel.sh
1 #!/bin/sh
2
3 unset SSH_AUTH_SOCK
4
5 exec ssh -F ~/.offlineimap/ssh_config -i ~/.offlineimap/${1}.ssh-seckey ${1} \
6   echo -e "Please configure \~/.ssh/authorized_keys on the server and prepend the line with the public key corresponding to the password-less SSH key in ~/.offlineimap/${1}.ssh-seckey :\\\n\\\n  'command=\"MAIL=\$HOME/.maildir /usr/lib/dovecot/imap 2>/dev/null\",no-agent-forwarding,no-X11-forwarding,no-port-forwarding,no-pty'"
7
8 # This relies on the IMAP command being specified on the server side, i.e. in
9 # ~/.ssh/authorized_keys, put a line like the following
10 #
11 #   command="MAIL=$HOME/.maildir /usr/lib/dovecot/imap 2>/dev/null",no-agent-forwarding,no-X11-forwarding,no-port-forwarding,no-pty ssh-ed25519 AAA…
12 #
13 # When a command is specified like this, it overrides the instructions being
14 # passed in the command above. So, when you invoke this script directly, you
15 # should see the IMAP server greet you:
16 #
17 # % ~/.offlineimap/preauthtunnel.sh madduck-net.imap.madduck.net
18 # * PREAUTH [CAPABILITY IMAP4rev1 […]] Logged in as madduck
19