Domanda

I am trying to change my development environment so that any emails sent from my machine through sendmail are redirected to a single address.

I have seen several examples using FEATURE(`virtusertable') like this

@example.com          catch-all@delivery.host.name

but the problem is I want to catch EVERYTHING, not just @example.com, and redirect it to a single address on an external domain (gmail). Currently I have sendmail setup on CentOS 6.5.

So, for example, I want to catch an emails that could be sent to

user@exampleA.com
user@exampleB.com
user@exampleC.com

and redirect them to

dev@myActualServer.com

How do I set sendmail up to do that?

È stato utile?

Soluzione

You may use smart host to catch all outgoing messages (messages to non local mailboxes).

sendmail.mc

dnl Send all no local emails to local email address catch-all 
define(`SMART_HOST',`local:catch-all')

/etc/mail/aliases

# define catch-all alias
catch-all:  johndeveloper1, archive

If you want to send messages to an external account using smtp then use:

define(`SMART_HOST',`esmtp:johndoe1@example.net')

Use LUSER_RELAY to catch messages to non existing local mailboxes in local email domains.

Use MAIl_HUB to catch messages to all local email addresses in local email domains.

More complicated recipes allow to copy all envelope recipient addresses to email headers.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top