- if (my $wm = $ibx->{watchheader}) {
- my ($k, $v) = split(/:/, $wm, 2);
- $ibx->{-watchheader} = [ $k, qr/\Q$v\E/ ];
+ my $watch_hdrs = [];
+ if (my $whs = $ibx->{watchheader}) {
+ for (@$whs) {
+ my ($k, $v) = split(/:/, $_, 2);
+ push @$watch_hdrs, [ $k, qr/\Q$v\E/ ];
+ }
+ }
+ if (my $list_ids = $ibx->{listid}) {
+ for (@$list_ids) {
+ my $re = qr/<[ \t]*\Q$_\E[ \t]*>/;
+ push @$watch_hdrs, ['List-Id', $re ];
+ }
+ }
+ if (scalar @$watch_hdrs) {
+ $ibx->{-watchheaders} = $watch_hdrs;