9 Replies Latest reply: Feb 8, 2008 11:22 AM by HinckleyScott
HinckleyScott Level 1 Level 1 (0 points)
I am trying to use the "Postfix virtual MAILBOX example: separate domains, non-UNIX accounts" method of configuration from http://www.postfix.org/VIRTUAL_README.html. I am only concentrating on the SMTP side right now, the IMAP side will follow. I am apparently dong something wring because the accounts I have created are coming up as " 550-Mailbox unknown. Either there is no mailbox associated with this 550-name or you do not have authorization to see it."
I have tried with and without first creating the mailbox with a "touch" command.
Adding a user through WGM and giving it mail access works, but is not what I want to do (and it does not seem to place the mailbox for the user in the /var/mail/vhosts heiarchy I created, even though I first added the user to the vmailbox file)

lines from /etc/postfix/main.cf
virtualmailboxdomains = hash:/etc/postfix/virtual_domains
virtualmailboxbase = /var/mail/vhosts
virtualmailboxmaps = hash:/etc/postfix/vmailbox
virtualminimumuid = 100
virtualuidmaps = static:5000
virtualgidmaps = static:5000
virtualaliasmaps = hash:/etc/postfix/virtual
content_filter = smtp-amavis:[]:10024
ownerrequestspecial = no
recipient_delimiter = +
alias_maps = hash:/etc/aliases,hash:/var/mailman/data/aliases
relayhost =
mydestination = $myhostname,localhost.$mydomain,localhost

testdomain.com allow
testdomain2.com allow

HeMoved@testdomain.com HisNewAddress@hotmail.com

user1@testdomain.com testdomain.com/user1
user2@testdomain.com testdomain.com/user2
@testdomain.com testdomain.com/postmaster
user1@testdomain2.com testdomain2.com/user1
user2@testdomain2.com testdomain2.com/user2
@testdomain2.com testdomain2.com/postmaster

Directories created with group and owner set to vmail (which was created as sid/gid 5000)

Output of postconf -n
alias_maps = hash:/etc/aliases,hash:/var/mailman/data/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[]:10024
daemon_directory = /usr/libexec/postfix
debugpeerlevel = 2
defaultdestination_concurrencylimit = 20
enableserveroptions = yes
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
localdestination_concurrencylimit = 2
localrecipientmaps =
luser_relay = postmaster
mail_owner = _postfix
mailboxsizelimit = 0
mailbox_transport = cyrus
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mapsrbldomains =
messagesizelimit = 1047527424
mydestination = $myhostname,localhost.$mydomain,localhost
mydomain = thehinckleys.com
mydomain_fallback = localhost
myhostname = TheServer.thehinckleys.com
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
ownerrequestspecial = no
queue_directory = /private/var/spool/postfix
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost =
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = _postdrop
smtpd_banner = $myhostname ESMTP
smtpdclientrestrictions = permit_mynetworks rejectrblclient cbl.abuseat.org rejectrblclient dnsbl.njabl.org permit
smtpdpw_server_securityoptions = gssapi,cram-md5
smtpdrecipientrestrictions = permitsasl_authenticated,permit_mynetworks,reject_unauthdestination,permit
smtpdsasl_authenable = yes
smtpduse_pwserver = yes
unknownlocal_recipient_rejectcode = 550
virtualaliasmaps = hash:/etc/postfix/virtual
virtualgidmaps = static:5000
virtualmailboxbase = /var/mail/vhosts
virtualmailboxdomains = hash:/etc/postfix/virtual_domains
virtualmailboxmaps = hash:/etc/postfix/vmailbox
virtualminimumuid = 100
virtual_transport = lmtp:unix:/var/imap/socket/lmtp
virtualuidmaps = static:5000

