imap_get_base_subject_cased(): Subject trailers weren't removed correctly. Also cleaned up the code a bit.
imap_get_base_subject_cased(): Subject trailers weren't removed correctly.
Also cleaned up the code a bit.

--HG--
branch : HEAD

jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot