summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
2010-04-11Increase limit on the length of "user" in user@domain.com to a valueJacek Masiulaniec
higher than specified in rfc. Too many mailers don't conform to it, and it is harmless as far as I can see. From Tim van der Molen <tbvdm@xs4all.nl> OK gilles@
2010-04-07Remove XXX comment and just close received fd if calloc() fails.Nicholas Marriott
If this happens the imsg may no longer be usable as there may be queued messages, but this is a) already the case with the code now, and b) would be the case if recvmsg() fails anyway, so we can document that -1 from imsg_read() invalidates the struct imsgbuf. discussed with and ok eric
2010-03-03tweak mda.c rev. 1.36: eliminate risk of busy waiting for socketJacek Masiulaniec
to become writable, and make code more idiomatic. tested by nicm@ ok gilles@
2010-03-03tweak mda.c rev. 1.36: eliminate risk of busy waiting for socketJacek Masiulaniec
to become writable, and make code more idiomatic. tested by nicm@ ok gilles@
2010-03-01mda_event() assumed the mbox fp to be a file when it could be a pipe, doGilles Chehade
not fatal on read/write errors otherwise a broken pipe in an external mda will bring smtpd down. mda_store() assumed write would succeed and fatal otherwise, change code so that EINTR/EAGAIN trigger a new write while other errors gracefully return causing the message to be rescheduled later. these two prevent a fatal() from being hit when execution of a filter or external mda fails (bug experienced and fix verified by nicm@) while at it, fix a small bug where logs would not display the recipient when mail went through a ~/.forward / aliases expansion.
2010-03-01typo in warning logGilles Chehade
spotted by Seth Wright <seth@crosse.org>
2010-02-28the netmask fix I commited a couple days ago lacked the AF_INET6 bits,Gilles Chehade
this commit fixes pr user/6328 bug reported and fix verified by Martin Hedenfalk <martinh@bzero.se>
2010-02-26- fix netmask matching for AF_INET, it was broken in many ways, problemGilles Chehade
was reported by nicm@ which spent a couple hours with me trying to understand what was causing the bug, and helping me write and test fix.
2010-02-25fix incorrect reference; ok jmc@ gilles@ jacekm@Kevin Steves
2010-02-23add remove command; ok jmc@ gilles@Kevin Steves
2010-02-23Add a description for message-id and message-uid (text from gilles@).Kevin Steves
Also combine the two schedule commands with uid/id into one. help and ok jmc@ and gilles@
2010-02-17in map_stdio_get() use strdup on the right buffer, not on a pointer thatGilles Chehade
will be NULL 99% of the times... fixes segv in path that's not enabled yet
2010-02-17erf, previous fix to lka crash was still using the wrong define ...Gilles Chehade
2010-02-17the map api becomes backend-agnostic with initial support for db(3) andGilles Chehade
stdio(3) backends, though for now we only enable db(3). this is the first commit of a serie to improve maps and everything related. idea discussed with and diff okay jacekm@
2010-02-17localpart of a struct path may legally exceed MAXLOGNAME, causing lka toGilles Chehade
fatalx() on a lowercase() call in some cases. make sure lka uses a buffer capable of holding a localpart, and do not attempt getpwnam() if we know it's going to fail anyway... issue reported by Ben Lindstrom <mouring@eviladmin.org>
2010-01-11Fix wrong logic in error checking of buf_dynamic, found by pcc.Jacek Masiulaniec
2010-01-10- teach runner how to remove a message from queue given a message id/uidGilles Chehade
and assuming message is not in processing/scheduled state - teach smtpctl how to request message removal from runner discussed with todd@, idea ok jacekm@
2010-01-10have smtpd errx() at startup if no hostname could be detected either fromGilles Chehade
a gethostname() call or from a hostname directive in smtpd.conf discussed with jacekm@, i initially intended to only warn but errx seems to be a better solution for now
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@
2010-01-02Replace 3 struct smtp_client members (ssl_handshake, rcptokay, dying) with aJacek Masiulaniec
bitmap called "flags".
2010-01-02Factor out parts of client_read() into client_socket_read() andJacek Masiulaniec
client_get_reply(), downsizing it from 170+ to just over 30 lines. The gotos are now gone, too.
2010-01-02Simplify code by removing struct smtp_client member, int iomode, which wasJacek Masiulaniec
used for keeping track of the current polling mode. Introduce new function client_poll() that determines what mode of polling is required at the time of call.
2009-12-31when separating command from parameters in smtp session, the parser triesGilles Chehade
to use ':' as a separator then fallbacks to ' ' so that it can detect the command names that contain more than one words (MAIL FROM and RCPT TO) or the one word ones (HELO, DATA, ...). this is incorrect and the parser can get confused if the parameter to any command contains a ':', for example "HELO [ipv6:...]" cause the parser to lookup for command "HELO [ipv6". fix this by using ':' as a delimiter for 'mail from' and 'rcpt to', while using ' ' as a delimiter for all other commands. fixes bug 6285/system reported by Lionel Le Folgoc <lionel@lefolgoc.net>
2009-12-24kill PATH_RUNQUEUEHIGH and PATH_RUNQUEUELOW, i had great plans for them butGilles Chehade
they're still unused months later and there's many ways to achieve having a set of priorities on envelopes without needing additionnal queues.
2009-12-23Implementation of RFC 2920 PIPELINING extension, client side only for now.Jacek Masiulaniec
This restructures the client_* API internals significantly. The code becomes pipelining in nature. All SMTP commands are put on the output queue and dequeued as quickly as possible. Once dequeued, they're moved to the receive queue so that replies can be matched with previous commands. Dequeuing commands from the output queue halts when the count of commands currently in-pipeline (``cmdi'') is equal to the command send window (``cmdw''). There are three cmdw values useful in practice: 0 clear pipeline, ie. inhibit all future sends 1 disable pipelining, ie. use old ``one-request-one-reply`` mode SIZE_T_MAX enable pipelining, ie. dequeue as many commands as possible At the beginning of session cmdw is 1. When it is found that peer supports PIPELINING, it grows to SIZE_T_MAX. After dequeing DATA it is again 1. After sending QUIT it is 0. Each command dequeued from the output queue becomes a buf in a msgbuf. The act of combining multiple commands into a single send operation did not need to be implemented: buf_write() already combines bufs using iovec and sends them at once using sendmsg(2). Tested by todd@ and oga@ "looks good" to gilles@
2009-12-16Don't lose a line each time a chunkful of content is read off the disk.Jacek Masiulaniec
Problem spotted by todd@
2009-12-16Fix RCPT TO failure handling, bug introduced in r1.18.Jacek Masiulaniec
2009-12-15Simplify SSL code client-side, no functional change.Jacek Masiulaniec
2009-12-15Must aim better.Jacek Masiulaniec
2009-12-14Handle 6yz code as permanent error.Jacek Masiulaniec
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-14Set initial session limit so that IMSG_SMTP_ENQUEUE can be satisfied evenJacek Masiulaniec
in absence of all other real listening sockets. Spotted by todd@
2009-12-14Control maximum number of bounce sessions similarly to how the mta and mdaJacek Masiulaniec
are now controlled.
2009-12-14Clear S_MESSAGE_PERMFAILURE when creating the bounce message. Makes theJacek Masiulaniec
bounce mails visible in mailq output.
2009-12-14Impose sessions limit on the delivery sessions (mta and mda).Jacek Masiulaniec
2009-12-14Do non-blocking I/O when delivering locally over a pipe.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-12-13typoJacek Masiulaniec
2009-12-12When acting as a client do content reads from the disk progressivelyJacek Masiulaniec
as the remote accepts more data instead of doing one big read into the memory in the beginning of session.
2009-12-12Simplify client_* api, mainly by making fatal conditions result in immediateJacek Masiulaniec
fatals instead of passing the error up (kills ~300 lines). Implement sending of the QUIT command which replaces crude close(2). tested by gilles@, todd@
2009-12-12Don't qualify empty sender address with the domain, eg. in sendmail -f "<>".Jacek Masiulaniec
2009-12-10Fix a case when 2yz status would not override existing 4yz one.Jacek Masiulaniec
Reported by jsing@
2009-12-10Fix few read overruns found by parfait.Jacek Masiulaniec
Nudge by deraadt@
2009-12-07Avoid dereferencing a null pointer when logging a DNS lookup failure.Joel Sing
ok gilles@
2009-12-06fix previousJacek Masiulaniec
2009-12-05fix interface tagging listeners in the ipv6 caseCharles Longeau
while there factor some common code (from jacekm input) ok jacekm@
2009-12-02log_warn() consistency.Michael Knudsen
`OK' claudio
2009-11-26fix copy & paste error: IMSG_MTA_RESUME --> IMSG_MDA_RESUMECharles Longeau
ok gilles
2009-11-23In "smtpd; smtpd;" the second instance would fatal quickly, but it wouldJacek Masiulaniec
remove the smtpd.sock file, without which /usr/sbin/sendmail will fail causing mails to be queued in offline. Initially reported by ian@, may explain oga@'s e-mail burst after smtpd restart.
2009-11-17Fix handling of 5yz response to EHLO, ie. fallback to HELO.Jacek Masiulaniec