-1

I've just setup my first virtual mailbox in Postfix. I wonder if it is possible to have two mailboxes on the same server, one virtual and one with shell account, within the same domain?

[email protected] => goes to /home/first/..
[email protected] => goes to /var/spool/mail/virtual/..

What I need is to forward emails using .forward file and it is possible only for shell accounts and not virtual mailboxes. So I need to have both types of mailboxes, one to store and one to forward.

The problem I have is that when I add mydomain.com to mydestination list, no email is saved within virtual mailboxes. And ThunderBird prompts:

An error occurred while sending mail. The mail server responded:  5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table. Please check the message recipient [email protected] and try again.

[UPDATE]

Here's what I've done so far without success:

My /etc/postfix/main.cf:

mydestination = localhost
virtual_mailbox_domains = mydomain.com
virtual_alias_maps = hash:/etc/postfix/valias
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

My /etc/postfix/valias:

shell_account shell_account@localhost

My /etc/postfix/vmailbox:

[email protected] mydomain.com/virtual/

And then I've run postmap /etc/postfix/valias, postmap /etc/postfix/vmailbox and finally postfix reload. And since I'm using Courier as for IMAP server, userdb -show shows:

virtual

But when I try to send an email to [email protected], Thunderbird prompts:

An error occurred while sending mail. The mail server responded:  5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual mailbox table. Please check the message recipient [email protected] and try again.

[UPDATE]

And here's my mail.log:

postfix/smtpd[10098]: connect from localhost[127.0.0.1]
postfix/smtpd[10098]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual mailbox table; from=<mehran@localhost> to=<[email protected]> proto=ESMTP helo=<[127.0.0.1]>
postfix/smtpd[10098]: disconnect from localhost[127.0.0.1]
2
  • 1
    Yes. Read the docs at postfix.org.
    – Jenny D
    May 11, 2014 at 11:58
  • I'm not saying that I've read it completely. But I'm not a foreigner to it either. The problem is that when I put mydomain.com in mydestination, then no email is stored in virtual mailboxes ending with mydomain.com! A pointer to the right direction is greatly appreciated.
    – Mehran
    May 11, 2014 at 12:16

1 Answer 1

1

Well, I don't know this satisfied your need or not. Suppose

mydestination = local.mydomain.com
virtual_mailbox_domains = mydomain.com

Then add the alias on your virtual_alias_maps

virtual_alias_maps = hash:/etc/postfix/virtual_alias

Content of /etc/postfix/virtual_alias (updated)

[email protected] second

The idea is generate alias from your virtual_mailbox domains to local domain because .forward only works on local domain.

References: postfix.org

4
  • Thanks for the suggestion but it didn't work. I've updated the question, would you please take a look at it?
    – Mehran
    May 12, 2014 at 7:32
  • What's the error says in maillog file?
    – masegaloeh
    May 12, 2014 at 7:40
  • I've updated the question with logs.
    – Mehran
    May 12, 2014 at 8:42
  • I found the problem, I needed to write [email protected] first in virtual_alias. Thanks.
    – Mehran
    May 12, 2014 at 10:25

Not the answer you're looking for? Browse other questions tagged .