summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/queue.c
AgeCommit message (Collapse)Author
2010-04-22- kill the runner_imsg_compose wrapper to reduce indirectionJacek Masiulaniec
- kill noisy log_debug
2010-04-21Runner process is just a helper for queue, so tear down its imsgJacek Masiulaniec
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@
2010-04-21Remove unusable ifdef DEBUG code.Jacek Masiulaniec
2010-04-20Kill *2400* lines of code by abstracting common bits of the imsg handlers.Jacek Masiulaniec
2010-01-03Implement "log verbose" and "log brief" to enable or disable verbose debugCharles Longeau
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@
2009-12-14Tweak the logic behind setting the fd limits so that smtpd is less likelyJacek Masiulaniec
to get upset by custom soft/hard ulimit settings. Suggested by todd@
2009-12-14Impose sessions limit on the delivery sessions (mta and mda).Jacek Masiulaniec
2009-12-13Use safe fd limits in smtp, lka, queue, and control. Removes aJacek Masiulaniec
possibility for fd-starvation fatal when under heavy load.
2009-11-08- make aliases expansion use a rb tree instead of a tail queue, the codeGilles Chehade
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
2009-11-01fix a couple log_info()s,Gilles Chehade
from Tim van der Molen <tbvdm@xs4all.nl>
2009-10-12- fix a null deref which could happen after a couple iterations of theGilles Chehade
aliases/virtual domains resolution code. - fix a logic bug which caused virtual domains not to be correctly handled after one iteration of the aliases resolution code. - introduce a few helper functions to help clean up and simplify the lka code. - simplify the IS_EXT/IS_MAILBOX/IS_RELAY macros so they manipulate a struct path * instead of the mess of dereferences we were passing them.
2009-09-15Extend SMTP client_* API to support SSL+AUTH, and use it in the mtaJacek Masiulaniec
process to relay mails. ok gilles@
2009-09-03imsg_get sets errno so use fatal instead of fatalx.Jacek Masiulaniec
2009-06-06Sync with relayd:Pierre-Yves Ritschard
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@
2009-06-05make smtpd's imsg lib ready, just like relayd and ospfd.Pierre-Yves Ritschard
ok gilles@, jacekm@
2009-06-01Fix EV_READ/EV_WRITE testing inside IMSG handlers. Based on similar changeJacek Masiulaniec
to the routing daemons by claudio@; ok gilles@
2009-05-24Parent process forks 3 types of processes, track them all in a single treeJacek Masiulaniec
using newly introduced child struct. Manage process titles centrally in struct smtpd. ok gilles@
2009-05-24Instead of keeping stats private to each process, and querying everyJacek Masiulaniec
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@
2009-05-19Verify the amount of IMSG payload is exactly as expected; ok gilles@Jacek Masiulaniec
2009-05-14use the nitems() macro where appropriateEric Faurot
ok gilles@, jacekm@
2009-04-21correct some fatal(x) calls and error stringsEric Faurot
ok gilles@ jacekm@
2009-04-18remove dead code; made possible by previous commit.Jacek Masiulaniec
2009-04-16Total rewrite of the sendmail interface. Adds support for -t, -v,Jacek Masiulaniec
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
2009-03-29turn some log_debugs into log_warns or even fatals; "looks ok" gilles@Jacek Masiulaniec
2009-03-01In "smtpctl show stats", break queue.inserts into queue.inserts.remoteJacek Masiulaniec
and queue.inserts.local; ok gilles@
2009-02-22add missing headersCharles Longeau
ok gilles@
2009-02-20purge /enqueue at startup; ok gilles@Jacek Masiulaniec
2009-02-15New config.c that allows for process cloning. Done by pyr@ forJacek Masiulaniec
relayd at n2k9, and adapted to smtpd; ok gilles@
2009-01-29Implement "smtpctl show stats"; ok gilles@Jacek Masiulaniec
2009-01-29Common queue walking code for smtpd and smtpctl. Kills majority of showqueue.c,Jacek Masiulaniec
the remaining code was moved to queue_shared.c; ok gilles@
2009-01-28Make races between queue and runner impossible by implementing the policy:Jacek Masiulaniec
1) queue never reads /queue. 2) queue writes to /queue only at message injection time. 3) runner does all reading, and all writing apart from 2). ok gilles@
2009-01-28move some functions from queue.c to queue_shared.c as they are not onlyGilles Chehade
used by queue process but also by runner, while at it change the prototype of queue_open_message_file() so it takes the message id and not a batch, runner process requires the decriptor before it even starts building a batch.
2009-01-28add a struct path to struct message so that we can keep track of the RCPTGilles Chehade
provided recipient even after aliases/forwards expansion, we'll need this for loop detection. message id and uid being MAXPATHLEN long is a waste, define MAX_ID_SIZE which is currently set to 64 (but can probably be further reduced) and make sure that structures and the few strlcpy's use the right define. original idea by jacekm@ a while ago
2009-01-27first bricks of enqueue code which allows smtpctl to submit mail to queueGilles Chehade
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.
2009-01-26move some queue related functions that are needed outside of smtpd to theGilles Chehade
sharedqueue.c file, smtpctl cannot link queue.o without creating a mess otherwise. while at it, move some prototypes to smtpd.h as they will be needed by enqueue code
2009-01-26we had a set of functions to deal specifically with incoming messages andGilles Chehade
we need the same functions for the enqueue code i'm currently working on. instead of duplicating the code, add a set of functions which take the queue we're working on as a parameter and turn the old ones into wrappers. no functionnal change ... yet discussed with jacekm@
2009-01-12more checks in queue_record_incoming_envelope; ok gilles@Jacek Masiulaniec
2009-01-06make file update in queue_update_envelope atomic; ok gilles@Jacek Masiulaniec
2009-01-04aliases/forwards expansion was not done correctly and a race couldGilles Chehade
cause delivery to happen before expansion is over, causing some of the recipients to never receive the mail. change how the mfa, lka, queue and smtp processes communicate to ensure smtp never receives an acknowledgment before ALL expanded envelopes are on disk. While at it, lka was doing work which belongs in mfa, fix that also. this is based on an idea from a talk with jacekm@, change not over but already better than what we had.
2009-01-02fix T_DAEMON_MESSAGE notices delivery; ok gilles@Jacek Masiulaniec
2009-01-02cleanup queue_load_envelope; ok gilles@Jacek Masiulaniec
2009-01-01remove unnecessary includes; ok gilles@Jacek Masiulaniec
2008-12-31if mkdir/mkdtemp fails, fatal if errno != ENOSPC; ok gilles@Jacek Masiulaniec
2008-12-31rename may fail due to ENOSPC, make smtpd survive this condition; ok gilles@Jacek Masiulaniec
2008-12-31kill unnecessary function; ok gilles@Jacek Masiulaniec
2008-12-29Handle ENOSPC in queue_update_envelope; cleanup the code a bit; ok gilles@Jacek Masiulaniec
2008-12-27kill unused function; ok gilles@Jacek Masiulaniec
2008-12-27cleanup; ok gilles@Jacek Masiulaniec
2008-12-27Put common handler code in a function; ok chl@ gilles@Jacek Masiulaniec
2008-12-27Merge hash() and queue_message_hash() into one func, queue_hash(). Fix callersJacek Masiulaniec
to use this interface consistently; ok chl@ gilles@