summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
2012-11-27missing initialization.Eric Faurot
ok gilles@
2012-11-24fix after asr updateEric Faurot
2012-11-23knfEric Faurot
2012-11-23knfEric Faurot
2012-11-23send ack on update map.Eric Faurot
ok gilles@
2012-11-23knfEric Faurot
ok gilles@
2012-11-23Replace the qwalk API (to retreive on disk envelopes at runtime) withEric Faurot
a simple QOP_WALK queue operation. Some knf and formating fixes while there. ok gilles@
2012-11-20- for lists, list type must come firstJason McIntyre
- uppercase "ID"
2012-11-20Allow "smtpctl show queue" to run in "online" mode if the smtpd serverEric Faurot
is running. The scheduler sends the runtime state of each envelope to the queue process which loads the envelope, fills the runtime bits and sends the envelope back to the client. Iteration over the envelope set happens in small chunks to make the request interruptible and to allow the server to keep doing its job in the meantime. Adpat "smtpctl schedule-all" to schedule the messages one by one using the same iteration mechanism. Document "smtpctl monitor" and "smtpctl show queue". ok gilles@
2012-11-18knock out a useless .Pp;Jason McIntyre
2012-11-18remove { } from example in PRIMARY DOMAIN sectionRobert Peichaer
ok gilles
2012-11-13do not miss the last envelopeEric Faurot
ok gilles@
2012-11-13Simplify the smtpctl code: add a try_connect() function to test ifEric Faurot
the server is running, and flush()/next_message() helpers to make imsg request/response loops easier. ok gilles@
2012-11-12Cleanups and improvements:Eric Faurot
* Log more events (especially client session) and use a better scheme for that: each messages is prefixed with a token to easily identify its class: - info/warn/debug: general server messages - smtp-in: smtp client connections - relay: status update for relayed messages - delivery: status update for local deliveries * Implement "smtpctl monitor" to display updates of selected internal counters. * When reloading the on-disk queue at startup do not commit a message if no envelope was submitted for that message. * Remove unused stuff in the config parser. ok gilles@
2012-11-06Remove the "is_reading" hack and simplify the read/write logic:Eric Faurot
set to write as soon as a response is read. ok gilles@
2012-11-02Add a "kick counter" that gets incremented on each command, to detectEric Faurot
clients that don't do their best to do something useful, and just hog the session. When that kick counter reaches the limit, the client is disconnected. The counter is reset after the first HELO/EHLO command, after tls is established, after a succesful authentication, and after a message is accepted. It is decremented when a RCPT is accepted. ok gilles@
2012-11-02Consistency and robustness improvements in mda:Eric Faurot
- Introduce a mda_getlastline function(); improve the code to avoid useless allocations and string formatting; make it return the last line with content (skip trailing empty lines if found). - Add a mechanism by which the mda can request the parent to abort a local delivery by killing the process. - Use ioev/iobuf for draining data to the delivery process. - Make sure to catch all transient errors and make them result in a tempfail rather than calling fatal(). - Make sure that the envelope status is properly set for all failures. - Stop using SMTP response codes; it makes no sense in this context. ok gilles@
2012-11-02Make counters more informative in the scheduler:Eric Faurot
- Change the scheduler backend API a bit: commit() and rollback() API calls return the number of envelopes added or canceled; put the number of envelopes in the structure returned by batch(). - Properly report the number of incoming, registered, removed and expired envelopes, as well as the outcome of deliveries. ok gilles@
2012-10-28Limit the number of messages that can be enqueued on a single SMTPEric Faurot
connection, and the number of recipients in each of them. ok gilles@ chl@
2012-10-26add a new uptime.human entry in stats, derived from uptime, but displayedCharles Longeau
in a human readable fashion: uptime=123456 uptime.human=1d10h17m36s ok gilles@
2012-10-25Handle the case where writev() fails with EAGAIN. In theory it cannotEric Faurot
happen, but it seems that kqueue triggers the event sometimes, even if the socket is not immediatly writeable. Temporary workaround it while the real issue is being investigated. ok gilles@ chl@
2012-10-25send the semantically correct msg when RCPT fails, even if the exact valueEric Faurot
does not matter. spotted by chl@ ok gilles@ chl@
2012-10-25Make the mda request the message fd from the queue when needed, instead ofEric Faurot
pushing the fd with the envelope. This allows the mda to deal itself with session limits. Envelopes are sent at full rate to the mda, which buffers them on per-user queues, or sends them back for rescheduling if it already has too many pending envelopes. Delivery sessions are created (within per- user and global limits) to drain the queues. This makes the server handle envelope bursts more efficiently. ok gilles@
2012-10-22switch from {open,read,close}() to {fopen,fread,fclose}() in ↵Charles Longeau
fsqueue_envelope_load(), also fix a potential fd leak. ok gilles@ eric@
2012-10-17rename field msg -> evp.Eric Faurot
ok gilles@
2012-10-17Document the -P option. While there, remove reference to -T, it's incomplete,Eric Faurot
subject to changes and internal. feedback from jmc@ ok gilles@
2012-10-17consistency fix: we use "envelope-id" everywhere.Eric Faurot
ok gilles@
2012-10-16consistent macros; Tim van der MolenJason McIntyre
2012-10-16MAX_RULEBUFFER_LEN is too small, bump it.Eric Faurot
discussed with gilles@
2012-10-16Prevent a possible buffer overflow in lka_expand_format() that can leadEric Faurot
to a server crash, and let the smtp session fail if that happens. spotted by todd@, discussed with eric@ and chl@ commited for gilles@
2012-10-15tweak previous; ok ericJason McIntyre
2012-10-15implement and document "smtpctl stop"Eric Faurot
ok gilles@
2012-10-15use shorter names for process titles.Eric Faurot
ok gilles@ chl@
2012-10-14As discussed with gilles@, actually impose the per-user limit regardlessEric Faurot
of the delivery method. Bump the limit a bit. requested by and ok gilles@
2012-10-14Limit the number of per-user mda (external program) deliveries that can beEric Faurot
running at the same time. It prevents a user from consuming all mda "slots" with a long-running filter in his .forward file. Other delivery types are not affected. ok gilles@ chl@
2012-10-14When pushing too many envelopes to the mda at once, we can hit a filedescEric Faurot
exhaustion situation that kills the server. For now, put a safe limit on the number of envelopes sent by the queue process to the mda. ok gilles@ chl@
2012-10-14enforce different permissions on different files in ssl_load_file()Alexander Hall
with gilles and eric, tested by me and gilles ok gilles@
2012-10-14substitute wrong comas into semicolonsCharles Longeau
ok gilles@ eric@
2012-10-14mistakenly removed an ".Xr smtpd 8"Gilles Chehade
spotted by jmc@
2012-10-14replace 'plain' with 'file' as the backend source name for map_file.cGilles Chehade
2012-10-14missing from previous commit, byebye map_stdio.cGilles Chehade
ok eric@ and chl@
2012-10-14introduce map_file.c which will deprecate map_stdio.cGilles Chehade
The idea is to have a file-backed map but to have smtpd(8) cache the maps so that it cannot be partially read if edited while mail is received. The file is read and converted to a static map (map_static.c), changes aren't visible to smtpd until an explicit: smtpctl update map which reads file, builds a new static map and invalidates the former. partial-read issue discussed with beck@ and halex@ idea to convert internally to a static map by eric@ diff ok eric@ and chl@
2012-10-14smtpctl show runqueue no longer exists, it's been that way for a whileGilles Chehade
2012-10-13missing headerGilles Chehade
2012-10-13in aliases expansion, we can avoid requesting parent for ~user/.forward, ifGilles Chehade
we check that user is a system user first before sending the imsg
2012-10-13when makemap is executed in sendmail mode, check if ".db" is part of theGilles Chehade
filename and imply it otherwise so that the following works: makemap hash /etc/mail/aliases < aliases
2012-10-13Make map_lookup() and make_compare() set errno on failure to distinguishEric Faurot
between "no match" and "internal error" (e.g. missing or broken db file). Adapt alias expansion and ruleset matching code to check for such errors, in which case the current processing is aborted, and a temporary failure is reported to the smtp session. ok gilles@
2012-10-12Extend the "retry" field to 16 bits. The new quadratic retry formulaEric Faurot
makes the maximum retry delay a bit to small on 8 bits. ok gilles@ chl@
2012-10-11- if argc / argv not empty after getopt() loop, display usageGilles Chehade
2012-10-11- no need to assign a separator to the last route flag since we're notGilles Chehade
going to use it