Find the answer to your Linux question:
Results 1 to 5 of 5
Hello Forum: I need to tell postfix to send email sent to one email address to another email address. What I really need to do is tell postfix that every ...
  1. #1
    Linux Newbie
    Join Date
    Jun 2008
    Location
    Georgia, USA
    Posts
    117

    redirect postfix email address

    Hello Forum:

    I need to tell postfix to send email sent to one email address to another email address.

    What I really need to do is tell postfix that every email sent to


    dbsupport@thisdomain.com
    and
    helpdesk@thisdomain.com

    be sent to admins@thatdomain.com



    I tried transport maps like this:


    dbsupport@thisdomain.com smtp:admins@thatdomain.com

    helpdesk@thisdomain.com smtp:admins@thatdomain.com

    but that did not work.




    I then tried canonical maps like this:

    recipient_canonical file:

    /^((dbsupport|helpdesk).*)thisdomain[.]com$/ admins@thatdomain.com



    sender_canonical file:

    /^(.*@).*thisdomain[.]com$/ ${1}thatdomain.com

    but it did not work either.

    I am really exhausted and I need to find a solution for this one since it is my boss asking me to get this working.

    This is what if in /var/log/mail in box1:


    Dec 28 16:10:25 box1 postfix/pickup[19291]: 54D258F726: uid=0 from=<root>
    Dec 28 16:10:25 box1 postfix/cleanup[23489]: 54D258F726: message-id=<4D1A5241.mailIBZ11LRR6@box1.thisdomain.com>

    Dec 28 16:10:25 box1 postfix/qmgr[4846]: 54D258F726: from=<root@box1.thisdomain.com>, size=438, nrcpt=1 (queue active)
    Dec 28 16:10:25 appatl7 postfix/cleanup[23489]: 5CE3E8E133: message-id=<4D1A5241.mailIBZ11LRR6@box1.thisdomain.com>

    Dec 28 16:10:25 box1 postfix/local[23766]: 54D258F726: to=<root@box1.thisdomain.com>, orig_to=<root>, relay=local, delay=0, status=sent (forwarded as 5CE3E8E133)
    Dec 28 16:10:25 box1 postfix/qmgr[4846]: 5CE3E8E133: from=<root@box1.thisdomain.com>, size=596, nrcpt=1 (queue active)
    Dec 28 16:10:25 box1 postfix/qmgr[4846]: 54D258F726: removed

    Dec 28 16:10:25 box1 postfix/smtp[23492]: 5CE3E8E133: to=<helpdesk@thisdomain.com>, orig_to=<root>, relay=box2mail.thisdomain.com[10.10.2.75], delay=0, status=sent (250 2.0.0 Ok: queued as 8500358075)
    Dec 28 16:10:25 box1 postfix/qmgr[4846]: 5CE3E8E133: removed


    If anyone out there can help me, please do so.

    Thanks.
    --Willie
    Last edited by wbens; 12-28-2010 at 09:39 PM.

  2. #2
    Just Joined!
    Join Date
    Sep 2010
    Location
    Dhaka, Bangladesh
    Posts
    29
    did you try aliasing? if your smtp settings are alright, aliasing should do the trick

    file: /etc/postfix/main.cf
    alias_maps = hash:/etc/postfix/aliases

    # ls -l /etc/postfix/aliases
    -rw-r--r-- 1 root root 28 2008-10-20 09:31 aliases

    file:/etc/postfix/aliases
    dbsupport: dbsupport, admins@thatdomain.com
    helpdesk: helpdesk, admins@thatdomain.com
    # postaliases /etc/postfix/aliases
    # /etc/init.d/postfix restart


    should work..but can you confirm, please?

  3. #3
    Linux Newbie
    Join Date
    Jun 2008
    Location
    Georgia, USA
    Posts
    117
    I am going to try it right now.

    Now, are you saying that I should leave my transport file as it is? I thought I had to erase what I tried with it.

    I am trying to tell postfix to deliver all emails from

    dbsupport@thisdomain.com
    and
    helpdesk@thisdomain.com

    to admins@thatdomain.com

    Thanks.
    --Willie
    Thanks.
    --Willie
    If there was no Linux, my life would not be complete.

  4. #4
    Linux Newbie
    Join Date
    Jun 2008
    Location
    Georgia, USA
    Posts
    117
    Also, can you tell me why are we repeating helpdesk and dbsuport twice in the alias file?

    dbsupport: dbsupport,
    admins@thatdomain.com
    helpdesk: helpdesk, admins@thatdomain.com

    Thanks sarmed
    --Willie
    Thanks.
    --Willie
    If there was no Linux, my life would not be complete.

  5. #5
    Just Joined!
    Join Date
    Sep 2010
    Location
    Dhaka, Bangladesh
    Posts
    29
    I'm not sure, but I think you could try removing those lines from transport file....or you could try like this (but i don't know the syntax right)

    .thatdomain.com remote_IP:smtp port


    about aliases; when I write

    user1: user2
    the email sent to user 1 would be redirected to user2. However, user1 would not have a copy of the email.

    but if I write

    user1: user1, user2
    both user1 and user2 would get a copy of the email.

    Hope it helps. ^_^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...