Postfix cannot forward mail

Discussion in 'Installation/Configuration' started by michalv94, Nov 3, 2020.

  1. michalv94

    michalv94 New Member

    Hello,

    im facing very interesting issue. Im using Postfix with ISPConfig 3 + Dovecot + Roundcube
    To allow users to set email forwarding im using ispconfig 3 package for roundcube. This package after setting in roundcube updates user record in db (adds cc entry), this results with sieve filter creation in users mail directory with the following entry:

    Code:
    # Send a copy of email to
    redirect "[email protected]";
    
    But when i send email to postfix its delivered to primary mailbox but not forwarded with folowing in
    Code:
    /var/log/maillog
    Code:
    postfix/pickup[8342]: 051BF19724B: uid=5000 from=<SRSremoved_for_privacy>
    postfix/cleanup[8446]: 051BF19724B: message-id=<[email protected]>
    postfix/qmgr[8343]: 051BF19724B: from=<SRSremoved_for_privacy>, size=13273, nrcpt=1 (queue active)
    postfix/error[8353]: 051BF19724B: to=<[email protected]>, relay=none, delay=0.01, delays=0/0/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=localhost type=A: Host not found, try again)
    postfix/qmgr[8343]: 051BF19724B: from=<SRSremoved_for_privacy>, size=13273, nrcpt=1 (queue active)
    postfix/error[10831]: 051BF19724B: to=<[email protected]>, relay=none, delay=380, delays=380/0.05/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=localhost type=A: Host not found, try again)
    
    This strange behavior is only with forwarded messages. Im also using postsrsd for adress rewritting (otherwise my forwarded emails ended in spam folders).

    I can:
    • recieve emails without any problem
    • send emails from any client without problem (from roundcube, thunderbird etc.)
    • reply to delivered messages
    • dig for any external dns records
    • nslookup also
    It seems like forwarded emails cannot find DNS records for target domain whuch is strange for me. I have checked everything i could imagine without success.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    What version of ISPConfig? forwarding queries and features changed in 3.2, fwiw.
     
  3. michalv94

    michalv94 New Member

    It's 3.1.13

    Really strange for me is in log above:

    Name service error for name=localhost type=A: Host not found, try again

    Why is there localhost? Im forwarding to external domain so there should be external's MTA hostname, right? This is happening only for forwarded messages. From roundcube or Thunderbird everything works fine.
     
    Last edited: Nov 4, 2020
  4. michalv94

    michalv94 New Member

    Found that CLI functions sendmail and mail can reproduce issue. But still webmail and thuderbird is working..
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    In 3.1.13 those forwards are always via sieve, so you can set sieve_redirect_envelope_from if you like that option, but I don't know how to make a sieve "redirect" SRS compatible offhand (It seems like it would have to catch the non-local address and SRS rewrite it on the way out again?)

    You might browse https://git.ispconfig.org/ispconfig/ispconfig3/-/issues/2551, in particular srs-milter (mentioned in the last comment) might be useful? I've not looked at it yet.
     
  6. michalv94

    michalv94 New Member

    I have already fixed this issue. It was caused by amavis.

    Thanks for help.
     

Share This Page