I already integrated into postfix. I just slapped that query into the .cf file 
and it "worked."
--
cat /etc/postfix/pgsql-transport.cf
hosts = 127.0.0.1

# The user name and password to log into the pgsql server.
user = XXX
password = XXX

# The database name on the servers.
dbname = postfixtransport

# Postfix 2.2 and later The SQL query template. See pgsql_table(5).
query = update send_counts set send_count = case when send_count > threshold 
then send_count else send_count + 1 end from domains, thresholds where 
send_counts.domain_id=domains.domain_id and 
send_counts.domain_id=thresholds.domain_id and domain_name='%s'; select 
transport_name as "transport" from matrix m inner join domains d on 
m.domain_id=d.domain_id inner join transport t on m.transport_id=t.transport_id 
left join send_counts s on m.domain_id=s.domain_id inner join thresholds h on 
m.domain_id=h.domain_id where domain_name='%s' and send_count <= threshold;

--

This also doesn't stop sending as when the thresholds are reached, the mail 
goes thru the other relay. So it stops mail flow thru one set of system, but 
the mail actually does flow out.

It's mimicking a system I've used before for slowly ramping up send volumes. 
Send 1000 emails a day to yahoo, msn, etc. for a few days, then 5000, then 
10000, etc...

I've seen before when going full tilt with a never been seen before sending IP, 
Yahoo in particular, will shut you down pretty quick.

Right now this is all just POC and learning what might be possible.

-----Original Message-----
From: owner-postfix-us...@postfix.org <owner-postfix-us...@postfix.org> On 
Behalf Of Viktor Dukhovni
Sent: Wednesday, December 14, 2022 9:58 AM
To: postfix-users@postfix.org
Subject: Re: Is there an easy way to "warm up" a new sending IP w/ Postfix

On Wed, Dec 14, 2022 at 06:07:41AM +0000, Sean Hennessey wrote:
> Viktor and anyone else,
> 
> I'd like your opinion on something I've come up with that seems to 
> work in my test box. What I've done is set things up so that instead 
> of % thresholds I'm using a count of sent email. I fully expect the 
> counting to not be 100% accurate, off by a couple of tens or even 
> hundreds isn't a big deal. What I did was create the following tables:
>
> [elided]
>
> I'm using this for the query:
>
> query = update send_counts ...

How exactly do you imagine integrating such a query into Postfix?

[ Hint using this as a transport table may not do what you think
  it does.  Transport lookups happen per-recipient and in both
  smtpd(8) and qmgr(8) where lookups happen each time a message
  enters the active queue (and before actual delivery). ]

And is sending a small batch of messages and then stopping really a more 
effective approach to avoid problems due to lack of "reputation" with new new 
IPs?

-- 
    Viktor.

Reply via email to