summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtpd.h
AgeCommit message (Collapse)Author
2012-01-13remove the status field from struct envelope, move it to the smtpEric Faurot
session, and cleanup the DS_* flags. ok gilles@ chl@
2012-01-13Stop using envelope->status to report delivery outcome to theEric Faurot
runner/queue. Instead, replace IMSG_QUEUE_MESSAGE_UPDATE with three messages: - IMSG_QUEUE_DELIVERY_OK - IMSG_QUEUE_DELIVERY_TEMPFAIL - IMSG_QUEUE_DELIVERY_PERMFAIL 1) it's less confusing as status is also used by smtp 2) it's easier to see what happens just looking at imsg traces 3) it makes the code path generally easier to follow 4) it's safer because it enforces clear semantics and intent, whereas the status field is loosely defined and could carry bogus values. ok gilles@ chl@
2012-01-12use mbox backend for mbox delivery.Eric Faurot
ok gilles@
2012-01-12Remove dead code for config reloading for now. It is not functionnalEric Faurot
and confusing. ok gilles@
2012-01-12remove envelope_get_errormsg() and move envelope_set_errormsg()Eric Faurot
to envelope.c ok gilles@
2012-01-11remove stateful iteration from ramqueue, if we ever need to reintroduce itGilles Chehade
we'll do it, but it isn't used and causes potential bugs idea by Nathanael Rensel, diff by me, ok eric@
2012-01-11implement an envelope_ascii API that's not tied to a specific queue_backendGilles Chehade
simplify queue_fsqueue
2012-01-11Simplify runner/queue by getting rid of Q_PURGE. Instead, let smtpdEric Faurot
periodically clear the purge/ directory. At init time, the fsqueue backend simply moves the existing incoming/ dir in purge/ to discard aborted sessions. ok gilles@ chl@
2012-01-11remove dead prototypeEric Faurot
from Nathanael Rensen ok gilles@
2011-12-27Q_BOUNCE is not used anymoreEric Faurot
ok gilles@
2011-12-18Sync comments with latest cleanup changesCharles Longeau
ok eric@
2011-12-14finally kill queue_shared.c and move what is left to bounce.cEric Faurot
where it belongs. ok gilles@
2011-12-14split auth_backend.c for consistencyEric Faurot
ok chl@ gilles@
2011-12-14move show_queue() and related functions from queue_shared.cEric Faurot
to smtpctl.c ok gilles@
2011-12-14make queue_fsqueue backend consistent with the backend scheme.Eric Faurot
ok gilles@
2011-12-13*finally* make use of certificate authority file if available !Gilles Chehade
bits from relayd, ok chl@, ok eric@
2011-12-13split user_backend.c into user.c and user_pwd.c to be consistent with theEric Faurot
backend scheme. Also rename USER_GETPWNAM to USER_PWD. ok chl@ gilles@
2011-12-13- introduce delivery backend API (delivery.c)Gilles Chehade
- move each delivery method to it's own delivery backend - simplify smtpd.c accordingly - rename A_EXT -> A_MDA since that's what we really do ok eric@
2011-12-12add a session_enter_state() function to change the state of an smtpEric Faurot
session and allow those state changes to be traced (add traces flags for upcoming changes while there). ok chl@ gilles@
2011-12-12remove comments about dead "struct delivery"Charles Longeau
"obvious ok" gilles@
2011-12-11utility function for parsing and validating SMTP response linesEric Faurot
ok gilles@
2011-12-11Make the mta code a bit more straightforward:Eric Faurot
- fetch the ssl cert earlier on if needed - skip mta_pickup() when handling the incoming fd ok gilles@
2011-12-08rename struct user to struct mta_user to avoid namespace conflict elsewhereTodd T. Fries
ok chl@ & gilles@
2011-11-28fix STATE_COUNT countCharles Longeau
ok eric@ gilles@
2011-11-21get rid of the "enqueue/" queue; use "incoming/" instead.Eric Faurot
ok gilles@ chl@
2011-11-16remove unused functionsEric Faurot
ok gilles@ chl@
2011-11-16Do not unlink an offline message until it has been correctly enqueued.Eric Faurot
While there, simplify the offline_enqueue() function by doing all the sanity checks in the forked process, and remove all fatal(): on error, the offline message is left untouched in the directory. Also, get rid of the path_starts_with() check since all paths to offline messages are now constructed internally. ok gilles@ chl@
2011-11-15Qwalk, our API to linearly walk over the persistent queue, did not take theGilles Chehade
queue_backend into account and assumed a filesystem with a specific layout. This commit does plenty of things: - make qwalk an abstraction in the queue_backend API, and impose queue drivers to implement qwalk_open(), qwalk() and qwalk_close(); - move previous qwalk_open(), qwalk() and qwalk_close() to the fsqueue driver since they were fsqueue specific ... - make qwalk API work with msgid/evpid instead of pathnames since we're going to use the queue_backend API to load envelopes by evpid anyway; - makes smtpd use *solely* the queue_backend API when manipulating the queue. pathnames were removed from smtpd.h and moved into the fsqueue which means we can now store a queue anywhere ... as long as we write the ten functions or so required for a queue driver ;-) ok eric@, ok chl@
2011-11-14when receiving an unexpected imsg, print its name.Charles Longeau
with help and ideas from eric@ ok eric@ gilles@
2011-11-14The spool and offline directories are backend-independent, so theyEric Faurot
must be created early by smtpd, rather than in fsqueue. ok gilles@ chl@
2011-11-07Let the smtpd process handle the enqueueing of offline messages atEric Faurot
startup, rather than playing tricks with the runner. This will allow further simplifications and improvements in the runner/queue. ok gilles@
2011-10-26- fix smtpctl pause/resume so the ramqueue scheduling is done correctlyGilles Chehade
- rename IMSG and smtpctl pause/resume parameters - update man page tested by me, ok chl@, eric@
2011-10-23a few important fixes:Eric Faurot
- use correct endianness when dumping/loading port - use the right flag set when dumping/loading flags - keep and use the authmap name when needed, rather than an id that might change when smtpd is restarted - dump/load the authmap name with the envelope - remove the rule struct from rq_batch as only the relay info is useful ok gilles@
2011-10-23relay_as is not used anuwhereEric Faurot
ok gilles@
2011-10-23introduce Q_CORRUPT and queue_backend operation to move a message fromGilles Chehade
schedule queue to corrupt queue upon envelope loading failure. tested by me, ok eric@
2011-10-23fsqueue no longer stores envelopes by dumping the structure, instead use aGilles Chehade
couple of load/dump functions to convert to and from a human readable fmt. while at it kill struct delivery and merge back its fields to the envelope. this basically means we shouldn't require users to flush their queues every time we make a change to struct envelope. work is not done, but we're at a better state than the binary fsqueue so we'll improve it in-tree. has been running on my own box for the last 12 hours or so ok eric@, chl@
2011-10-22Add a log_trace() call to toggle logging of specific debugging info inEric Faurot
verbose mode, and an associated -T command line option. Use it for the imsg traces. Requested by gilles@ who doesn't like verbose to be too verbose. ok gilles@ chl@
2011-10-09show messages sent between processes in debug modeEric Faurot
ok gilles@ chl@
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.