summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtp.c
AgeCommit message (Collapse)Author
2009-03-15since we are going to share code in smtp sessions and mta sessions, we needGilles Chehade
to also share the statistics structure, still being worked on
2009-03-15save 4 bytes per message by moving the datafp field of struct message toGilles Chehade
struct session where it really belongs.
2009-02-23add missing headers needed by time()Charles Longeau
ok jacekm@ gilles@
2009-02-22add missing headersCharles Longeau
ok gilles@
2009-02-22replace MAX* constants by sizeof where possibleOleg Safiullin
ok jacekm@
2009-02-18previous commit was incomplete, this fixes ssmtpGilles Chehade
2009-02-18smtp_accept() now requests from lka that it performs the hostname lookupGilles Chehade
and inserts the session into the session tree. session_init() is called only when we receive the resolution answer. this fixes a race condition that would sometimes cause the hostname to appear as "<unknown>" in headers just because dns was lagging, and it unbreaks ssmtp support which suffered from th very same race condition.
2009-02-17after a message has been commited to queue, do not incondtionnally clearGilles Chehade
the message id and uid immediately. only do it if session has been flagged with F_QUIT, otherwise session_pickup() will do it when in state S_DONE. this fixes a bug reported by pea@ where the message id was not displayed in the "message accepted for delivery" line.
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-30improve statistics for smtp process. not only collect the current sessionsGilles Chehade
count, but also the total sessions count, ssmtp sessions (both current and total) and starttls sessions (both current and total) # ./smtpctl/smtpctl show stats|grep smtp.sessions smtp.sessions = 0 smtp.sessions.active = 0 smtp.sessions.ssmtp = 0 smtp.sessions.ssmtp.active = 0 smtp.sessions.starttls = 0 smtp.sessions.starttls.active = 0 #
2009-01-30clear the F_EVLOCK flag earlier to prevent the error event handler fromGilles Chehade
being called again with F_EVLOCK set. this fixes a bug where disconnect after smtpd sends greeting and before entering any command failed to go into session_destroy(). while at it, rename the "smtp.clients" statistic to "smtp.sessions" and add counters to struct s_smtp so that I can add ssmtp and starttls with my next commit ;)
2009-01-30bump descriptors limit to the max and set the maximum connections count toGilles Chehade
three quarters of that limit (a session typically has 3 descriptors). when we hit that limit, we stop accepting connections, and when client closes a session, we start accepting connections again. this prevents us from going into a session that is likely to fail because of scarce resources. idea discussed with jacekm@, code mostly ripped from relayd
2009-01-30fix a very annoying events masking issue which would cause a fatal() to beGilles Chehade
hit under certain conditions; while tracking the bug I ran into other bugs which were kind of related and could cause us to hit a fatal() too. fix by me, but with lots of testing and investigation with jacekm@, ok jacekm@
2009-01-29Implement "smtpctl show stats"; ok gilles@Jacek Masiulaniec
2009-01-28when pausing listeners, do not simply disable their events as newGilles Chehade
clients would still be able to connect. instead, at pause time we close and remove the listeners, and at resume time we request the parent to reconfigure all listeners. discussed with pyr@
2009-01-04- smtp can now pause/resume the accepting of incoming messagesGilles Chehade
- smtpctl recognizes "pause incoming" and "resume incoming" - setup imsg communication between control process and smtp process
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-01remove unnecessary includes; ok gilles@Jacek Masiulaniec
2008-12-26parse.y doesn't allow listen backlog configuration, so "bzero default" is used.Jacek Masiulaniec
Hardcode it instead: 5 is a popular choice across the tree; ok gilles@
2008-12-22s->s_msg.session_hostname must hold resolved hostname as well; ok gilles@Jacek Masiulaniec
2008-12-21- missing prototype + smtp.c was misusing session_auth_pickup()Gilles Chehade
- unlike starttls, ssmtp sets the F_SECURE flag on session before helo/ehlo handlers are called. this means that if we clear all flags in helo/ helo handlers, we prevent smtpd from advertising AUTH as it will do so only for F_SECURE sessions. This commits unbreaks SMTP AUTH with smtp sessions. Problem spotted by James Turner <james@bsdgroup.org>
2008-12-21- AUTH PLAIN may receive credentials as a parameter to AUTH or on aGilles Chehade
following line, this commit brings support for the latter which was not supported yet. - AUTH LOGIN is now supported, allowing smtp auth support on clients that do not support AUTH PLAIN (ie: my mobile phone for instance ;)
2008-12-13IMSG_* namespace cleanup.Jacek Masiulaniec
ok gilles@
2008-12-03- fix event masking issues in smtp process which could lead to a fatal() ifGilles Chehade
queue process did not answer fast enough to an imsg. spotted by Jacek Masiulaniec <jacekm@dobremiasto.net> - queue layout was mostly to bootstrap the project, it does not behave good under load, it does complex things to stay in a recoverable state and it probably didnt do it too well. New queue code is simpler, smaller and allows for atomic submissions (a mail can never be in a state where it needs to be recovered). It still needs some work but works better than previous code, no regression.
2008-11-24- not really a bug since we don't use other descriptor flags, but inGilles Chehade
smtp_setup_events() and mta_connect(), our fcntl() use clears flags. use session_socket_blockmode() instead, it makes more sense anyway. From Jacek Masiulaniec <jacekm@dobremiasto.net>
2008-11-17add missing header needed by time(), ctime_r() and tzset().Charles Longeau
ok gilles@
2008-11-13- rephrase the "cannot load cert" warning that is output at startup when aGilles Chehade
listen directive has no matching certificate. it sounds like a critical failure when it just means "no tls support". - minor log_debug() addition in smtp.c
2008-11-11some small improvements. ok gillesTed Unangst
2008-11-11- queue process no longer schedules messages which do not have flagGilles Chehade
F_MESSAGE_COMPLETE - submit recipients to the queue as we read them from RCPT instead of submiting them all at once when DATA is over. this prevents us from having to keep a potentially large number of recipients in memory during the whole session. - remove all code that dealt with the recipients queue of a message as it is no longer used. - several small changes to make sure the server is always in a recoverable state in case of an unexpected shutdown.
2008-11-05add a few missing id tags; there are a bunch of files, and developersIgor Sobrado
will probably miss this change when working on more important matters, so it is probably better to sort them now. there is a risk of losing the tags if a change needs to be reverted too. written with excellent advice from jmc@ ok gilles@
2008-11-01smtpd is a smtp server implementation for OpenBSD. It is a work in progressGilles Chehade
which still lacks many features. bringing it in tree will help working on it more easily. "at this stage it should go in" henning@, "move ahead" deraadt@