3 Replies Latest reply: Nov 4, 2011 5:35 AM by peak
Beno 44 Level 1 Level 1 (15 points)

How can we forward messages on OSX Lion Server for a user now that this feature has been removed from WGM?

 

Thanks.

Ben

  • peak Level 1 Level 1 (15 points)

    Hi Ben,

     

    I'm missing the easier WGM way of adding forwarding! I don't know why they've through out some of the features they have from the admin GUI - Snow Leopard Admins Tools have been the best so far and this is a backwards step!

     

    // whinge over

     

    To anawer your question:

     

    You'll nee to us the command line and depending on whether this is the server's domain or a virtually hosted domain you'll want either edit the aliases file or virtual file:

     

    For local aliases

     

    # sudo pico /etc/aliases

     

    add your aliases, eg:

     

    mail: shortusernameofrecipent

     

    Exit the file saving changes and then run the command

     

    # sudo newaliases

     

    For virtually hosted emails/domains, assuming you've added the domain in the mail server setting in the admin app (under Advanced, etc).

     

    # sudo nano /etc/postfix/virtual

     

    Scroll down to the end of the file (control-v) then add your email/aliases:

     

    For local delivery:

     

    mail@example.com shortusernameofrecipent

     

    Or

     

    mail@example.com user@isp-domain.com

     

    Exit the file saving changes and then run the command

     

    sudo postfix reload sudo postmap /etc/postfix/virtual

  • LordLobby Level 1 Level 1 (5 points)

    I tried your solution but it doesn't work for me on 10.7.2

     

    I have only one domain configured via server.app, server-admin.app

     

    My accounts have several email addresses with different domains entered into the INFO section in the OD attributes. With this, email for serveal different user/domain combinations is always delivered to the single user inbox.

     

    I took a look into /etc/postfix/main.cf to see, what is used for virtual_alias_maps. In my case this lists: /etc/postfix/virtual_users and this file is empty.

     

    So, I added the redirection into this file in the form off:

     

    user@mydomain.com user1@mydomain.com, user2@mydomain.com

     

    And run: sudo postfix reload sudo postmap /etc/postfix/virtual_users

     

    The mail is still delivered to user@mydomain.com and not forwarded. This is the postfix log I can see:

     

    04.11.11 10:43:07,492 postfix/qmgr: 7617A77DC0B: from=<xyz@gmail.com>, size=3325, nrcpt=1 (queue active)

    04.11.11 10:43:07,503 postfix/smtp: E726B77DC07: to=<user@s1.mydomain.com>, orig_to=<user@mydomain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.76, delays=0.68/0.01/0/0.06, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 7617A77DC0B)

    04.11.11 10:43:07,503 postfix/qmgr: E726B77DC07: removed

     

    04.11.11 10:43:07,544 postfix/pipe: 7617A77DC0B: to=<user@s1.mydomain.com>, relay=dovecot, delay=0.06, delays=0.01/0.01/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)

     

    04.11.11 10:43:07,545 postfix/qmgr: 7617A77DC0B: removed

    04.11.11 10:43:37,561 postfix/smtpd: disconnect from s1.mydomain.com[9.1.1.2]

     

    The single line above is where the stuff is delivered to dovecot I think. But there is no redirection triggered.

     

    Has anybody an idea how to fix this?

  • peak Level 1 Level 1 (15 points)

    Hello LordLobby,

     

    If you've only got one domain running on your server then you can put your aliases in the aliases file, as per my opening comment. They are considered local aliases if it's for the server domain. Virtual aliases are what you use when you have your mail server virtual hosting other domains.

     

    So, if your server has the domain example.com and you want to have the email address multiple@example.com deliver to user1 and user2 then:

     

    nano /etc/postfix/aliases

     

    go down to where it says:

     

    # Put your local aliases here.

     

    the add the line

     

    multiple: user1, user2

     

    OR as another example

     

    multiple: user1, user2@anotherdomain.com

     

    exit and save the file, then run command:

     

    sudo newaliases

     

    One thing I'm un-sure of from your message, you say "My accounts have several email addresses with different domains entered into the INFO section in the OD attributes. With this, email for serveal different user/domain combinations is always delivered to the single user inbox."

     

    There might have been some changes to how apple are using the OD data in Lion which I'm not aware of but looking at your comment it makes me think you've got your mail server recieving mail for more than one domain. If this is the case then you need to make sure those domains are in your Virtual Hosts list in Server Admin > Mail > Advanced > Hosting.

     

    On my server I have the server domain (eg myserver.com) with hostname (eg mail.myserver.com), which of course are in the DNS and then, in the Locally Hosted Virtual Domains I have two other domains (e.g mydomain.co.uk and mydomain.org.uk), which are not in the DNS as DNS is proved elsewhere; and of course Enable virtual hosting is selected.

     

    All users for these virtual domains either have their full email address added as an additional alias (short name) in the Basic tab of the Workgroup manager or are added to the Virtual file.

     

    In Snow Leopard you had to add the email address of a virtual to the short name otherwise the holiday notification didn't work!