imap-shell-program

imap-shell-program is a variable defined in `imap.el'.
Its value is

("ssh %s imapd" "rsh %s imapd" "ssh %g ssh %s imapd" "rsh %g rsh %s imapd")

  • This variable may be risky if used as a file-local variable.

Documentation:
A list of strings, containing commands for IMAP connection.
Within a string, %s is replaced with the server address, %p with port
number on server, %g with `imap-shell-host', and %l with
`imap-default-user'. The program should read IMAP commands from stdin
and write IMAP response to stdout. Each entry in the list is tried
until a successful connection is made.

You can customize this variable.