-2

I have one postfix mail server (postfix-2.10.1-6.el7.x86_64) under CentOS7.

Now, our App Department is using it to send sms'es via email.

To: [email protected] To: [email protected] To: [email protected] To: [email protected] To: [email protected] To: [email protected]

And I'd like to do the following:

Whenever the postfix receives such emails (To: [[:digit:]]@domain.tld), I'd like to do the following:

  1. To copy to a local mail box for my further processing, maintaining To: and Body of the message.
  2. To discard the mails, without further processing such as relay to external internet relay coz it will anyway fail the delivery and the relay server will bounce back.

Please advise.

Will

1
  • Totally possible, but SF is not a place where you get tutorials on demand. We help on specific questions.
    – sebix
    Apr 18, 2015 at 12:45

1 Answer 1

1

Thanks. Not so familiar yet with the SF Eco System.

TMI on SF and on the Internet about trying to achieve what I want and after spending a day or two or three researching and hacking, I have fairly got it all sorted out.

\-----

  1. virtual_alias_maps

[root@gateway1 postfix]# cat main.cf | grep virtual.regexp

virtual_alias_maps = hash:/etc/postfix/virtual,regexp:/etc/postfix/virtual.regexp

[root@gateway1 postfix]# cat virtual.regexp

/^(999[0-9]+)@domain.tld/ [email protected]

  1. transport (to deliver mails locally!)

[root@gateway1 postfix]# cat transport | tail -n 1

/[email protected]$/ local:

[root@gateway1 postfix]# cat master.cf | grep local

local unix - n n - - local

-----\

I hope this should make up for my bad start.

Cheers. W

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .