I'm running a server with postfix to handle email sent from a php website.
Email for the domain is handled by another server, however due to the fact that this domain name has been entered in "mydestintion" (main.cf), the web server was using a local relay, rather than sending it through the mail server.
Problem is that the user with name equivalent to the email address does not exist.

Are those emails gone forever or are they stored somewhere?


Most MTAs will go to nearly any end to avoid dropping a message on the floor. Typically a bounce will be generated (either by the receiving MTA, or, for better-behaved MTAs, the receiving MTA will refuse with a 5xx fatal error code and the sending MTA will convert the outbound message into a bounce).

If that bounce is itself undeliverable, the MTA holding onto it will usually send it to the recipient of last resort, which is the local postmaster.

Only if the MTA can't do anything with it - and that usually requires you to actively configure it not to - will it panic, and destroy the message. Even then, you'll usually find a log entry similar to

Oct 24 04:18:57 host sm-mta[4499]: g9N5EwE3004499: Losing q5/qfg9N5EwE3004499: savemail panic
Oct 24 04:18:57 host sm-mta[4499]: g9N5EwE3004499: SYSERR(root): savemail: cannot save rejected email anywhere

So my advice is to start on the system where the mail was generated it, and follow the log entries. This can be quite forensic, and it can often cross several different systems (and if their clocks are not in sync, you will rue the day you decided not to install NTP!) but in the end, all good MTAs keep excellent logs, and once you understand how they're written, they will add up.

Eventually, you'll end up either at a logged panic, or a logged final delivery, often to local mail spool. That doesn't mean the message will still be in spool; someone might have read it, or a cron job tidied it up - but that's not the MTAs fault, nor its problem. While it has your message, the MTA will move heaven and earth to do something with your email, and if you understand how to find out, it'll tell you what it did.

Start with the logs.

  • thank you very much. I have checked the mail.log and mail.err that's how I knew what was happening. I forgot however about /var/spool (Ubuntu). Found all the missing emails in the sending user's folder :) – StrayObject Feb 18 '15 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.