summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/parse.y
AgeCommit message (Collapse)Author
2010-11-28remove all unused headersGilles Chehade
2010-11-28a bit of .h cleanups, no functionnal changeGilles Chehade
2010-10-29smtpd no longer knows a map called "secrets" which holds credentials forGilles Chehade
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@
2010-10-28teach smtpd how to handle per-rule delays for message expiry, this allowsGilles Chehade
some rules to have a longer expiry delay than the default: accept for [...] relay expire 8d # will stay 8 days in queue I added the man page bits so I don't forget but I need to reword it a bit
2010-10-18Missing semicolons to appease yyextract, ok gilles@Stuart Henderson
2010-10-09backout the "new" queue code commited 4 months ago. it has many good ideas,Gilles Chehade
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.
2010-09-20- fix a regression caused by latest commit (long story made short: do notGilles Chehade
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
2010-09-08when I fixed the ruleset matching on rules that had more than one conditionGilles Chehade
by expanding them to several rules, I forgot to copy the tags to the expanded rules. this commit unbreaks matching rules by tag. documentation follows shortly ... spotted and fixed by me a while ago, jacekm@ timeout
2010-08-03fix linecount bug with comments spanning multiple linesHenning Brauer
problem reported with the obvious fix for bgpd by Sebastian Benoit <benoit-lists at fb12.de>, also PR 6432 applied to all the others by yours truly. ok theo isn't it amazing how far this parser (and more) spread?
2010-06-10allow configure queue expiryCharles Longeau
with help from jacekm@ ok gilles@ jacekm@
2010-06-01new queue, again; gcc2 compile tested by deraadtJacek Masiulaniec
2010-06-01New queue doesn't compile on gcc2, back out. Spotted by deraadt@Jacek Masiulaniec
2010-05-31Rewrite entire queue code.Jacek Masiulaniec
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.
2010-05-27when a rule has two conditions (ie: accept for { domain foo, domain bar } )Gilles Chehade
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
2010-05-27kill struct opt from struct rule, we don't use it, we don't need itGilles Chehade
2010-05-19cleanup-only commit, removes unrequired includes, no functionnal changeGilles Chehade
2010-04-27this commit enables "plain" as a backend for maps (that means aliases,Gilles Chehade
virtual AND secrets), adds a description in smtpd.conf.5 and removes a mention to special map "aliases" which was removed a while ago. to use plain maps: map "myaliases" { source plain "/etc/mail/aliases" } code diff was okayd a while ago by jacekm@
2010-04-20Support "accept from local ..." as documented in the man page.Jacek Masiulaniec
Reported by Rene Maroufi <info@maroufi.net>
2010-04-20when a size is declared with a quantifier in smtpd.conf, have parse.y useGilles Chehade
scan_scaled(3) to support the quantifiers rather than rolling my own code. prompted by jacekm@
2010-04-19two lines were missing from previous commitGilles Chehade
2010-04-19basic support for SIZE extension, has been sitting in my tree for a monthGilles Chehade
or so ... okayd by jacekm@ a while ago
2010-02-26- fix netmask matching for AF_INET, it was broken in many ways, problemGilles Chehade
was reported by nicm@ which spent a couple hours with me trying to understand what was causing the bug, and helping me write and test fix.
2009-12-10Fix few read overruns found by parfait.Jacek Masiulaniec
Nudge by deraadt@
2009-12-06fix previousJacek Masiulaniec
2009-12-05fix interface tagging listeners in the ipv6 caseCharles Longeau
while there factor some common code (from jacekm input) ok jacekm@
2009-11-12Fix a memleak in parse_config(). Correct return code in few error paths.Jacek Masiulaniec
Fix two memleaks in purge_config(). First problem spotted by parfait, the other ones - by myself. "looks good" gilles@
2009-11-05some structures reference the maps they use by their id, if we allow 0 as aGilles Chehade
valid map id, then we have no way to know for these structures if they have a reference to a map, or if the member was not set. make map id start at 1.
2009-11-03teach makemap how to build a set, which is a map containing only keys.Gilles Chehade
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
2009-11-03this commit removes the hardcoded special "aliases" map and brings supportGilles Chehade
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 !
2009-10-19change virtual rule so that it reads: accept for virtual "mapname", insteadGilles Chehade
of: accept for virtual map "mapname" ... discussed with jacekm@
2009-10-19currently, smtpd is capable of having multiple listeners with differentGilles Chehade
options but they will all share the same ruleset. this means that there is no way to have a rule apply to a session established on one listener but not applied on another. this commit brings initial support for tagging listeners and having the rules able to match these specific listeners. The following will define a rule which will only apply to interfaces tagged as "mynet": listen on lo0 # implicit lo0 tag listen on fxp0 tag mynet listen on fxp1 tag mynet accept on mynet for domain "example.org" deliver to mbox
2009-10-19users within virtual domains do not necessarily map to a real user account,Gilles Chehade
teach smtpd how to deliver using specific user permissions: accept for virtual map "foo" deliver to maildir "/m/%d/%u" user foo will deliver mail under /m/domain/user as user foo idea and initial diff discussed with jacekm@
2009-10-11implement proper virtual domains instead of faking them on top of primaryGilles Chehade
domains. this means that: - virtual domains no longer deliver to a local user when not told to - they no longer attempt to resolve aliases when not told to - they no longer need an explicit rule in smtpd.conf for EACH domain - the "virtual" map is no longer hardcoded - smtpd no longer needs a restart to support a new domain instead we introduce the: accept for virtual map "mapname" [...] syntax which refers to a map that can be manipulated at runtime. idea discussed and okayd with jacekm@
2009-09-16Do not print "could not load cert" warning at startup if certificate is notJacek Masiulaniec
required. Requested by jmc@, gilles@ ok.
2009-06-05if path in "deliver to maildir path" is omitted, use ~/Maildir byJacek Masiulaniec
default; from gilles@
2009-06-02make env->sc_listeners and env->sc_ssl pointers, one step further towardGilles Chehade
configuration reloading without killing active sessions; ok jacekm@
2009-05-30It is now possible to specify a certificate to use when relaying to anotherGilles Chehade
host which requests client certificates: accept [...] relay via [...] ssl certificate "mycert" diff from Josh Elsasser <josh@elsasser.org>, tested and okayed by me with no change but the addition of status 554 to the state machine to deal with remote host telling us it doesn't like our certificate.
2009-05-27temporary fix to a ruleset processing bug that stems from the factJacek Masiulaniec
that the ip address/subnet parsing isn't done in the same way as in other daemons. fix by gilles@
2009-05-21no longer create a dynamic map with 127.0.0.1 and ::1 for every single ruleGilles Chehade
that has an implicit local source. instead we create static "localhost" map before the configuration file is parsed, we fill it with every single local address we can find, and we have rules with implicit local source reference that special map. this unbreaks a behavior which I hated and which prevented: accept for all relay from accepting relaying if LOCAL session was initiated on any interface but lo0.
2009-05-20first step towards configuration reload in smtpd, smtpctl reload will parseGilles Chehade
the configuration file again and replace current configuration with new one in all processes. what we don't support yet is graceful restart, clients in sessions at the moment of the reload will have a temp failure thrown at 'em which is ok RFC-wise but which we will try to improve anyway. tested with various setups, "diff reads good" jacekm@
2009-04-12Code assumed the certificate name to always match the interface name, evenGilles Chehade
when a certificate name was explicitely provided. This would cause imsg to fatal() because with some configurations, it would look for the wrong name in the ssl tree and would fail to find the proper cert. issue spotted by Gregory Edigarov <gregory.edigarov@gmail.com>, I found the fix just a few minutes ago when I succeeded to reproduce the issue...
2009-04-09change syntax of the "listen on" and "relay via" directives:Jacek Masiulaniec
1) kill the ssmtp keyword in "ssmtp listen on ..."; 2) kill the use keyword in "... use certificate foo"; 3) tls no longer implicit, user must explicitely use the tls or smtps option. 4) for "relay via", move the tls/smtps options to right after the port specification; makes it similar to "listen on". These directives: ssmtp listen on fxp0 use ceritifate "foo" accept for all relay via tls "mx.bar.com" now become: listen on fxp0 smtps certificate "foo" accept for all relay via "mx.bar.com" tls ok gilles@
2009-03-31Fixed memory leaks which would occur if the second of two memoryTobias Stoeckmann
allocations fails. looks right deraadt, krw ok henning
2009-03-19when listen was declared without a port parameter, it would get it wrongGilles Chehade
because of a missing htons()
2009-03-16in accept rules, support "for local" as a destination which is an alias toGilles Chehade
"localhost" and system hostname. this allows us to ship with a config file that goes: accept for local deliver to mbox , and which will allow us to have mail working sanely out of the box.
2009-03-09add basic support for outgoing authentication (AUTH PLAIN over ssl) whichGilles Chehade
can be turned on by adding "enable auth" to a "relay via" rule. this made me rework the mx resolution so that it is done by the mta process and not the runner process anymore.
2009-03-08supporting delivery to a mbox that's not in _PATH_MAILDIR is not supported,Gilles Chehade
if someone comes with good rationale why this is needed, we'll consider it, meanwhile it's more work than it looks like and it brings a lot of pain. discussed with jacekm@ and deraadt@
2009-02-22replace MAX* constants by sizeof where possibleOleg Safiullin
ok jacekm@
2009-01-30more const -> sizeof()Oleg Safiullin
no binary changes ok gilles@
2009-01-28first steps towards better mta code. currently mta uses struct batch toGilles Chehade
store a lot of its session related code, but this is just not right and this commit starts making mta code aware of struct session. This will ease the implementation of ssl sessions in mta. while at it, make mta autodetect port to use if it isn't provided in a rule but can be derived from a parameter (i.e: "relay via ssmtp ...").