On Wed, Aug 18, 2021 at 12:43:55AM -0400, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote:
> > sender_dependent_relayhost_maps = hash:/etc/postfix/bysender > > Whatever, not directly relevant to your problem... > > > and here's what's in /etc/postfix/bysender > > > > % more bysender > > *@gmail.com [mail.billoblog.com]:25 > > *@hotmail.com [mail.billoblog.com]:25 > > *@charter.com [mail.billoblog.com]:25 > > That's not valid syntax for that table, these are not ever used as > written. As can't have seen the above syntax documented, one might > wonder how you arrived at that particular form... See postconf(5): > > sender_dependent_relayhost_maps (default: empty) > A sender-dependent override for the global relayhost parameter setting. > The tables are searched by the envelope sender address and @domain. A > lookup result of DUNNO terminates the search without overriding the > global relayhost parameter setting (Postfix 2.6 and later). This > information is overruled with relay_transport, > sender_dependent_default_transport_maps, default_transport and with the > transport(5) table. > > Specify zero or more "type:name" lookup tables, separated by whitespace > or comma. Tables will be searched in the specified order until a match > is found. > > For safety reasons, this feature does not allow $number substitutions > in regular expression maps. > > This feature is available in Postfix 2.3 and later. > > -- > Viktor. Database files used with sender_dependent_relayhost_maps need either an email address or a @domain on the left hand side. You are trying to use shell glob-style patterns instead of email addresses or @domains. I don't think glob-style patterns are a thing anywhere in postfix. You might want to read http://www.postfix.com/DATABASE_README.html And always carefully read the documentation in http://www.postfix.com/postconf.5.html for whatever setting you are using. So, if you really should be using sender_dependent_relayhost_maps, then the left hand side should just be "@gmail.com" etc., not "*@gmail.com". But I think you probably shouldn't be using sender_dependent_relayhost_maps at all. Is this really about emails that have been sent *from* gmail/hotmail/charter that are being relayed through your server to another mail server, and that other mail server is not accepting emails from your server because of your IP reputation? It seems odd that a domain that you relay for would be rejecting your server. Are you a secondary MX for them or not? I ask because I used to have a similar sounding problem with Microsoft/Outlook refusing to accept mail from my server for secret reasons they felt no need to share with me. But the problem was getting mail *to* people with outlook email addresses. The workaround was to use transport_maps which maps recipient addresses to a (next hop) transport (and organising access to another mail server that I could send mail through). So, instead of mapping *sender* addresses/domains to a relayhost like you are trying, I mapped *recipient* addresses to a transport (a transport is like a relayhost but more flexible). I may have misunderstood what your problem is, but it sounded very similar to mine. If it is the same sort of thing, perhaps what you need is something like this: main.cf: transport_maps = regexp:/etc/postfix/transport transport: /.*@(gmail|hotmail|charter)\.com/ relay:[mail.billoblog.com] You won't need to run postmap for the transport file when you change it (because it's a regexp database). cheers, raf