cc or bcc not working in mailbox settings

Discussion in 'ISPConfig 3 Priority Support' started by DylanPedro, Mar 18, 2018.

  1. DylanPedro

    DylanPedro Member

    Hi,

    I have tried adding both an external and internal email address to the cc and bcc fields but when sending an email a copy isn't being sent and there is no trace of it in the mail.log?

    This is in the mailbox settings in ISPConfig
     
    Last edited: Mar 20, 2018
  2. DylanPedro

    DylanPedro Member

    Anything?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look inti the sieve file of the mailbox, it should contain a line for the 'send copy to' address:

    cat /var/vmail/test.tld/test/.sieve

    require ["fileinto", "regex", "date", "relational", "vacation"];
    # Send a copy of email to
    redirect "[email protected]";
    keep;

    The bcc address is read by postfix directly from the database, the config file is /etc/postfix/mysql-virtual_outgoing_bcc.cf
     
  4. DylanPedro

    DylanPedro Member

    So Ive checked the database and the value entered in the ISPConfig mailbox setting matches the email address in the sender_cc column as expected.

    I then have created an alias email address as follows:
    original mailbox = [email protected]
    alias address = [email protected] -> [email protected]
    bcc set in mailbox settings = [email protected]

    When sending any emails no bcc copies appear in the inbox as expected?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The BCC is for the mailbox and not the alias. You are sure that you sent the email with the mailbox address and not the alias address?
     
  6. DylanPedro

    DylanPedro Member

    Hi Till,

    Just tested it using the mailbox address and not the alias address and it worked. This mailbox is set to use the alias address by default so how would it work when mail is sent from the alias address?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no bcc for aliases. You can e.g. remove the alias, rename the mailbox to the alias address and then add the old mailbox address as alias instead.
     
  8. DylanPedro

    DylanPedro Member

    All I am trying to do is to have a copy of all mail sent for a particular mailbox in the inbox so maybe its better to use send cc option instead of the bcc?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The cc one is for incoming email, the bcc one for outgoing.
     
  10. DylanPedro

    DylanPedro Member

    Hi Till,

    So I removed the alias, renamed the mailbox to the alias address and then add the old mailbox address as alias instead.

    e.g.
    mailbox is called [email protected]
    alias is called [email protected]

    when sending mail directly to [email protected] from external client it gets delivered correctly
    when telling google to forward all incoming mail to [email protected] to [email protected] the following error occurs:
    Code:
    Mar 21 12:28:06 server1 postfix/smtpd[26194]: connect from mail-io0-f175.google.com[209.85.223.175]
    Mar 21 12:28:06 server1 postfix/smtpd[26194]: NOQUEUE: filter: RCPT from mail-io0-f175.google.com[209.85.223.175]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10026; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-io0-f175.google.com>
    Mar 21 12:28:06 server1 postfix/smtpd[26194]: NOQUEUE: filter: RCPT from mail-io0-f175.google.com[209.85.223.175]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10024; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-io0-f175.google.com>
    Mar 21 12:28:07 server1 postfix/smtpd[26194]: 07DC9608D7: client=mail-io0-f175.google.com[209.85.223.175]
    Mar 21 12:28:07 server1 postfix/cleanup[32137]: 07DC9608D7: message-id=<HE1P189MB05538B5FC6133E37789927F8BFAA0@HE1P189MB0553.EURP189.PROD.OUTLOOK.COM>
    Mar 21 12:28:07 server1 postfix/qmgr[1460]: 07DC9608D7: from=<[email protected]>, size=10604, nrcpt=1 (queue active)
    Mar 21 12:28:07 server1 postfix/smtpd[26194]: disconnect from mail-io0-f175.google.com[209.85.223.175] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
    Mar 21 12:28:07 server1 postfix/smtpd[32141]: connect from localhost[127.0.0.1]
    Mar 21 12:28:07 server1 postfix/smtpd[32141]: 8214D608E5: client=localhost[127.0.0.1]
    Mar 21 12:28:07 server1 postfix/cleanup[32137]: 8214D608E5: message-id=<HE1P189MB05538B5FC6133E37789927F8BFAA0@HE1P189MB0553.EURP189.PROD.OUTLOOK.COM>
    Mar 21 12:28:07 server1 postfix/smtpd[32141]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
    Mar 21 12:28:07 server1 postfix/qmgr[1460]: 8214D608E5: from=<[email protected]>, size=11138, nrcpt=1 (queue active)
    Mar 21 12:28:07 server1 amavis[16090]: (16090-07) Passed CLEAN {RelayedOpenRelay}, [209.85.223.175]:40257 [40.92.71.89] <[email protected]> -> <[email protected]>, Queue-ID: 07DC9608D7, Message-ID: <HE1P189MB05538B5FC6133E37789927F8BFAA0@he1p189mb0553.eurp189.prod.outlook.com>, mail_id: jtTmENHQXE3b, Hits: -0.058, size: 10594, queued_as: 8214D608E5, dkim_sd=selector1:outlook.com, 509 ms
    Mar 21 12:28:07 server1 postfix/smtp[32138]: 07DC9608D7: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.72, delays=0.21/0/0.01/0.5, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 8214D608E5)
    Mar 21 12:28:07 server1 postfix/qmgr[1460]: 07DC9608D7: removed
    Mar 21 12:28:07 server1 postfix/pipe[32144]: 8214D608E5: to=<[email protected]>, orig_to=<[email protected]>, relay=dovecot, delay=0.04, delays=0.01/0.01/0/0.02, dsn=5.4.6, status=bounced (mail forwarding loop for [email protected])
    Mar 21 12:28:07 server1 postfix/cleanup[32137]: 8AAE7608EB: message-id=<[email protected]>
    Mar 21 12:28:07 server1 postfix/qmgr[1460]: 8AAE7608EB: from=<>, size=13410, nrcpt=1 (queue active)
    Mar 21 12:28:07 server1 postfix/bounce[731]: 8214D608E5: sender non-delivery notification: 8AAE7608EB
    Mar 21 12:28:07 server1 postfix/qmgr[1460]: 8214D608E5: removed
    Mar 21 12:28:07 server1 postfix/pipe[32144]: 8AAE7608EB: to=<[email protected]>, relay=dovecot, delay=0.03, delays=0.01/0/0/0.02, dsn=5.1.1, status=bounced (user unknown)
    Mar 21 12:28:07 server1 postfix/qmgr[1460]: 8AAE7608EB: removed
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if you build some kind of mail loop between google and your server or you made two mail servers authoritative for a domain. There can be only one server responsible for a specific email domain and address, so either you use Google or you use ISPconfig for the domain but not both at the same time.
     
  12. DylanPedro

    DylanPedro Member

    only one mail server authoritative per domain
    example.com has google
    exchange.example.com has ISPConfig

    Sending email to [email protected] directly works and no complaints of loops
    When sending email to [email protected] which then gets forwarded to [email protected] by gmail ISPConfig complains about the loop

    even sending mail to [email protected] works which is also forwarded by gmail

    so the only issues is when sending to [email protected]

    [email protected] is set as the main mailbox in ISPConfig
    [email protected] is an alias

    if there was an issue with mail servers why would mail send to [email protected] work when gmail forwards but mail sent to [email protected] make ISPConfig complain about a loop?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig does not complain about a loop, ispconfig is not involved in mail routing or delivery at all, it's a control panel and not a mail server. The mail server of your system is postfix and postfix tells you that there is a loop.
     
  14. DylanPedro

    DylanPedro Member

    Sorry, that's what I meant postfix is complaining but only in the scenario explained above. That is why I had the alias set as the default outgoing address but would prefer this method as I need to use the bcc feature. How can I get this looked into?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

  16. DylanPedro

    DylanPedro Member

    Ok so I did some more investigation and setup a second domain as follows:
    all mail sent to a random gmail account is forwarded to [email protected]2.com which is an alias to [email protected]

    Every test I do passes and mail is delivered correctly which leads me to the following conclusion

    postfix does not complain if the original email was sent to [email protected] then forwarded to the ISPConfig server but if the email is sent to [email protected] which is also the name of the mailbox in ISPConfig and forwarded by gmail to [email protected] which is an alias to [email protected], this forward loop error occurs.

    So this is something to do with the fact the original email was sent to [email protected] and ISPConfig having a mailbox called [email protected] ?

    We have to remeber gmail tries to deliver as expect but postfix on the ISPConfig sided decides not to accept.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Postfix accepts the email as you can see in the log. The problem is not that postfix does not accept it, the problem is that you setup a loop so that email would go endlessly from a to b and from b back to a, postfix detecs this and stops the loop and that's what you see in the log:

    Mar 21 12:28:07 server1 postfix/pipe[32144]: 8214D608E5: to=<[email protected]>, orig_to=<[email protected]>, relay=dovecot, delay=0.04, delays=0.01/0.01/0/0.02, dsn=5.4.6, status=bounced (mail forwarding loop for [email protected])

    The final unknown user message is not about the original mail, it's just that postfix tried to somehow notify the postmaster of that dmain about the mail loop and as there is no postmaster address, this error message could not be delivered:

    Mar 21 12:28:07 server1 postfix/pipe[32144]: 8AAE7608EB: to=<webmaster+caf_=mail=[email protected]>, relay=dovecot, delay=0.03, delays=0.01/0/0/0.02, dsn=5.1.1, status=bounced (user unknown)
     
  18. DylanPedro

    DylanPedro Member

    Hi Till,

    The to=<[email protected]> address is were the message was originally sent outside of the ISPConfig server
    The orig_to=<[email protected]> address is where gmail is told to forward this email to which is an email alias for a configured mailbox in ISPConfig called [email protected]

    So really there is no loop, but postfix is getting confused with Mar 21 12:28:07 server1 postfix/pipe[32144]: 8214D608E5: to=<[email protected]>, orig_to=<[email protected]>, relay=dovecot, delay=0.04, delays=0.01/0.01/0/0.02, dsn=5.4.6, status=bounced (mail forwarding loop for [email protected])

    As per the following link:
    https://www.howtoforge.com/community/threads/mail-forwarding-loop.52645/

    I added the Content Filter and now the email is being delivered with no loop complaints?

    Is this the correct way to fix this and would there be any foreseeable issues with this down the line?
     
  19. DylanPedro

    DylanPedro Member

    anything on the above?
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    If it works now, then leave it as it is.
     

Share This Page