Any modifications that would result in a situation like the one here
searched for (that is, one user whose only active redirection is
"imap") must have the action of his imap redirection changed to
"imap_and_bounce".
modified: 01_new_mail.sql
new file: 02_imap_and_bounce.sql
'let_spams',
'tag_and_drop_spams',
'tag_spams',
+ 'imap_and_bounce',
'homonym')
NOT NULL DEFAULT 'default',
broken DATE NOT NULL DEFAULT '0000-00-00',
'let_spams',
'tag_and_drop_spams',
'tag_spams',
+ 'imap_and_bounce',
'homonym')
NOT NULL DEFAULT 'default',
KEY (hrmid),
--- /dev/null
+UPDATE email_redirect_account AS e,
+ (SELECT IF( SUM(IF(type!='imap',1,0))=0, 'imap_only', 'normal' ) AS status, uid
+ FROM email_redirect_account
+ WHERE flags = 'active'
+ GROUP BY uid) AS sub
+ SET e.action='imap_and_bounce'
+ WHERE sub.status='imap_only'
+ AND sub.uid = e.uid
+ AND type='imap';
+