This page describes how Sieve rules can be set up to forward copies of all incoming email from a Sieve-compliant mail server to your Gmail account. These instructions will not work if your mail server is not sieve-enabled.
The examples provided below are used on a Mac OS X Server version 10.5 Leopard. Let's assume that the mail account you want to copy-and-forward to is joebloggs@gmail.com, the mailserver is called mail.example.com, that sieveshell is installed, and that you have your password for your mailserver.
require["fileinto"]; # This line allows us to use the fileinto command
if true { # This tells sieve to apply the following rules to all incoming messages
fileinto "Archive"; # This tells sieve to save copies of all messages to a mailbox called Archive. This can be left at INBOX if you'd prefer
redirect "joebloggs@gmail.com"; # This tells sieve to redirect every incoming message to joebloggs@gmail.com. Obviously, this must be changed to the email address you want to forward to
}
/usr/bin/cyrus/sieve/sieveshell mail.example.com
put sieve.copytogmail.rule
This will let you know if there are any problems with your script.
activate sieve.copytogmail.rule