1

I try to set Postfix through the anvil command so that can be sent altogether maximally 5 emails in 2 minutes, seemingly this is not possible as can be sent emails without any limitation. Maybe I have not found the right settings for the master.cf file regarding to the options smtpd and anvil or similar. Many Greetings

main.cf:

anvil_rate_time_unit = 120s
smtpd_client_connection_count_limit = 1
smtpd_client_connection_rate_limit = 1
smtpd_client_recipient_rate_limit = 5
smtpd_client_message_rate_limit = 5

master.cf:

# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#smtps     inet  n       -       -       -       -       smtpd
#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
user205222
  • 31
  • 4

2 Answers2

1

iirc, all these settings apply per remote server (or domain) that it's connecting to, so 5 messages per 120s per remote mailserver or domain.

Dennis Kaarsemaker
  • 19,277
  • 2
  • 44
  • 70
1

One approach you could examine is queue-only mode:

  • Configure Postfix in queue-only mode.
  • Configure the queue runner to run every 30 seconds.
  • Configure Postfix to send only one message per queue run.

This would give a maximum of 4 messages every two minutes.

Another approach would be to configure Postfix to rely via a server. Configure the relay server with the reception limits you need. You should be able to configure Postfix to relay only for the one host.

Either of these solutions can result in your mail server's queue to grow out of control.

BillThor
  • 27,737
  • 3
  • 37
  • 69