Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Major goals:
1) Fix bad performance caused by the runner process doing full queue
read in 1s intervals. My Soekris can now happily accept >50 msg/s
while having multi-thousand queue; before, one hundred queue would
bring the system to its knees.
2) Introduce Qmail-like scheduler that doesn't write as much to the
disk so that it needs less code for servicing error conditions,
which in some places can be tricky to get right.
3) Introduce separation between the scheduler and the backend; these
two queue aspects shouldn't be too tied too each other. This means
that eg. storing queue in SQL requires rewrite of just queue_backend.c.
4) Make on-disk queue format architecture independent, and more
easily extensible, to reduce number of flag days in the future.
Minor goals:
ENOSPC no longer prevents delivery attempts, fixed session limiting
for relayed mail, improved batching of "relay via" mails, human-readable
mailq output, "show queue raw" command, clearer logging, sending
of single bounce about multiple recipients, exact delay= computation,
zero delay between deliveries while within session limit (currently
1s delay between re-scheduling is enforced), mta no longer requests
content fd, corrected session limit for bounce submissions, tiny
<100B queue files instead of multi-KB, detect loops before accepting
mail, reduce traffic on imsg channels by killing enormous struct
submit_status.
|
|
channels to parent, mda, mta, lka, smtp, and control. This leaves
just the channel to queue, which forwards imsgs on runner's behalf
and redirects any replies back to it.
OK gilles@
|
|
and assuming message is not in processing/scheduled state
- teach smtpctl how to request message removal from runner
discussed with todd@, idea ok jacekm@
|
|
logging on runtime.
Based on claudio@'s work on ripd, ospfd, ospf6d, dvmrpd, ldpd, bgpd.
With help/ideas/testing from gilles@ jacekm@ todd@
ok jacekm@
|
|
are now controlled.
|
|
|
|
possibility for fd-starvation fatal when under heavy load.
|
|
|
|
ok jacekm@
|
|
control process does not try to handle it.
spotted and reported by martijn@bunix.org
|
|
This is not as strict as various RFCs want it, but we can make it
more granular later. For now, let all mails flow by using the
maximum of all limits found in the RFCs.
ok gilles@
|
|
|
|
- add a new stats counter to distinguish between command lines which
exceeded the limit and data lines which exceeded the limits
|
|
|
|
|
|
implement this, ignoring sendmail options for now.
OK gilles@, jackekm@
|
|
|
|
Stop pushing event handling in the imsg framework.
Instead, provide a small glue layer on top of both imsg and libevent.
This finally clearly separates event handling and imsg construction.
Sidetrack bonus: remove the mega-ugly hack of having a dummy imsg_event_add
stub in smtpctl.
ok jaceckm@
|
|
defaulting to smtpctl-mode; aja@ ok
|
|
- reorder alphabetically and add mta to the statistics
|
|
1) each state may have 2 responses sent quickly;
2) more responses are delayed exponentially, up to a defined limit.
Delay count is user visible (smtp.errors.delays).
ok gilles@
|
|
process individually whenever stats need to be fetched, keep stats
in MAP_ANON shared memory allocated by parent.
This means control has direct access to stats and can respond very
quickly without troubling any other daemon processes.
ok gilles@
|
|
spotted and diff by giovanni <qgiovanni@gmail.com>
|
|
strictness:
- Drop clients attempting command pipelining; protects the daemon
from all kinds of abuse.
- Replace F_EVLOCKED flag with F_WRITEONLY which has cleaner sematics:
when up, session must not be destroyed nor read from, but may be
written to.
- Write callback becomes a central place for enabling EV_READ.
- Delay bufferevent creation until after ssl handshake is completed.
A bunch of session error stats were added to smtpctl's "show stats".
These could help spotting event masking errors in the future.
ok gilles@
|
|
|
|
The approach is to save cmdline + stdin in a file under a newly
added directory /var/spool/smtpd/offline (uid 0 gid 0 mode 1777).
Next time daemon starts, it uses information in that directory
to replay sendmail on user's behalf.
ok gilles@
|
|
of regularly walking session tree in search of idle clients. Gives
the smtp process a chance to become idle.
As a bonus, add smtp.sessions.timeout counter to "smtpctl show stats".
ok gilles@
|
|
and -F cmdline args. Also, date and Message-Id headers are added
when missing.
The main trouble with the current enqueue code is that it requires
dealing with problems in the control process that are already solved
in the smtp process, ie. duplicating a lot of code which interacts
with untrusted clients. This diff solves this by making sendmail
obtain a SMTP socket from smtp via smtpd.sock, and using that socket
to deliver the message. For smtpd it looks as if connection was
made from the network, only difference being the F_MESSAGE_ENQUEUED
message flag, handy when differentation between local and remote
deliveries is wanted.
Most of the features come from the femail program, created by henning@.
Additional testing by Nigel J. Taylor.
ok gilles@, henning@ happy with smtpd using femail code
|
|
|
|
|
|
|
|
to also share the statistics structure, still being worked on
|
|
and queue.inserts.local; ok gilles@
|
|
a token so that it is possible to do: smtpctl schedule <message id/uid>
introduce F_MESSAGE_FORCESCHEDULE which lets the runner schedule a message
even if the retry delay has not been expired.
F_MESSAGE_ENQUEUED is a valid flag for a message and should not cause an\
errx() in smtpctl show queue
|
|
is used instead; ok gilles@
Problem made visible by malloc.conf = AFGJ, and pointed out by otto@
|
|
|
|
F_SECURE. while at it, add "smtp.sessions.aborted" which keeps track of
sessions which were interrupted before completion.
|
|
count, but also the total sessions count, ssmtp sessions (both current and
total) and starttls sessions (both current and total)
# ./smtpctl/smtpctl show stats|grep smtp.sessions
smtp.sessions = 0
smtp.sessions.active = 0
smtp.sessions.ssmtp = 0
smtp.sessions.ssmtp.active = 0
smtp.sessions.starttls = 0
smtp.sessions.starttls.active = 0
#
|
|
being called again with F_EVLOCK set. this fixes a bug where disconnect
after smtpd sends greeting and before entering any command failed to go
into session_destroy().
while at it, rename the "smtp.clients" statistic to "smtp.sessions" and
add counters to struct s_smtp so that I can add ssmtp and starttls with
my next commit ;)
|
|
|
|
|
|
the remaining code was moved to queue_shared.c; ok gilles@
|
|
without "talking" smtp to listeners. currently, a big part of the server
side code is done (and requires a cleanup), next step is to get it usable
properly from a mail user agent.
|
|
- smtpctl recognizes "pause incoming" and "resume incoming"
- setup imsg communication between control process and smtp process
|
|
for both mda and mta batches.
- smtpctl can be used to disable/enable deliveries at runtime using the
pause/resume commands.
ok jacekm@
|
|
|
|
`showqueue' which displays the content of the queue (all envelopes)
`showrunqueue` which displays envelopes scheduled for delivery. The
utility will be improved and extended, but for now we need at least
this basic support to help debug queue-related issues.
Output format is spamdb-alike:
type|envelope uid|sender|recipient|last delivery date|retry count
ok jacek@
|