please help! outgoing emails are sent to myself. What are the ways to fix it?
One way is to reinstall mailinabox, following the directions carefully. Sounds like something got really messed up.
Did you make any customizations to your box? Got any more info to share?
The first step would be to closely monitor the log files:
tail -f /var/log/mail.log
and then send some mails and see what happens.
I assume you have tried it with many different recipient addresses/domains, to see if all recipient domains are affected? By “sent to myself”, you mean that all mails are delivered locally to a mailbox, rather than sent out via SMTP?
It sounds a bit like postfix on your box is configured to treat all domains as local/virtual domains, together with a catch-all entry.
To give any further advice, one would need to know all the exact steps that you took to get your box into this state. Then one would need to see your postfix configuration (mainly /etc/postfix/main.cf and /etc/postfix/master.cf, for starters), and a dump of the user-DB or at least a screenshot of your MIAB user/alias-configuration.