Intel Mac Mini, Mac OS X (10.5.1), 2.0Ghz 2GB RAM 160GB HDD
  • HinckleyScott Level 1 Level 1 (0 points)
    Wherefore art thou Pterobyte?
  • pterobyte Level 6 Level 6 (10,910 points)
    I am glad to help, but am not a personal support assistant Let alone over the weekend.

    Since you don't show any log entries it's hard to tell. I'd say postfix is still trying to deliver to cyrus instead of the local maildrops you created because of "mailbox_transport = cyrus"
  • HinckleyScott Level 1 Level 1 (0 points)
    Fear not, I do not expect a personal support assistant, the plea was to have been light-hearted (thus the Shakespearean English). I just noticed you are amazingly generous with your support and hoped to capture your attention.

    I have much to learn on the integration between Server Admin / postfix / cyrus. I just headed out of town but will post logs next week when I return. In the meantime I'll read up more on what the mailbox_transport line does.

  • pterobyte Level 6 Level 6 (10,910 points)

    I assume you want to go through this hassle so that you can manage mail accounts separate from WGM, correct?

    If so, you may want to consider installing a Postfix version with MySQL support.

  • HinckleyScott Level 1 Level 1 (0 points)
    Wow, over a month since I've had time to tackle this.
    Ok, if I'm planning to check these mail accounts via POP or IMAP I need Cyrus as the transport, right? Or would Cyrus be able to pull from the local maildrops?

    If it can't, am I pretty much stuck with local accounts (per your manual) to make this work, or do I also have to set up the new accounts somehow in cyrus?

    Thank you

    Here is the log from one send attempt
    Jan 16 17:11:52 MyServer postfix/cleanup[7760]: warning: regexp map /etc/postfix/header_checks, line 430: ignoring unrecognized request
    Jan 16 17:11:52 MyServer postfix/pickup[7633]: 82216BC81E: uid=501 from=<me>
    Jan 16 17:11:52 MyServer postfix/cleanup[7760]: 82216BC81E: message-id=<20080117011152.82216BC81E@MyServer.testdomain.com>
    Jan 16 17:11:52 MyServer postfix/qmgr[158]: 82216BC81E: from=<user1@MyServer.testdomain.com>, size=355, nrcpt=1 (queue active)
    Jan 16 17:11:52 MyServer postfix/lmtp[7762]: 82216BC81E: to=<user2@testdomain2.com>, relay=MyServer.testdomain.com[/var/imap/socket/lmtp], delay=0.53, delays=0.16/0.03/0.27/0.06, dsn=5.1.1, status=bounced (host MyServer.testdomain.com[/var/imap/socket/lmtp] said: 550-Mailbox unknown. Either there is no mailbox associated with this 550-name or you do not have authorization to see it. 550 5.1.1 User unknown (in reply to RCPT TO command))
    Jan 16 17:11:53 MyServer postfix/cleanup[7760]: F1A87BC822: message-id=<20080117011152.F1A87BC822@MyServer.testdomain.com>
    Jan 16 17:11:53 MyServer postfix/qmgr[158]: F1A87BC822: from=, size=2604, nrcpt=1 (queue active)
    Jan 16 17:11:53 MyServer postfix/bounce[7766]: 82216BC81E: sender non-delivery notification: F1A87BC822
    Jan 16 17:11:53 MyServer postfix/qmgr[158]: 82216BC81E: removed
    Jan 16 17:11:53 MyServer postfix/pipe[7768]: F1A87BC822: to=<user1@MyServer.testdomain.com>, relay=cyrus, delay=0.31, delays=0.05/0.06/0/0.2, dsn=5.6.0, status=bounced (data format error. Command output: scotthinckley: Mailbox does not exist )
    Jan 16 17:11:53 TheServer postfix/qmgr[158]: F1A87BC822: removed
  • pterobyte Level 6 Level 6 (10,910 points)
    If you set up accounts in WGM there is no need to do anything special in Cyrus.

    Accessing mail via POP/IMAP has nothing to do with where your accounts are stored (WGM, textfile, SQL, etc.)

    Unless you have a good reason for not wanting to create local accounts, I'd say use WGM. If you can't (maybe because you are hosting hundreds of mail only accounts), consider building a Postfix version that allows for MySQL connectivity.
  • HinckleyScott Level 1 Level 1 (0 points)
    Ok, doing the way I would prefer is more complicated than I want to deal with.
    SO... I installed a fresh copy of Tiger Server and grabbed your tutorial.
    Great Tutorial!

    Only 2 questions left now - when using your tutorial method for virtual domains:
    1) For accounts that I want auto-forwarded to an external email do I use the "Forward" option in the "Mail" tab of WGM, or do I use the /etc/postfix/virtual file, or both?
    2) How do I set up a "catch-all" account for one of my domains (I.E. any mail not destined for a known user goes to the catch-all account). Do I create the account in WGM and put an "@mydomain.com" in the secondary name, do I put it in the /etc/postfix/virtual file, or both?

  • pterobyte Level 6 Level 6 (10,910 points)
    1. /etc/postfix/virtual

    2. I would avoid catch all addresses. Mail to unknown users is 99% of the time spam. The few legit mails with misspelled addresses should bounce back to the sender so they know.
    That said, if you must:
    For local domains use "luser_relay" in /etc/postfix/main.cf

    For virtual mail domains, add:
    @mydomain.com poorsap_receving_all_spam_to_unknownusers
    to /etc/postfix/virtual
  • HinckleyScott Level 1 Level 1 (0 points)

    I made a decision that, at the time seemed smart, many years ago with one of my domains.
    Every vendor I gave an email address to got a unique address "vendor@mydomain.com" so that I could track who gave away or sold my address and to make filtering rules easier.
    Unfortunately with the s**tstorm of spam today that turns out to be a bad decision in retrospect as there are many hundreds of those in use and there is no way I can remember them all or want to create accounts for them.
    So, for that one domain, I'm stuck with a catch-all that sees 3k-10k spam emails/day (let's hear it for good bayesian filters).