Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In my virtusertable I have the following entry:

@fax.mydomain.com mail2fax.sh

Now I also want to forward all the inbound mail to another external domain while keeping my current setup, so I did this :

@fax.mydomain.com mail2fax.sh
@fax.mydomain.com @externaldomain.com

But when doing makemap hash virtusertable.db < virtusertable this error appears :

makemap: virtusertable.db: line 2: key @fax.mydomain.com: duplicate key

The destination mails will be random fax numbers like 0044555441122@fax.mydomain.com so I can't use username based forwarding.

So I guess it is not possible to have duplicate entries for the inbound domain. How would you do it ?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You cannot have a double key entry in virtusertable. You can do what you want for specific accounts by using both virtusertabe and aliases:

In virtusertable:

user1@fax.mydomain.com user1-fax

In aliases:

user1-fax: user1@externaldomain.com, "|mail2fax.sh"

Now run make virtusertable and newaliases and you are all set.


Since the FAX numbers change rapidly, you can try installing MIMEDefang and call add_recipient() from within the filter_recipient function. This way you can add and delete the local and external recipients that you need. You may need to modify mail2fax.sh too.

share|improve this answer
I can't do that since users are not really usernames but fax numbers, so I can't really specify usernames. I will update my question. –  drcelus Jul 23 '12 at 5:39
Usage of the word "user" is liberal here. If the FAX numbers are fixed and do not change rapidly over time, the proposed solution holds. If the word "user" bothers you, replace it with "number" and your are set. –  adamo Jul 23 '12 at 7:03
I mean that fax numbers are not fixed, they change on a daily basis. –  drcelus Jul 23 '12 at 10:24
Updated my answer with one more suggestion. –  adamo Jul 23 '12 at 11:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.