I apologize i have not included what are all combinations i have tried....none 
worked, all i'm trying to do is
if the key has '#' in it how you query using postmap.



[root@myserv~]# postmap -q "#criticalemail1"@mydomain.com 
/etc/postfix/virtual_users

[root@myserv~]# postmap -q "##criticalemail1"@mydomain.com 
/etc/postfix/virtual_users

[root@myserv~]# postmap -q ""#criticalemail1""@mydomain.com 
/etc/postfix/virtual_users

[root@myserv~]# postmap -q #criticalema...@mydomain.com 
/etc/postfix/virtual_users
postmap: option requires an argument -- q
postmap: fatal: usage: postmap [-Nfinoprsvw] [-c config_dir] [-d key] [-q key] 
[map_type:]file...

[root@myserv~]# postmap -q "#"criticalema...@mydomain.com 
/etc/postfix/virtual_users
postmap: warning: database /etc/postfix/virtual_users.db is older than source 
file /etc/postfix/virtual_users

[root@myserv~]# postmap -q "#"criticalema...@mydomain.com 
/etc/postfix/virtual_users
postmap: warning: database /etc/postfix/virtual_users.db is older than source 
file /etc/postfix/virtual_users

[root@myserv~]# postmap /etc/postfix/virtual_users

[root@myserv~]# postmap -q "#"criticalema...@mydomain.com 
/etc/postfix/virtual_users

[root@myserv~]# postmap -q #criticalema...@mydomain.com 
/etc/postfix/virtual_users
postmap: option requires an argument -- q
postmap: fatal: usage: postmap [-Nfinoprsvw] [-c config_dir] [-d key] [-q key] 
[map_type:]file...

[root@myserv~]# postmap -q ""#criticalemail1""@mydomain.com 
/etc/postfix/virtual_users



Here is my sample virtual_users fragment
"#criticalemail1"@mydomain.com   ms23/007/000/002/106/@mail.dir
"#criticalemail1"@mydomain.another.com  
ms23/007/000/002/106/@mail.dirtestu...@mydomain.com   
ms11/007/000/002/108/@mail.dir





________________________________
From: Jeroen Geilman <jer...@adaptr.nl>
To: postfix-users@postfix.org
Sent: Tuesday, November 15, 2011 5:29 PM
Subject: Re: Special character in email ID


On 2011-11-16 00:20, Justin wrote: 
Thank Jeroen.
>
>
>I have executed the postmap command against the virtual_users, when i issue
>
>
>postmap -q testu...@mydomain.com /etc/postfix/virtual_users it gives me the 
>corresponding maildir value 
No, it does not - since this is a virtual ALIAS map, and not a
    mailbox map.


but when i say
>
>
>postmap -q #criticalema...@mydomain.com/etc/postfix/virtual_users  --- syntax 
>wrong
>
You'd need to quote the address localpart, as per the RFC.



>
>postmap -q "#criticalema...@mydomain.com"/etc/postfix/virtual_users  --- no 
>result
>
Meaning no match was found.



>
>postmap -q ""#criticalema...@mydomain.com""/etc/postfix/virtual_users  --- no 
>result
>
Meaning no match was found.



>
>
>
>Now the question boils down to how to give escape characters in this case to 
>query the map??
>
The first example - double qoutes - will work fine.

I am still unclear what it is you want to achieve with all this; it
    is difficult to advise you to do anything until you explain this.



-- 
J.

Reply via email to