google

Using gmail to filter spam

In the settings page of your Gmail account:

    1. click on the 'Forwarding and POP/IMAP' tab,

    2. select the 'Forward a copy' radio button in the Forward section,

    3. enter your non-gmail address in the text field

    4. save your changes and you're done.

This changes your Gmail account to forward any email it receives to your main email account. Now you need to make Exim4 forward your email to Gmail. This was surprisingly simple! In the home directory for your mail account create a file called '.forward' and enter the following:

#Exim filter

if $h_x-Forwarded-For: is not "you@gmail.com your.regular@email.com" then

deliver you@gmail.com

endif

All this is doing is delivering any email to your Gmail account unless it contains the header x-Forwarded-For. This is the header Gmail sets when it sends the non-spam emails back to your main account.

Save the file, restart Exim and you're done!