email redirection problem

Discussion in 'Installation/Configuration' started by the_spy, May 20, 2007.

  1. the_spy

    the_spy New Member

    with the current stable ispconfig + debian etch with postfix,

    I have for example 2 domains, domain1.com and domain2.com configured in ispconfig
    both of them have an administrator user, web1_webmaster and web2_webmaster, which correspond also to webmaster@domain1.com and webmaster@domain2.com
    I have named the server my.ispconfig-server.com in log lines

    In all cases I'm sending the test emails from an external email with an external smtp server to make the situation real.
    And of course I setup the redirections in the ISPConfig panel.

    - first case, without any redirection:
    both email accounts are working great. it's ok

    - second case, I redirect webmaster@domain1.com to an external email, for example to a gmail account blabla@gmail.com :
    the redirection works great. it's ok

    - third case, here is the problem, I redirect webmaster@domain1.com to webmaster@domain2.com , so both domains are on the same server here:
    the redirection is not working.


    here is the syslog lines when it works (second case):
    Code:
    May 20 22:38:44 server postfix/smtpd[25134]: connect from smtp3-g19.free.fr[i.p.address]
    May 20 22:38:44 server postfix/smtpd[25134]: A54854A05F2: client=smtp3-g19.free.fr[i.p.address]
    May 20 22:38:44 server postfix/cleanup[25137]: A54854A05F2: message-id=<4650B224.2040709@externaldomain.com>
    May 20 22:38:44 server postfix/qmgr[6151]: A54854A05F2: from=<user@externaldomain.com>, size=756, nrcpt=1 (queue active)
    May 20 22:38:44 server postfix/smtpd[25134]: disconnect from smtp3-g19.free.fr[i.p.address]
    May 20 22:38:44 server postfix/cleanup[25137]: B52F84A05F3: message-id=<4650B224.2040709@externaldomain.com>
    May 20 22:38:44 server postfix/qmgr[6151]: B52F84A05F3: from=<user@externaldomain.com>, size=911, nrcpt=1 (queue active)
    May 20 22:38:44 server postfix/local[25139]: A54854A05F2: to=<web1_webmaster@my.ispconfig-server.com>, orig_to=<webmaster@domain1.com>, relay=local, delay=0, status=sent (forwarded as B52F84A05F3)
    May 20 22:38:44 server postfix/qmgr[6151]: A54854A05F2: removed
    May 20 22:38:45 server postfix/smtp[25140]: B52F84A05F3: to=<blabla@gmail.com>, orig_to=<webmaster@domain1.com>, relay=mail.gmail.com[i.p.address], delay=1, status=sent (250 Ok: queued as 1178E6B8DBC)
    May 20 22:38:45 server postfix/qmgr[6151]: B52F84A05F3: removed
    compared to the syslog lines when it don't work (third case):
    Code:
    May 20 22:49:38 server postfix/smtpd[25539]: connect from smtp3-g19.free.fr[i.p.address]
    May 20 22:49:38 server postfix/smtpd[25539]: B74894A05F2: client=smtp3-g19.free.fr[i.p.address]
    May 20 22:49:38 server postfix/cleanup[25540]: B74894A05F2: message-id=<4650B4B2.9080800@externaldomain.com>
    May 20 22:49:38 server postfix/qmgr[6151]: B74894A05F2: from=<user@externaldomain.com>, size=758, nrcpt=1 (queue active)
    May 20 22:49:38 server postfix/smtpd[25539]: disconnect from smtp3-g19.free.fr[i.p.address]
    May 20 22:49:38 server postfix/local[25541]: B74894A05F2: to=<root@my.ispconfig-server.com>, orig_to=<webmaster@domain1.com>, relay=local, delay=0, status=sent (delivered to command: procmail -a "$EXTENSION")
    May 20 22:49:38 server postfix/qmgr[6151]: B74894A05F2: removed
    
    you can easily see here the difference here. it seems that in the third case when both domains are on the same server, the email is directly sent to the root email instead of getting to the right user and redirected like in the second case.


    Thanks
     
    Last edited: May 20, 2007
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Please check the root mailbox, does the email contain any postfix error messages? Please check your postfix alias file, maybe you have a redirect for webmaster accounts to root there.

    Is the email address webmaster@domain1.com listed in the file /etc/postfix/virtusertable with the correct mailbox user?
     
  3. the_spy

    the_spy New Member

    I think I have found where the root emails go,

    in the file /var/mail/nobody

    there is no postfix email error, just the email I should have received in webmaster@domain2.com, and some root cron mails, so I think it's the root mailbox.

    I have never changed the /etc/aliases file, here is the content:

    do you think I should remove these lines, particulary the line "webmaster: root" ?

    in /etc/postfix/virtusertable yes I have the 2 lines which correspond to webmaster@domain1.com and webmaster@domain2.com :

    and in the .forward file of web1 I have the right redirection email where it should send:


    here is the postfix main.cf I have:

    I have also tried to force the user in the email, I mean sending an email to web1_webmaster@domain1.com instead of webmaster@domain1.com, but the problem is the same.
     
    Last edited: May 21, 2007
  4. the_spy

    the_spy New Member

    I answer to myself, the problem was here !
    I removed this line and regenerated the aliases.db file with newaliases command,

    and now the redirection is working :)

    Thanks till
     

Share This Page