summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
2009-06-08revert this change by eric@:David Gwynne
Make the imsg protocol network-safe. it might be network safe, but half the imsg based daemons on my firewalls dont run anymore.
2009-06-07Change the way fds passed over a socket are retreived on the receiving side.Eric Faurot
Currently the receiver fetches an imsg via imsg_get() and if he expects an fd, he then calls imsg_get_fd() to fetch the next fd queued on the imsgbuf from which the imsg came. This changes hides the fd queueing mechanism to the API user. When closing an imsg with an fd, the message is flagged so that the receiving end knows it must dequeue the fd in imsg_get() and return it with the imsg structure. This way there is no (less) possible screw up from imsg_get_fd() not being called directly after imsg_get() by the user. The retreived imsg is self-contained. ok pyr@, "I like that" henning@
2009-06-07Make the imsg protocol network-safe.Eric Faurot
ok pyr@
2009-06-06change the imsg header fields a bit to prepare for upcoming changes.Eric Faurot
add a flag field, use u_int32_t for pid_t and extend type to 32 bits for padding. ok pyr@
2009-06-06Get ready for including imsg.h from a lib, when it comes along.Pierre-Yves Ritschard
2009-06-06shuffle code around to achieve 0 length diff nirvana between all thePierre-Yves Ritschard
currently synced daemons' imsg.c, imsg.h and buffer.c
2009-06-06remove unnecessary and scary pid check in imsg_init.Pierre-Yves Ritschard
ok eric@, claudio@
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-06if smtpctl is run in unsupported mode, exit with a warning instead ofJacek Masiulaniec
defaulting to smtpctl-mode; aja@ ok
2009-06-05if path in "deliver to maildir path" is omitted, use ~/Maildir byJacek Masiulaniec
default; from gilles@
2009-06-05Remove unneeded function that prepends mail with "From " marker.Jacek Masiulaniec
mail.local(8) does it for us in mbox case, maildir doesn't need this, and in ext. mda case we delegate it to the external program. committing on gilles@'s behalf
2009-06-05bring buf_write which is going to be needed for bgpd.Pierre-Yves Ritschard
2009-06-05make smtpd's imsg lib ready, just like relayd and ospfd.Pierre-Yves Ritschard
ok gilles@, jacekm@
2009-06-05Destroy gilles' fantasy function.Pierre-Yves Ritschard
ok by a desillusionned gilles@
2009-06-03simplify struct batch; ok gilles@Jacek Masiulaniec
2009-06-03rename sc_config to sc_conffile since that's what this field is about, itGilles Chehade
will prevent a confusion with sc_config which will be a pointer to the actual configuration.
2009-06-03Improve error checking for the secrets encoding function; ok gilles@Jacek Masiulaniec
Pointed out by giovanni <qgiovanni@gmail.com>
2009-06-02make env->sc_listeners and env->sc_ssl pointers, one step further towardGilles Chehade
configuration reloading without killing active sessions; ok jacekm@
2009-06-01yet another cleanup in mfa/lka, don't roll their own loops to release mapsGilles Chehade
and rules when config.c provides us with purge_config(), PURGE_MAPS and PURGE_RULES. kills lots of lines with no functionnal change. ok jacekm@
2009-06-01add new file ruleset.c with code related to the ruleset matching, and killGilles Chehade
the two or three "almost" identical versions of ruleset matching loops from lka and mfa by having one unified function in ruleset.c; ok jacekm@ while at it, bring maildir support back to life; trivial one-liner by me
2009-06-01propagate the recipient domain through aliases expansion, this fixes a bugGilles Chehade
that would trigger when smtpd.conf does not have an "accept for local" rule and we attempt to deliver to a domain for which we are a destination. spotted by jacekm@, fix by me and ok jacekm@
2009-06-01No need for save_getpwuid and such functions which call endpwent.Theo de Raadt
endpwent is not needed unless setpwent (with stayopen = 1) or getpwent was used. getpwuid/getpwnam do not use getpwent; i think people must be assuming this. we are going to improve the man pages for this. ok gilles
2009-06-01fix function name in log_debugJacek Masiulaniec
2009-06-01display ssl negociation information in the received line of incomingGilles Chehade
sessions; ok jacekm@
2009-06-01Don't destroy listening socket when pause/resume request is received,Jacek Masiulaniec
use event_del/event_add instead; ok gilles@
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-31when entering mta_connect() reset session fd to -1Gilles Chehade
when connect timesout and we close the fd, reset session fd to -1 in session_destroy(), only attempt to close session fd if != -1 fixes a fatal in session_destroy() which happened because we closed a fd after a timeout, but the session still assumed the fd to be opened.
2009-05-30It is now possible to specify a certificate to use when relaying to anotherGilles Chehade
host which requests client certificates: accept [...] relay via [...] ssl certificate "mycert" diff from Josh Elsasser <josh@elsasser.org>, tested and okayed by me with no change but the addition of status 554 to the state machine to deal with remote host telling us it doesn't like our certificate.
2009-05-30fatal on setsockopt() failuresGilles Chehade
2009-05-30increment mta.sessions in when we allocate a new session in mtaGilles Chehade
2009-05-30- increment stats.mta.sessions_active when session is allocated in mtaGilles Chehade
- reorder alphabetically and add mta to the statistics
2009-05-30fix a bug where sessions_active counter, used to compute accept limits, wasGilles Chehade
decremented below 0 after the recent change that moved stats to shared mmap memory. session_destroy() which is called from mta and smtp processes didnt differentiate between them and decremented the counter when we had outgoing sessions destroyed.
2009-05-28Log the incoming message size; ok gilles@Jacek Masiulaniec
2009-05-28Log the "for <foo@bar.com>" part in the Received field; ok gilles@Jacek Masiulaniec
2009-05-28Match SMTPAUTH documentation with reality; ok gilles@Jacek Masiulaniec
2009-05-27temporary fix to a ruleset processing bug that stems from the factJacek Masiulaniec
that the ip address/subnet parsing isn't done in the same way as in other daemons. fix by gilles@
2009-05-27Insert Received: at receive time instead of delivery time; ok gilles@Jacek Masiulaniec
2009-05-27After a successful AUTH command completes, reject any further AUTH commands.Jacek Masiulaniec
ok gilles@
2009-05-27request flood mitigation:Jacek Masiulaniec
1) each state may have 2 responses sent quickly; 2) more responses are delayed exponentially, up to a defined limit. Delay count is user visible (smtp.errors.delays). ok gilles@
2009-05-25merge smtp_listener_setup into its only caller; ok gilles@Jacek Masiulaniec
2009-05-25Recent event masking scheme change turned the S_GREETED and S_HELO casesJacek Masiulaniec
in session_pickup into unreached code, so remove them; ok gilles@
2009-05-25Disallow submission using /usr/sbin/sendmail while the server isJacek Masiulaniec
paused, configuring, or exiting; ok gilles@
2009-05-24Parent process shouldn't be base64-decoding untrusted strings, moveJacek Masiulaniec
this code to privsep smtp process; ok gilles@
2009-05-24Implement pipelining detection inside session_readline, makes the callingJacek Masiulaniec
code cleaner; 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-21no longer create a dynamic map with 127.0.0.1 and ::1 for every single ruleGilles Chehade
that has an implicit local source. instead we create static "localhost" map before the configuration file is parsed, we fill it with every single local address we can find, and we have rules with implicit local source reference that special map. this unbreaks a behavior which I hated and which prevented: accept for all relay from accepting relaying if LOCAL session was initiated on any interface but lo0.
2009-05-21fix sockaddr_storage lenght check in mfa_check_source()Gilles Chehade
2009-05-20Delay enabling of EV_READ until S_INIT (smtps) or S_TLS (starttls).Jacek Masiulaniec
ok gilles@
2009-05-20previous commit to add reload support was missing some code, this diffsGilles Chehade
contains the missing parts + a memleak plug