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
lhecking at users.sourceforge.net
2009-Oct-28 12:53 UTC
[CentOS] /etc/aliases file wildcard
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 at 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.
On Wed, Oct 28, 2009 at 3:14 AM, Jerry Geis <geisj at 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, > > JerryI 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. -- Les Mikesell lesmikesell at gmail.com
Possibly Parallel Threads
- Problems Converting from Cyrus to Dovecot (cyrus2dovecot)
- deliver stopped working
- Problems Converting from Cyrus to Dovecot (cyrus2dovecot)
- krb5_auth: NT_STATUS_NO_LOGON_SERVERS for users from trusted AD domains in samba winbind > 4.2
- Problems Converting from Cyrus to Dovecot (cyrus2dovecot)