Age | Commit message (Collapse) | Author |
|
written by eric@. it is still experimental but still better than what we
had earlier so ... we'll improve in tree :)
diff by me with *lots* of help from eric@, tested by todd and I (and a
few people out there)
|
|
|
|
|
|
authenticated relaying. one can create many maps holding credentials and
name them however he/she wants, just like any other map.
teach smtpd how to select a credentials map at the rule-level allowing a
setup to relay through the same MX with different credentials depending
on the source.
smtpd.conf.5 updated to reflect changes with help from jmc@
|
|
is way more optimized than what we had earlier and there's definitely stuff
we want to keep, however it is early optimization that doesn't account for
many features and makes them hard (if not impossible) to write without
ugly workarounds that ruin the purpose of the optimizations.
the backout goes to 30 May's right before the commit and catches up on all
the non-queue related commits that happened since then.
i'll work on reintroducing the ideas from this queue when the basic
features we expect from a MTA are implemented.
suggested on tech@ about a week ago, no objections, several "please make
smtpd move forward" mails from hackers and tech readers.
|
|
attempt to expand the local delivery buffer when relaying mail, it was
kind of ok before but no longer is)
- use the same buffer for local deliveries to files and commands
tested by jmc@ and I
|
|
length of its expand buffer. this commit introduces a new lka_expand()
that has been simplified, that fixes the bug and that is more robust.
callers of lka_expand() can now determine that it has failed and throw
the recipient at session time.
lka_expand() rewrite by oga@, changes around it by me, tested on a few
different setups but no feedback from tech@ so ... let me know if it's
breaking something for you
|
|
%U for sender localpart
%D for sender domainpart
diff sent to tech@ by Gregory Edigarov <greg@bestnet.kharkov.ua>, timeout
by jacekm@, ok by me
|
|
|
|
ok jacekm@
|
|
|
|
|
|
queue rewrite. Proper fix after gilles wakes up.
|
|
|
|
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.
|
|
expand to two rules each having its own condition rather than one rule
with a tail queue of conditions. this simplifies code a bit and removes a
couple hacks.
basic testing by oga and me
|
|
- kill struct alias, struct expandnode is used instead
- introduce map_parse_alias() and map_parse_virtual()
- aliases and virtual code no longer assume db(3) but use the map API which
lets them become backend agnostic AND value-checked. this actually makes
the code simpler by removing all values parsing from aliases.c
- rename K_SECRETS -> K_SECRET, K_ALIASES -> K_ALIAS for consistency the
enum has singular names.
- aliases, virtual and forward now work with an expandtree and deal with
multiple levels of resolving by merging expandtree's
more coming soon ;)
|
|
map_parse_secret() converts a map value into a struct map_secret. lka no
longer needs to do any parsing, it simply calls map_lookup() with kind
K_SECRETS, checks if it returned a !NULL value, and call lka_encode_secret
to safely do the base64 encoding.
|
|
will be used to select the appropriate map parser. make sure every call
to map_lookup() is updated. map_lookup() currently ignores the value.
|
|
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@
|
|
|
|
|
|
|
|
stdio(3) backends, though for now we only enable db(3). this is the first
commit of a serie to improve maps and everything related.
idea discussed with and diff okay jacekm@
|
|
fatalx() on a lowercase() call in some cases. make sure lka uses a buffer
capable of holding a localpart, and do not attempt getpwnam() if we know
it's going to fail anyway...
issue reported by Ben Lindstrom <mouring@eviladmin.org>
|
|
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@
|
|
|
|
to get upset by custom soft/hard ulimit settings.
Suggested by todd@
|
|
possibility for fd-starvation fatal when under heavy load.
|
|
logging of successful deliveries until all MXs were tried, plus add logging
of 5yz replies.
tested by todd@, "reads ok" gilles@
|
|
from the temporary imsg buffer.
ok gilles@
|
|
|
|
|
|
- more cosmethic changes to help readability
- fix memory leaks
- if deliverylist is empty, it means something went bad during expansion,
reject recipient
|
|
|
|
expandtree, this makes a lot of code clearer and removes quite a bit of
complexity from various places.
|
|
|
|
three places: set code to 530, send imsg to notify rejection, kill
lkasession
|
|
- during expansion, no longer create a new node for each result but try to
lookup for an existing equivalent node and increment its reference count
so that: a) we save on memory, b) we don't need to expand the same users
again and again just because they keep appearing in expansion results.
- while expanding, flag nodes as F_EXPAND_DONE so that we know which nodes
we already processed
- be smarter when expanding, if we have a clue that an iteration has not
brought any new result (because no new nodes were added and all existing
nodes have F_EXPAND_DONE), end expansion and proceed to delivery.
- various small cleanups
discussed with jacekm@ yesterday, rebuild aliases db, make clean
|
|
the virtual domains support as it was in my way. this time, make it work as
it should: userpart+foobar@domainpart becomes:
path->user = userpart+foobar
path->domain = domainpart
path->pw_name = userpart
discussed quickly with jacekm@
|
|
no longer have a direct mapping between structures saved in aliases/virtual
db and structures used at runtime during expansion.
side effects ? struct alias is smaller, databases are smaller and it is no
longer necessary to rebuild aliases/virtual databases each time jacekm@ or
I make changes to some obscure structure used indirectely during expansion
rebuild databases, flush queues, make clean
|
|
doesn't take advantage of the new structure yet, but this was a needed
change for upcoming improvements.
- introduce aliasestree_{lookup,insert,remove} to the aliases api
- rename queue_generate_id() to generate_uid() and move it to utils.c as
it is used all over the place and not only in queue
tree idea discussed with jacekm@, if you update rebuild aliases db, make
clean and flush queue
|
|
which is probably the most complex code in smtpd right now. no longer use a
single list to hold aliases to be resolved and resolved aliases, and do not
use struct alias to hold resolved aliases. instead use a delivery list that
is a list of struct path, and populate it with resolved aliases.
idea discussed with jacekm@, this needs some testing to make sure it does
not introduce a regression with aliases. flush your queue and make clean.
|
|
|
|
|
|
free(lkasession) in lka_expand_rcpt()
- while at it, plug a very very unlikely memory leak which i spotted while
reviewing the logic
|
|
- remove prototypes from deprecated functions
|
|
smtpd is now capable of looking primary domains at runtime in a set, which
means that the following becomes possible:
map "primary" { source db "/etc/mail/primary.db" }
accept for domain map "primary" deliver to mbox
while at it fix a couple bugs in the aliases resolution path which caused
recipients to bounce if a ruleset did not have an "accept for local" rule
"diff reads good" jacekm@, flush queue & make clean
|
|
for multiple aliases maps that can be attached at the rule level. with it,
you can for example define different aliases maps for different domains or
different aliases maps for the same domain depending on the client source:
map "localiases" { source db "/etc/mail/localiases.db" }
map "netaliases" { source db "/etc/mail/netaliases.db" }
accept from 192.168.0.0/16 for local alias "localiases" deliver to mbox
accept from all for local alias "netaliases" deliver to mbox
idea discussed with jacekm@ and various other hackers, diff contains some
bug fixes too which were not part of the original diff. man page follows
very shortly ... make clean & flush queue !
|
|
- have virtual related functions take a map id instead of a map
- shrink a tiny bit ruleset matching
- add missing lka_resolve_path() call in aliases resolution leading to
issues spotted by nicm@
|