Every hour I get an automated email and in the last week or so it has started having problems. Sometimes the emails don’t arrive for hours then suddenly they’ll all back flood in. I checked the logs and what happens is it says “sender address rejected: domain not found”. If I ping the domain both from the postfix docker or the host server it finds it, no problem. And clearly it does find the domain sometimes because emails will mostly come through. Now what I have noticed is that they are sending via google and mailcow is resolving the google domains in ipv6 however the sender’s domain does not have an AAAA record. This is happening only for this one sender domain but happens to all emails from them regardless of the address they send from. So I’m looking for advise on what possibly the issue is. My idea currently is that perhaps it sometimes is trying to find an ipv6 ip and failing and not falling back to ipv4.

Does anyone have a way I can stop this? Perhaps there’s a way to whitelist that domain so it doesn’t check the sender’s domain? Maybe if I put the ipv4 and a fake ipv6 resolution in my hosts file would that be enough?


  • bpita replied to this.
  • Daemon-Byte

    Hi, I don’t know if you found a solution, but I was having similar problems with a domain that was giving me the error “Sender address rejected: Domain not found”. After much searching and testing I got it to work as follows:

    In master.cf add into the option smtpd_sender_restrictions regexp:/opt/postfix/conf/sender_whitelist… in my case it looked like this:

    smtpd_sender_restrictions=permit_mynetworks,**regexp:/opt/postfix/conf/sender_whitelist**,reject_unlisted_sender,reject_unknown_sender_domain

    And the sender_whitelist file looks like this:

    /[@.]example\.com$/ OK

    That’s it, obviously you should run postmap -v sender_whitelist and docker compose restart postfix-mailcow to apply the changes.

    Regards, Bernardo.

    2 months later

    Daemon-Byte

    Hi, I don’t know if you found a solution, but I was having similar problems with a domain that was giving me the error “Sender address rejected: Domain not found”. After much searching and testing I got it to work as follows:

    In master.cf add into the option smtpd_sender_restrictions regexp:/opt/postfix/conf/sender_whitelist… in my case it looked like this:

    smtpd_sender_restrictions=permit_mynetworks,**regexp:/opt/postfix/conf/sender_whitelist**,reject_unlisted_sender,reject_unknown_sender_domain

    And the sender_whitelist file looks like this:

    /[@.]example\.com$/ OK

    That’s it, obviously you should run postmap -v sender_whitelist and docker compose restart postfix-mailcow to apply the changes.

    Regards, Bernardo.

      Have something to say?

      Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

      bpita Hi, thanks for the reply. I did a few things and I’m not sure what made it go away but it hasn’t happened for a few weeks now so I’m considered it fixed. Maybe they fixed their dodgy dns 🙂 Thanks for this solution though as I will come back for it if it occurs again

      No one is typing