Capillary plugs in horizontal rectangular tubes with non-uniform contact angles