If a record does not exist set a value
First, the query you have is not valid. I assume you omitted the GROUP BY a.email when posting the question. You also alias foo as c but then you reference to i.total. 
Now for the missing results, it's because you are using (implicit) inner joins. That they are implicit, it doesn't affect results. But when using explicit joins, it's easy to change them from INNER to LEFT join.
So by doing a LEFT JOIN b we keep results from a that have no matching row in b and by doing b LEFT JOIN c we keep results from b that have no matching row in c.
The query finally looks like this (adding COALESCE() so we get zeros and not nulls for the emails that have no account or total):

select a.email, 
       coalesce(sum(c.total), 0) as sum_total
from flags as a
  left join accounts as b
    on a.email = b.email              -- join condition
  left join foo as c
    on b.id = c.account_id            -- join condition
group by a.email ;