From: Charles Marcus on
On 2010-06-30 6:07 PM, David Touzeau wrote:
> dear I know this is not a good idea but this is for an internal server
> in order to auto-create mailboxes.
> A script parse the catch-all mailbox and create the appropriate mailbox

I have to ask... why? What is the purpose of creating these mailboxes?

--

Best regards,

Charles

From: =?ISO-8859-1?Q?Markus_Sch=F6nhaber?= on
01.07.2010 00:07, David Touzeau:

> dear I know this is not a good idea but this is for an internal server
> in order to auto-create mailboxes.
> A script parse the catch-all mailbox and create the appropriate mailbox
>
> THe behavior is when i send mail to users1(a)domain.tld the catch-all
> take the hand and all mails are transfered to it noexistant(a)domain.tld

Which then creates the users1(a)domain.tld mailbox?
If so, and if I understand correctly, after users1(a)domain.tld was
created and someone wants to send a mail to this new account but
mis-types the address, for example user1(a)domain.tld, the (potential)
recipient won't get the message but rather the account user1(a)domain.tld
will be created. Moreover, the sender won't be notified that he sent
mail to a non-existent address.

> so i have 2 choices :
>
> enable catch-all but all mail going trough the catch-all mailbox
>
> disable catch-all and forgot the script...

No, you have more choices. Among them are

3. Instead of a catch-all, use a single fixed account for sending
mailbox creation requests to in combination with + addressing.
For example, use createmb(a)domain.tld as the account requests are sent
to, and, if you want to create the users1(a)domain.tld account, send a
mail to createmb+users1(a)domain.tld.

4. Choose from the many mail management solutions that already exist.

--
Regards
mks

From: David Touzeau on

Thanks for this information markus

I would like to know if for this kind of virtual maps

users1(a)domain.tld users1(a)domain.tld
users2(a)domain.tld users2(a)domain.tld
users3(a)domain.tld users3(a)domain.tld
@domain.tld noexistant(a)domain.tld

when i send an email to users1(a)domain.tld postfix send to
noexistant(a)domain.tld

when i send an email to users2(a)domain.tld postfix send to
noexistant(a)domain.tld

when i send an email to users3(a)domain.tld postfix send to
noexistant(a)domain.tl

when i send an email to anonymous(a)domain.tld postfix send to
noexistant(a)domain.tld

is it a normal behavior that postfix send all mails to catch-all even
the email address is existent in the hash table ?



On 01/07/2010 09:52, Markus Sch�nhaber wrote:
> 01.07.2010 00:07, David Touzeau:
>
>> dear I know this is not a good idea but this is for an internal server
>> in order to auto-create mailboxes.
>> A script parse the catch-all mailbox and create the appropriate mailbox
>>
>> THe behavior is when i send mail to users1(a)domain.tld the catch-all
>> take the hand and all mails are transfered to it noexistant(a)domain.tld
>
> Which then creates the users1(a)domain.tld mailbox?
> If so, and if I understand correctly, after users1(a)domain.tld was
> created and someone wants to send a mail to this new account but
> mis-types the address, for example user1(a)domain.tld, the (potential)
> recipient won't get the message but rather the account user1(a)domain.tld
> will be created. Moreover, the sender won't be notified that he sent
> mail to a non-existent address.
>
>> so i have 2 choices :
>>
>> enable catch-all but all mail going trough the catch-all mailbox
>>
>> disable catch-all and forgot the script...
>
> No, you have more choices. Among them are
>
> 3. Instead of a catch-all, use a single fixed account for sending
> mailbox creation requests to in combination with + addressing.
> For example, use createmb(a)domain.tld as the account requests are sent
> to, and, if you want to create the users1(a)domain.tld account, send a
> mail to createmb+users1(a)domain.tld.
>
> 4. Choose from the many mail management solutions that already exist.
>

From: =?ISO-8859-1?Q?Markus_Sch=F6nhaber?= on
01.07.2010 10:49, David Touzeau:

> I would like to know if for this kind of virtual maps
>
> users1(a)domain.tld users1(a)domain.tld
> users2(a)domain.tld users2(a)domain.tld
> users3(a)domain.tld users3(a)domain.tld
> @domain.tld noexistant(a)domain.tld
>
> when i send an email to users1(a)domain.tld postfix send to
> noexistant(a)domain.tld
>
> when i send an email to users2(a)domain.tld postfix send to
> noexistant(a)domain.tld
>
> when i send an email to users3(a)domain.tld postfix send to
> noexistant(a)domain.tl
>
> when i send an email to anonymous(a)domain.tld postfix send to
> noexistant(a)domain.tld
>
> is it a normal behavior that postfix send all mails to catch-all even
> the email address is existent in the hash table ?

No. Look at
man 5 virtual

Did you postmap the table?
If you did, provide the output of
postconf -n
Otherwise it's hard to tell what is wrong.

Nevertheless, I'd strongly recommend that you get rid of the catch-all.

--
Regards
mks

From: zhong ming wu on
On Wed, Jun 30, 2010 at 9:39 AM, David Touzeau <david(a)touzeau.eu> wrote:
> Dear
>
> I would like to redirect messages that recipient are not listed in aliases
> to a single mailbox
>
> have set
>
> virtual_alias_maps=hash:/etc/postfix/virtual
>
> users1(a)domain.tld users1(a)domain.tld
> users2(a)domain.tld users2(a)domain.tld
> users3(a)domain.tld users3(a)domain.tld
> @domain.tld noexistant(a)domain.tld
>
> is there is way to do this ?

Maybe that's not what you want but look into regex map; it's
documented properly.
I use that map in a QC machine which must not send any outgoing emails
to any domains.
(Only local port is open FYI)


From memory that map looks sthing like

virtual domain map:

/(.*)/ :ACCEPT

virtual mailbox map:

/(.*)/ :mailtrap