summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
2008-12-18Check fwrite return code at DATA stage.Jacek Masiulaniec
Add basic line length checking, as required by rfc. It is no longer required to disable EV_READ upon evbuffer_readline failure. ok gilles@
2008-12-18- condition lists is wrongly described, unbreak the following syntax:Gilles Chehade
"accept for { domain "foo", domain "bar" } ..." From Nicholas Mariott <nicholas.marriott@gmail.com>
2008-12-18Don't err() on blank lines.Jacek Masiulaniec
ok gilles@
2008-12-18Cleanup /incoming before handling each MAIL FROM.Jacek Masiulaniec
Improve cleanup condition to cover more cases. ok gilles@
2008-12-17Warn if empty map is being created; this catches at least usageJacek Masiulaniec
error such as "makemap foo.db". ok gilles@
2008-12-17Merge newaliases into makemap.Jacek Masiulaniec
ok gilles@
2008-12-17Introduce /purge, where all msgs scheduled for deletion are put byJacek Masiulaniec
queue, and removed from disk by runner. On startup, clean /incoming by moving msgs within it to /purge. ok gilles@
2008-12-14Files under /incoming don't need flock(2)ing anymore.Jacek Masiulaniec
ok gilles@
2008-12-14O_TRUNC is redundant if O_EXCL is specified.Jacek Masiulaniec
ok gilles@
2008-12-14O_TRUNC is redundant if O_EXCL is specified.Jacek Masiulaniec
ok gilles@
2008-12-14queue_create_incoming_layout must return 0 on failure, not -1.Jacek Masiulaniec
ok gilles@
2008-12-13IMSG_* namespace cleanup.Jacek Masiulaniec
ok gilles@
2008-12-13Detect alias duplicates.Jacek Masiulaniec
ok gilles@
2008-12-13Fix few parsing bugs in parse_entry, most severe of which wasJacek Masiulaniec
segv on lines consisting exclusively of whitespace. ok gilles@
2008-12-13Simplify parse_entry; streamline the code to call db->put in oneJacek Masiulaniec
place, regardless of number of preexisting aliases. Don't call db->sync; it's covered by db->close shortly before rename. ok chl@ gilles@
2008-12-13If parse_aliases fails, don't warn about syntax errors; it may failJacek Masiulaniec
for other reasons. Never exit outside main; we need to return to main to clean the temp file. Check parse_entry return code; otherwise $? == 0 even when invalid entries were found. ok gilles@
2008-12-13Use mkstemp instead of mkdtemp; also, add more X's.Jacek Masiulaniec
Do chmod before rename to eliminate short time window when aliases.db is "official" but not readable. Use PATH_ALIASESDB instead of hardcoding "/etc/mail/.." Check db->close return code. ok gilles@ henning@
2008-12-13- Correct usage text.Jacek Masiulaniec
- Drop static qualifiers. - Drop unused -d switch. - Use 0/1 exit codes instead of <sysexits.h> defines. ok gilles@
2008-12-13Declare alias_parse in smtpd.h, and fix callers that pass it wrongJacek Masiulaniec
number of arguments. ok gilles@
2008-12-12Format string checking for bsnprintf.Jacek Masiulaniec
ok gilles@
2008-12-12Kill references to smtpdb(8).Jacek Masiulaniec
ok gilles@
2008-12-11- last snprintf -> bsnprintfGilles Chehade
2008-12-11- snprintf -> bsnprintfGilles Chehade
2008-12-11- snprintf -> bsnprintfGilles Chehade
2008-12-11- snprintf -> bsnprintfGilles Chehade
2008-12-11- snprintf -> bsnprintfGilles Chehade
- makemap and newaliases need util.c now
2008-12-11- snprintf -> bsnprintfGilles Chehade
2008-12-11- snprintf -> bsnprintfGilles Chehade
2008-12-11- fix a bug that would cause the runner to hit a fatal() when running outGilles Chehade
of luck under load. Long story made short: the runner process opens the queue and sequentially opens each bucket to process messages. If a message is delivered by MDA/MTA after the opendir(), then the queue process will garbage collect the message from the queue and the runner will attempt to opendir() a path that no longer exists. Reported by Daniel Lidberg <daniel.lidberg@gmail.com>, observed by jacekm@ and debugged by me, that's collaborative work ;-)
2008-12-11- document showqueue and showrunqueueGilles Chehade
2008-12-11- missing prototypeGilles Chehade
2008-12-11- bsnprintf() is a wrapper to snprintf() that can be used when we handle anGilles Chehade
encoding error or a truncation the same way. This will turn many of our snprintf() checks into boolean checks.
2008-12-10That the "aliases" and "virtual" maps satisfy m_src == S_DB is checkedJacek Masiulaniec
too late, ie. at alias resolution time, and it's only a log_info. Move the check to parse.y, and make daemon die if m_src != S_DB. ok gilles@
2008-12-07Simplify queue_record_incoming_envelope.Jacek Masiulaniec
ok gilles@
2008-12-07Disable EV_READ when sending IMSG_PARENT_AUTHENTICATE.Jacek Masiulaniec
This is for consistency, code is not reached yet. ok gilles@
2008-12-07Replace evbuffer_add_printf calls with wrapper function, session_respond,Jacek Masiulaniec
which additionally suffixes <CRLF>, and enables EV_WRITE. Remove bufferevent_enable(.., EV_WRITE) from session_command and session_pickup so that EV_WRITE is enabled in exactly one place, session_respond. Change some responses slightly to make code fit 80 columns. ok gilles@
2008-12-07- getaddrinfo() uses negative values for its error defines, our use of anGilles Chehade
u_int8_t to hold the value leads to invalid checking in runner_batch_resolved(), this lead to a crash in MTA because we assumed a batch had its mx resolved when it had not. while at it, be more strict about errors we don't know and fatal(), it should not happen. ok jacekm@, ok chl@
2008-12-07- fix function name in fatal()Gilles Chehade
2008-12-07Don't check / reset s->s_msg.datafp where its state is obviously known.Jacek Masiulaniec
2008-12-06Make queue_delete_incoming_message not fatal on ENOENT condition.Jacek Masiulaniec
Also, fix function name in fatals. ok gilles@
2008-12-06Get rid of anonymous unions. Discussed with and ok gilles@Paul de Weerd
2008-12-06In session_destroy, use "if (s->s_state >= S_MAIL)", and notJacek Masiulaniec
"if (s->s_state > S_MAIL)". Otherwise, session timeout after MAIL FROM would leave mess in queue. ok gilles@
2008-12-06Don't include <err.h> where log.c API must be used.Jacek Masiulaniec
ok gilles@
2008-12-06- fix spelling and grammar, From Nicholas Marriott <nicm__@ntlworld.com>Gilles Chehade
2008-12-06Unbreak -Werror.Jacek Masiulaniec
ok gilles
2008-12-06the ellipsis allows more than one argument being specified.Igor Sobrado
discussed with gilles@ ok jmc@
2008-12-06smtpctl(8) was committed after 4.4.Igor Sobrado
ok gilles@
2008-12-06NULL-ify s_msg.datafp upon fclose unconditionally.Jacek Masiulaniec
ok gilles
2008-12-06- teach smtpctl how to inspect queue and runqueue, it supports two commandsGilles Chehade
`showqueue' which displays the content of the queue (all envelopes) `showrunqueue` which displays envelopes scheduled for delivery. The utility will be improved and extended, but for now we need at least this basic support to help debug queue-related issues. Output format is spamdb-alike: type|envelope uid|sender|recipient|last delivery date|retry count ok jacek@
2008-12-06evbuffer_readline already strips <CRLF> so that callers don't have to.Jacek Masiulaniec
ok gilles