summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtpd.h
AgeCommit message (Collapse)Author
2011-09-19Quick fix to avoid fatal() when we receive a line which have a length of ↵Charles Longeau
exactly 1024. Better fix comming soon. Committing on behalf of gilles@
2011-09-18a single ramqueue message may be shared by many ramqueue envelopes to beGilles Chehade
delivered to many ramqueue hosts, therefore storing the rq_host pointer in the rq_msg envelope is wrong and causes baaaaad behavior. this commit fixes reliability issues in runner process, experienced and reported by many
2011-09-12- introduce filtermask in struct smtpdGilles Chehade
- do not forward lines to mfa when FILTER_DATALINE is not set in filtermask prevents smtpd from handling mails slowly while I'm hacking on filters support
2011-09-01Introduce a small set of functions to manage stat counters in aEric Faurot
simpler and hopefully saner way. ok gilles@ chl@
2011-08-31add support for per-line DATA callbacks, this allows filters to take theirGilles Chehade
decisions *while* the message is being received by the client.
2011-08-27typoGilles Chehade
2011-08-27initial support for a session-time filtering APIGilles Chehade
currently only HELO/EHLO, MAIL, RCPT are supported, however ... I have voluntarily disabled filters at smtpd.conf level so people don't play with it until the API has stabilized a bit discussed with several people in private, no one opposed the feature
2011-08-17move ramqueue_host pointer from ramqueue_envelope to ramqueue_message.Gilles Chehade
this allows us to save one pointer from each envelope stored in ram while still allowing O(1) host lookups by ramqueue_envelope.
2011-08-17- teach smtpctl remove about the new ramqueue structureGilles Chehade
- bonus #1: O(log n) removal of envelopes - bonus #2: removing all envelopes that have the same msgid works again
2011-08-17- introduce ramqueue_lookup_{host,message,envelope} to perform lookups inGilles Chehade
the new ramqueue structure - introduce ramqueue_reschedule() and ramqueue_reschedule_envelope() which to reschedule a message or a specific envelope. O(n) -> O(log n) \o/
2011-08-16add a host-tree and an envelope-tree in the ramqueue, they will be used toGilles Chehade
improve scheduling and general ramqueue operations. unused yet
2011-07-21- update smtpctl.8 to reflect realityGilles Chehade
- bring back 'smtpctl schedule' and 'smtpctl remove' to life Things you should know: The ramqueue data structure is not finished yet and lacks an envelope tree for evpid lookups. I wanted to wait until I'm done but too many people are affected by not being able to reschedule envelopes, this is a quick fix. So right now there's an O(rrible) complexity as both commands will perform a (possibly aborted) queue scan leading to O(n). I will make that O(log n) soon. Also, smtpctl remove no longer supports removing an entire message, I will fix that very soon too.
2011-07-20Fix reporting of permanent/temporary failures for MX lookups.Eric Faurot
Simplify code a bit while there. ok gilles@
2011-06-09'relay as' and 'relay via as' rules allow smtpd to rewrite the user part,Gilles Chehade
the domain part or the entire address of the sender at the SMTP sesssion level. this is not masquerade but allows smtpd to communicate with hosts that do a check of SMTP sender fqdn. sent to tech@, a couple 'no regression' feedbacks
2011-05-21remove unused commented structureGilles Chehade
2011-05-21until now the map_backend API was not really useful for backends that areGilles Chehade
not key/val stores. refactored a bit so that smtpd can really take advantage of backends. preliminary work for ldap support ;-) no functionnal change
2011-05-17introduce new user_backend API for smtpd to lookup the users it wants toGilles Chehade
deliver mail to. the only backend supported for now is USER_GETPWNAM and it is not yet possible to switch to an alternate backend. yes this means that we're very close from smtpd being able to handle fully virtual accounts for both incoming and outgoing messages.
2011-05-17smtpd now uses an auth_backend API to authenticate users that are allowedGilles Chehade
to send mail so they do not necessarily need a local system account. two backends are provided by default, bsd_auth(3) and getpwnam(3), however smtpd will only select bsd_auth(3) for the moment and not provide a way to chose any other backend (that's on purpose ;p). bye bye authenticate() !
2011-05-16murder struct path and make sure smtpd uses simpler structures that do notGilles Chehade
bring a shitload of unnecessary information everywhere. this required many parts of smtpd to be refactored and more specifically envelope expansion. in the process lots of code got simplified, and the envelope expansion code has been isolated to lka_session.c with some longstanding bugs fixed. Diff has been tested by many with no major regression reported. armani@ spotted a bug in a setup where a domain is listed a both primary and virtual, I will fix that in-tree as it's becoming painful to maintain this diff out.
2011-05-06move dns session specific structs and prototypes out of smtpd.h.Eric Faurot
ok gilles@
2011-05-01the smtpd env is meant to be global, so do not pass it all around.Eric Faurot
discussed with and ok gilles@
2011-04-17cleanups, cosmethic changes, functions that should be static are now staticGilles Chehade
no functionnal change
2011-04-17remove unused IMSG_ definesGilles Chehade
2011-04-17a structure describing an envelope should be called struct envelope, notGilles Chehade
struct message ...
2011-04-17no functionnal change, getting rid of deprecated prototypesGilles Chehade
2011-04-15whenever an envelope is reinserted into the ramqueue after a trip to mda orGilles Chehade
mta, call runner_reset_events() so runner starts reprocessing ramqueue
2011-04-15kill message_id and message_uidGilles Chehade
smtpd now has an evpid associated to each delivery message, the evpid is an u_int64_t where the upper 32 bits are the msgid, and the 32 bits are the envelope unique identifier for that message. this results in lots of space saved in both disk-based and ram-based queues, but also simplifies a lot of code. change has been stressed on my desktop, and has ran on my MX for the entire afternoon without a regression.
2011-04-14- implement missing operations for fsqueue:Gilles Chehade
fsqueue_envelope_create(), fsqueue_message_purge() - kill deprecated functions in queue_shared.c At this point fsqueue backend is almost complete, all that is left to do is to move the qwalk() API inside the queue_backend API, then make sure smtpd is no longer calling anything queue related directly.
2011-04-14no functionnal changeGilles Chehade
2011-04-14- implement fsqueue_message_create() and fsqueue_message_commit()Gilles Chehade
- change a few prototypes to allow bounce messages to use the queue_backend API until it gets merged in - kill functions of the queue API that have been deprecated
2011-04-14fsqueue queue backend will implement a filesystem queue:Gilles Chehade
- fsqueue->setup() performs the queue initialization; - fsqueue->message() controls messages; - fsqueue->envelope() controls envelopes; This commit brings the following to fsbackend: fsqueue_setup(), fsqueue_message_delete(), fsqueue_envelope_load(), fsqueue_envelope_update(), fsqueue_envelope_delete(). It also makes smtpd use the queue_backend API for these operations.
2011-04-14smtpd makes too many assumptions about the structure and layout of itsGilles Chehade
disk-based queue, it makes it near impossible to make changes to it without editing twenty files... how am i going to implement mongodb support ? :-) bring a new queue_backend API which hides the details of the disk-based queue to smtpd. it is not "plugged in" yet and I'm filling the holes.
2011-04-13following an idea from jacekm@, smtpd now uses a ram-queue instead of doingGilles Chehade
a continuous walk on the disk-queue. the implementation differs from what jacekm@ commited (and I backed out) a while ago in that it uses a queue and a host tree required for upcoming features. code will be improved in tree, it requires changes to be done in queue and bounce API, I just wanted to commit a working version first ... tested by todd@ and I
2011-04-02add stat counters for the lookup agentEric Faurot
ok gilles@
2011-03-29remove unused code now that reverse lookups are done through asr.Eric Faurot
ok gilles@
2011-03-26missing file in previous commitEric Faurot
ok gilles@
2011-03-26have the client API receive a stdio stream rather than a fd to the messageGilles Chehade
fd. this shifts responsibility for the fclose to the caller, prevents a memory leak and makes everyone happy. diff by Jared Yanovich, thanks !
2011-03-26use an index for iterating into the mx list.Eric Faurot
ok gilles@
2011-03-15let smtpd use user-provided Diffie-Hellman parameters for ephemeral keyGilles Chehade
exchange. if no DH parameters are found, fallback to builtin parameters as was done until now. since we now accept user-provided DH parameters, make smtpd more strict and fatal() if the parameters are bogus. bump the key size of the DH parameters from 512bits to 1024bits, it might be bumped further after some more research. thanks to mikeb@ for his suggestions diff ok mikeb@ , man ok jmc@
2011-03-09smtpctl show stats displays inet4/inet6 repartition for incoming sessionsGilles Chehade
2010-11-29replace the fork-based-non-blocking-resolver-hack by shiny async resolverGilles Chehade
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)
2010-11-28a bit of .h cleanups, no functionnal changeGilles Chehade
2010-11-24add *maxactive statsTodd T. Fries
"ok and no need to keep them for yourself" gilles@
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-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-06-10allow configure queue expiryCharles Longeau
with help from jacekm@ ok gilles@ jacekm@
2010-06-09switch `ref' data type to int, because it is tested for negative value inzinovik
queue_mem_content_unref() function ok jacekm@, gilles@
2010-06-01new queue, again; gcc2 compile tested by deraadtJacek Masiulaniec