I have been trying to find out if the /etc/aliases file can accept wildcards in the user name
I was hoping that a line like or similiar:
machine*: myaccount
would take any name matching machine* and forward onto the myaccount mailbox.
man aliases didnt really help me nor did I find anything else. Is there a way to pattern match in /etc/aliases with an * or something?
Thanks,
Jerry
Jerry Geis writes:
I have been trying to find out if the /etc/aliases file can accept wildcards in the user name
I was hoping that a line like or similiar:
machine*: myaccount
would take any name matching machine* and forward onto the myaccount mailbox.
man aliases didnt really help me nor did I find anything else. Is there a way to pattern match in /etc/aliases with an * or something?
Not supported. Maybe doable in postfix with header_checks and REDIRECT.
If you control the recipient address on the sending end, you could change it to myaccount+machine@domain and not need the alias.
Or if you know all possible values of machine*, use a script or Makefile to generate a file with all these aliases and :include it in your main aliases file. The disadvantage is this is not maintenance-free.
machine*: myaccount
would take any name matching machine* and forward onto the myaccount mailbox.
Would putting a wildcard in /etc/mail/virtusertable solve the problem?
Neil
-- Neil Aggarwal, (281)846-8957, http://www.JAMMConsulting.com CentOS 5.4 KVM VPS $55/mo, no setup fee, no contract, dedicated 64bit CPU 1GB dedicated RAM, 40GB RAID storage, 500GB/mo premium BW, Zero downtime
On Wed, Oct 28, 2009 at 3:14 AM, Jerry Geis geisj@pagestation.com wrote:
I have been trying to find out if the /etc/aliases file can accept wildcards in the user name
I was hoping that a line like or similiar:
machine*: myaccount
would take any name matching machine* and forward onto the myaccount mailbox.
man aliases didnt really help me nor did I find anything else. Is there a way to pattern match in /etc/aliases with an * or something?
Thanks,
Jerry
I think that it is possible to do this by using postfix and the /etc/postfix/virtual config file.
Regards,
Radu
Jerry Geis wrote:
I have been trying to find out if the /etc/aliases file can accept wildcards in the user name
I was hoping that a line like or similiar:
machine*: myaccount
would take any name matching machine* and forward onto the myaccount mailbox.
man aliases didnt really help me nor did I find anything else. Is there a way to pattern match in /etc/aliases with an * or something?
I don't think this is possible. You can enable getting a copy of bounces to the postmaster account, but the bounce is still delivered to invalid addresses. Or you could use a milter like MimeDefang to alter the destination.