First, a description of what I'm trying to do here:
Incoming mail should be directed to a script (PHP, specifically, but it shouldn't matter)
- Afterwards, the mail should be discarded (not sent further)
- This goes for all incoming mail, regardless of what the destination is
- Domains are not related (and are in fact random), just using a random sequence of letters/numbers for the domain name and address; keeping a list of these is inefficient and likely not possible
Outgoing mail (from the local system only; no relaying outside mail) should be sent on normally
As an example, if our server receives an email for example@example.org
, it should pass that e-mail to a script and then discard it.
The question How do I get Postfix to deliver ALL mail to a custom script? seems to cover part of the first dot, but the current major stumbling block is accepting mail from all domains. When I try to send mail right now, I get rejected with a "Relaying access denied" error.
All of the information I've seen so far only mentions using wildcards like "@domain.com
", which isn't very useful. I've been searching around and so far can't find anything that explains how to do it to someone who hasn't messed with Postfix before (and nobody can confirm that they're working in the first place, as the answers weren't accepted).