Home › Forums › OS X Server and Client Discussion › Mail › 10.4 Tiger – Setup of Virtual Hosts for Mail
- This topic has 6 replies, 4 voices, and was last updated 18 years, 10 months ago by
dduff617.
-
AuthorPosts
-
May 1, 2005 at 5:15 am #361476
Anonymous
GuestI am trying to setup Virtual Hosting for postfix, which was thankfully added to the GUI of Tiger Server.
I have checked the “Enable virtual hosting” box, and added the virtual hosting domains to the list below. (For abstraction purposes, let’s say “virtualsite1.com” and “virtualsite2.com”.)
This has seems to have a few effects:
“/etc/postfix/virtual_domains” is created with the following lines:
virtualsite1.com allow
virtualsite2.com allow“/etc/postfix/virtual_domains” is hashed as “/etc/postfix/virtual_domains.db”.
The following postfix settings are set in main.cf:
virtual_mailbox_domains = hash:/etc/postfix/virtual_domains
virtual_transport = lmtp:unix:/var/imap/socket/lmtpNow, all that’s left to be done, according to Apple’s Documentation (Page 43 of “Mail_Service_v10.4.pdf”):
[QUOTE]
To associate a user to a virtual host using Postfix-style aliases:
1 Add a Virtual Host Name using the directions in section “Adding or Removing Virtual
Hosts” on page 42.
2 Create a file to be used as an alias list in /etc/aliases, if none exists.
3 For each alias, make a line in the file with the following format:
alias@virtualhost:localaddress1,localaddress2,…
For example, if your domain is “example.com” and you are running a virtual host for
“server.com,” and if you want to have the user “bob” get mail sent to
“[email protected],” you should enter:
[email protected]: bob
This will take mail sent to your mail server for [email protected] and send it to
user “bob.” Mail sent to [email protected] will be sent to some other
designated recipient.
4 Save your file changes.
5 In Terminal.app, enter the following command:
postalias /etc/aliases
The text file is processed into a database for faster access.
[/QUOTE]But doing this yields the following error from postalias:
postalias: warning: ../aliases, line 205: name must be local
…and postfix’s own author <http://archives.neohapsis.com/archives/postfix/1999-q4/1061.html> states that “/etc/aliases” is not the appropriate location for a non-local alias:
[QUOTE]
Aliases are used by the LOCAL delivery agent only, so you cannot use the alias map for aliasing a remote address.In order to alias a remote address, use the virtual map instead.
Wietse
[/QUOTE]Is Apple’s documentation just flat out wrong here, or is there a piece of the puzzle missing?
December 20, 2005 at 3:58 pm #364486emailman
ParticipantI have the same question.
I’m at a roadblock trying to get the virtual host addresses mapped to my bound AD users. This wasn’t covered in the AD-OD whitepaper. I’m using a SACL on the Mail service (currently allowing only 1 AD group). Postfix receives mail fine, however it bounces when passing the mail off to Cyrus:
postfix/lmtp[258]: 888E43F2B0: to=
, relay=/var/imap/socket/lmtp[/var/imap/socket/lmtp], delay=39, status=bounced (host /var/imap/socket/lmtp[/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)) December 20, 2005 at 4:02 pm #364487emailman
ParticipantSorry, forgot to encode the angle brackets for the recipient address in the mail log entry I posted.
postfix/lmtp[258]: 888E43F2B0: to=
, relay=/var/imap/socket/lmtp[/var/imap/socket/lmtp], delay=39, status=bounced (host /var/imap/socket/lmtp[/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)) December 20, 2005 at 4:04 pm #364488emailman
ParticipantTake 3…
postfix/lmtp[258]: 888E43F2B0: to=<[email protected]>, relay=/var/imap/socket/lmtp[/var/imap/socket/lmtp], delay=39, status=bounced (host /var/imap/socket/lmtp[/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))
December 22, 2005 at 7:23 pm #364515thinbits
Participant[QUOTE BY= rcr]Is Apple’s documentation just flat out wrong here, or is there a piece of the puzzle missing?
[/QUOTE]Like many things in 10.4. server, Apple is flat out wrong. You need to add some stuff to the main.cf file for this to work as expected…
My config, which run many virtual domains, looks like:
virtual_transport = lmtp:unix:/var/imap/socket/lmtp virtual_mailbox_domains = hash:/etc/postfix/virtual_domains alias_maps = hash:/etc/aliases,hash:/var/mailman/data/aliases virtual_alias_maps = regexp:/etc/postfix/virtual-regexp,hash:/var/mailman/data/virtual-mailman,hash:/e tc/postfix/virtual
I will caveat that by saying I do get the following error in my maillog and I have not taken the time to track it down
warning: do not list domain foo.com in BOTH virtual_alias_domains and virtual_mailbox_domains
Maybe someone knows exactly which file I need to whack to cure that?
Dave
January 13, 2006 at 1:01 am #364754rfn
Participant[QUOTE BY= rcr]
Is Apple’s documentation just flat out wrong here, or is there a piece of the puzzle missing?
[/QUOTE]This made me wonder too the first time I tried it. The documentation is just wrong. You don’t have to edit a lot of files, it’s just the wrong file that they’re referencing.
When you add a domain as a virtual host is should only be listed in virtual hosts in Server Admin. No domains should be listed in both local hosts and virtual hosts.
Then, when the domain is in virtual hosts, you should fire up the terminal and type:
sudo pico /etc/postfix/virtual
In this file you enter the accounts like this:
alias@virtualhost user
As an example, if a user on your system was called bob and was supposed to receive mail for the address [email protected] then you would write:
domain.tld should of course be a domain in the virtual hosts list.
When finished writing all the aliases you type these too commands:
sudo postmap /etc/postfix/virtual
sudo postfix reloadThat’s it. For more information you should read the file /etc/postfix/virtual.default.
June 15, 2006 at 3:22 pm #366424dduff617
Participantapple’s instructions obviously don’t work.
the above instructions did not work for me, either, however.
my system, acted as though the file /etc/postfix/virtual was not being used. i added the alias, ran postmap, told postfix to reload. no worky. mail to the alias i added to virtual was bounced saying no such address exists.
doing some experimentation, i tried adding this line to main.cf:
virtual_alias_maps = hash:/etc/postfix/virtual
and this got things to work — that is, the alias was recognized and all was well.
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed