When using combination of Postfix/Dovecot, is there a way to tell smtp server (Postfix) not to store mails on disk but hold/add them to queue until "maintenance finished"?
Useful for disk upgrades, volume extensions, chkdisk etc.
I don't believe so; the incoming queue is on disk. Perhaps you could temporarily move the queue to a ramdisk mount?
Do the opposite once you're done.
IMHO that's more trouble than it's worth, especially if something goes screwy in the mv
Just shut down postfix. Any legit sending server will queue your mail and retry after a time delay if it is not able to contact your server. As long as your maintenance is short, say under 6 hours, your chances of losing mail are very small.