Every now and then, I have a look inside /var/mail and find a few emails that bounced. They are always some automated mails sent out by a CMS (in this case Wordpress) i.e. after a new user signed up that bounced, i.e. the user signed up with a wrong email. They are all sent via phpmail() and the sender is something like "webxxx@myserver" There are very few, I just checked and found 3 from within the last 3 months. I was just wondering what could have gone wrong and why they are ending up in that folder instead of in the proper vmail folders?
Did you take a look into the bounce messages for the reason why the other servers rejected the message? Maybe they thought it was spam and rejected it for that reason, or the recipient address did not exist or its quota was full. There are many reasons why a email gets rejected.
THX Till, but I stated all of that above. The message was bounced because i.e. someone signed up with a wrong email. So its a legitimate bounce but why does it end up inside of /var/mail when all other regular email addresses end up inside /var/vmail? That was the question.
Emails that get send to the hostname of your server ens up in /var/mail,as the hostname of your server is a system account while the accounts in /var/vmail are virtual postfix accounts.
Thanks Till but what would be the easiest way to actually be aware of those emails? Currently I make it a habit to periodically check that folder... Any way to get notified or get them redirected?
You can add something like this to /etc/aliases: web1: [email protected] replace web1 with the web user of the web were you want to forward the adress for and the email address with the target email address. then run: newaliases to apply the changes.