CVS: cvs.openbsd.org: src

2019-05-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/05/13 21:20:12

Removed files:
usr.bin/ctfdump: elf.c 

Log message:
Remove leftover elf.c



CVS: cvs.openbsd.org: src

2019-05-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/05/13 21:16:55

Modified files:
usr.bin/ctfdump: Makefile ctfdump.c elf.c 

Log message:
Use elf(3) api instead of an ad-hoc elf parser.

Ok mpi@



CVS: cvs.openbsd.org: src

2019-05-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/05/13 20:32:08

Modified files:
usr.bin/ftp: main.c 

Log message:
Remove an unused and leftover label.



CVS: cvs.openbsd.org: src

2019-05-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/05/13 20:30:00

Modified files:
usr.bin/ftp: http.c 

Log message:
tls_write(3): Handle short writes.

Ok jca@



CVS: cvs.openbsd.org: src

2019-04-16 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/04/16 07:58:45

Modified files:
share/man/man4 : rd.4 

Log message:
elfrdsetroot is now rdsetroot(8).

ok deraadt



CVS: cvs.openbsd.org: src

2019-04-15 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/04/16 00:09:52

Modified files:
usr.sbin/rdsetroot: Makefile rdsetroot.c 
Removed files:
usr.sbin/rdsetroot: elf32.c elf64.c elfrd_size.c rdsetroot.h 

Log message:
Rewrite using libelf(3).

Lots of help with build/tests on sparc64 from jsg@, thank you.
ok deraadt



CVS: cvs.openbsd.org: src

2019-03-16 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/03/16 10:35:03

Modified files:
usr.bin/ctfdump: ctfdump.c 

Log message:
Fix a buffer over-read while dumping functions.

A bogus vlen in metadata could cause offset point beyond CTF section
boundary. Found by afl-fuzz.

Ok mpi@



CVS: cvs.openbsd.org: src

2019-03-16 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/03/16 09:34:58

Modified files:
usr.bin/ctfdump: ctfdump.c 

Log message:
Fix a buffer over-read while dumping structs/unions.

A bogus vlen in metadata could cause offset point beyond CTF section
boundary. Found by afl-fuzz.

Ok mpi@



CVS: cvs.openbsd.org: src

2019-03-16 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/03/16 01:36:56

Modified files:
usr.bin/ctfdump: ctfdump.c 

Log message:
Fix a buffer over-read while dumping enums.

A bogus vlen in metadata could cause offset point beyond CTF section
boundary.  Found by afl-fuzz.

Feedback and Ok mpi@



CVS: cvs.openbsd.org: src

2019-02-18 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/02/18 04:05:43

Modified files:
usr.bin/ctfconv: ctfstrip 

Log message:
Using getopt(1) is more idiomatic and consistent with other scripts.

Ok mpi@



CVS: cvs.openbsd.org: src

2019-02-18 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/02/18 04:01:49

Modified files:
usr.bin/ctfconv: ctfstrip 

Log message:
Fix in-place stripping by using correct form of parameter substitution.

Ok mpi@



CVS: cvs.openbsd.org: src

2019-01-29 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/01/29 22:49:47

Modified files:
usr.sbin/smtpd : mail.lmtp.c 

Log message:
Check ferror(3) on the right stream.

Ok gilles@



CVS: cvs.openbsd.org: src

2019-01-21 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/01/21 04:27:30

Modified files:
usr.sbin/smtpd : mail.lmtp.c 

Log message:
While using buffered stdio over a socket, fflush(3) command before
reading the response.

Ok eric@ jung@



CVS: cvs.openbsd.org: src

2019-01-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2019/01/14 21:49:50

Modified files:
usr.sbin/smtpd : lka_filter.c 

Log message:
Swap 'token' and 'id' place in filter protocol.

This allows to consistently extract 'id' from both 'report' and
'filter' lines.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2018-12-08 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/12/08 01:01:15

Modified files:
usr.sbin/smtpd : bounce.c envelope.c queue.c scheduler.c smtpd.h 

Log message:
Use correct RFC 3464 specified values for Action field in a DSN.
error -> failed
success -> delivered

This fixes DSN parsing for Mailman. Issue reported by Cristiano
Costa on m...@opensmtpd.org.

While here, rename enums to reflect the intent and properly handle
envelope ascii load/dump to understand change in the values.

Suggestions and ok gilles@



CVS: cvs.openbsd.org: src

2018-04-23 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/04/23 04:27:24

Modified files:
usr.sbin/smtpd : enqueue.c 

Log message:
Allow escaping quote within quotes.

Leah Neukirchen reports that according to RFC5322 escaping quote
within quotes is valid and that postfix accepts it as well.
https://github.com/OpenSMTPD/OpenSMTPD/issues/846

Ok gilles@



CVS: cvs.openbsd.org: src

2018-04-10 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/04/10 08:37:08

Modified files:
usr.sbin/smtpd : spfwalk.c 

Log message:
Fix previous. Use inet_net_pton(3) instead of inet_pton(3) as
addresses could be listed with prefix.

Initial diff from Ryan Kavanagh, tweaked by me.
Ok millert@ gilles@



CVS: cvs.openbsd.org: src

2018-04-09 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/04/09 05:09:40

Modified files:
usr.sbin/smtpd : spfwalk.c 

Log message:
Check for legitimate IPv4, IPv6 addrs before printing.

Ryan Kavanagh reported on github that certain domains have misconfigured
SPF records.  https://github.com/OpenSMTPD/OpenSMTPD/issues/844

Ok millert@ gilles@



CVS: cvs.openbsd.org: src

2018-01-05 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/01/06 00:59:27

Modified files:
usr.sbin/smtpd : smtpctl.8 smtpctl.c 
usr.sbin/smtpd/smtpctl: Makefile 
Added files:
usr.sbin/smtpd : spfwalk.c 

Log message:
Import gilles@'s standalone spfwalk utility into smtpctl(8) as
'spf walk' command.

Ok gilles@



CVS: cvs.openbsd.org: src

2018-01-05 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/01/06 00:57:54

Modified files:
usr.sbin/smtpd : dns.c 
usr.sbin/smtpd/smtpd: Makefile 
Added files:
usr.sbin/smtpd : unpack_dns.c unpack_dns.h 

Log message:
Move unpack functions into a seperate file.

Required for upcoming 'smtpctl spf walk'.
Ok eric@ gilles@ millert@



CVS: cvs.openbsd.org: src

2018-01-03 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2018/01/03 04:12:21

Modified files:
usr.sbin/smtpd : lka.c 

Log message:
Use crypt_checkpass(3) instead of crypt(3).

Based on a diff from Edgar Pettijohn.
Ok gilles@ eric@



CVS: cvs.openbsd.org: src

2017-11-27 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2017/11/27 01:35:59

Modified files:
usr.sbin/smtpd : control.c lka.c 

Log message:
Show correct command execution status by checking against update
operation return value.

Issue reported by 'Zelest' (Jesper Wallin).
Suggestions and ok eric@ gilles@.



CVS: cvs.openbsd.org: src

2017-11-10 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2017/11/10 09:50:59

Modified files:
sys/lib/libsa  : softraid.c 

Log message:
"unknown KDF type 2" -> "keydisk not found".
Inputs and ok jsing@.



CVS: cvs.openbsd.org: src

2017-07-27 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2017/07/27 12:48:30

Modified files:
usr.sbin/smtpd : makemap.c smtpctl.c smtpd.h 

Log message:
smtpctl(8): Use an int to determine mode instead of __progname.

Ok millert@ gilles@



CVS: cvs.openbsd.org: src

2017-03-07 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2017/03/07 01:00:23

Modified files:
usr.bin/ftp: fetch.c 

Log message:
tls_close() can return TLS_WANT_POLLIN/TLS_WANT_POLLOUT, handle them
appropriately.

Ok jca@



CVS: cvs.openbsd.org: src

2016-09-01 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/09/01 04:01:53

Modified files:
usr.bin/mg : tags.c 

Log message:
Fix possible NULL pointer dereference.

Found by Coverity Scan.  The tagsvisit() function calls eread(),
which may return NULL.  This is then immediately passed to stat()
without a proper check.  This patch adds that check.

>From Joachim Nilsson  via lum@. Ok lum@



CVS: cvs.openbsd.org: src

2016-02-11 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/02/11 20:11:16

Modified files:
usr.sbin/smtpd : makemap.c smtpctl.c 

Log message:
Cleanup getopt(3) mis-use in sendmail compat code.

Avoid multiple getopt(3) evaluations without optreset set and
unspecified behavior of optind = 0 as per POSIX. Instead, iterate
over argv the first time for classification. Fixes -portable without
any divergence from -current, and all newaliases opts are handled
in one place.

Looks good to me millert@
Ok gilles@ jung@ eric@



CVS: cvs.openbsd.org: src

2016-02-09 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/02/09 04:50:49

Modified files:
usr.sbin/smtpd : mproc.c 

Log message:
r1.16 accidentally masked retries on EAGAIN introduced in r1.15.
Fix and simplify imsg_read() return value checking into a single
if..else block.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2016-02-02 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/02/02 22:57:09

Modified files:
usr.sbin/smtpd : bounce.c 

Log message:
Use "esc_class" to classify bounce type instead of "errorline" as
we no longer prepend status code to "errorline". Fixes mismatch
between DSN's subject line and its content.

Ok jung@ gilles@ millert@



CVS: cvs.openbsd.org: src

2016-02-01 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/02/01 22:45:27

Modified files:
usr.sbin/smtpd : control.c mda.c 

Log message:
Check imsg data size before use.

Ok eric@ millert@



CVS: cvs.openbsd.org: src

2016-01-27 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/27 05:46:03

Modified files:
usr.sbin/smtpd : queue.c smtpd.c smtpd.h 

Log message:
Check imsg data length before use.

Ok jung@ gilles@ eric@



CVS: cvs.openbsd.org: src

2016-01-19 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/19 07:51:00

Modified files:
usr.bin/mg : cscope.c 

Log message:
Bounds check while stripping trailing slashes. From max at
max-fillinger.net.

Ok lum@



CVS: cvs.openbsd.org: src

2016-01-19 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/19 04:39:06

Modified files:
usr.bin/mg : cscope.c tags.c 

Log message:
Update my mail address.



CVS: cvs.openbsd.org: src

2016-01-19 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/19 04:21:38

Modified files:
usr.bin/mg : cscope.c 

Log message:
Fix bad indents. From max at max-fillinger.net

Ok lum@ jasper@



CVS: cvs.openbsd.org: src

2016-01-19 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/19 04:15:39

Modified files:
usr.bin/mg : cscope.c 

Log message:
Check snprintf(3) return value for overflow instead of manual length
check. From max at max-fillinger.net.

Ok lum@ jasper@



CVS: cvs.openbsd.org: src

2016-01-19 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/19 04:13:02

Modified files:
usr.bin/mg : cscope.c 

Log message:
Skip empty entries in $PATH instead of erroneously interpreting
them as ".".

Ok lum@ jasper@



CVS: cvs.openbsd.org: src

2016-01-18 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/18 04:29:34

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
Load pki keys before daemon(3). Keys with passphrase require access
to stdin.

Ok millert@ jung@ gilles@



CVS: cvs.openbsd.org: src

2016-01-12 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2016/01/12 10:29:44

Modified files:
usr.sbin/smtpd : enqueue.c parse.y util.c 

Log message:
Let smtpd start on machines without a FQDN as hostname.

Ok millert@ gilles@ jung@



CVS: cvs.openbsd.org: src

2015-12-31 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/31 05:06:48

Modified files:
usr.bin/mg : tags.c 

Log message:
Return FALSE on parse errors.

Found by and Ok lum@.



CVS: cvs.openbsd.org: src

2015-12-22 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/22 08:59:10

Modified files:
usr.sbin/smtpd : smtpctl.c 

Log message:
Kill a trailing whitespace that snuck in with previous commit.



Re: CVS: cvs.openbsd.org: src

2015-12-22 Thread Sunil Nimmagadda
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   su...@cvs.openbsd.org   2015/12/22 00:39:00
> 
> Modified files:
> etc/mail   : Makefile 
> 
> Log message:
> Now that default smtpd.conf aliases table has been switched to
> 'file' backend, we no longer have to generate the .db files.
> 
> Ok gilles@

and Ok jung@ too, thanks.



CVS: cvs.openbsd.org: src

2015-12-21 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/22 00:52:52

Modified files:
usr.sbin/smtpd : table_static.c 

Log message:
Wrap long lines.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2015-12-21 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/22 00:54:57

Modified files:
usr.sbin/smtpd : delivery_mbox.c ioev.c 

Log message:
Wrap long lines.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2015-12-21 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/22 00:39:00

Modified files:
etc/mail   : Makefile 

Log message:
Now that default smtpd.conf aliases table has been switched to
'file' backend, we no longer have to generate the .db files.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-21 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/21 09:25:44

Modified files:
etc/mail   : smtpd.conf 

Log message:
Switch to 'file' backend for aliases table for default configuration.

Ok gilles@ jung@ millert@



CVS: cvs.openbsd.org: src

2015-12-21 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/21 04:20:07

Modified files:
usr.sbin/smtpd : smtpctl.c 

Log message:
Start accepting some sendmail compatible commandline arguments.

This diff teaches smtpctl to understand '-bi -O AliasFile='
and generate aliases.db.

Ok gilles@ jung@ millert@



Re: CVS: cvs.openbsd.org: www

2015-12-14 Thread Sunil Nimmagadda
> On Tue, Dec 08, 2015 at 08:27:46AM +0100, Sunil Nimmagadda wrote:
> > Thanks for spotting it, I missed this entry in etc/mail/Makefile.
> > The idea was to remove yet another executable and use smtpctl(8)
> > for makemap/newaliases. This diff should fix it. Instead of hardcoding
> > a specific implementation of makemap path, use the standard mailwrapper
> > makemap path which will call the configured executable in mailer.conf.
> >
> > Index: Makefile
> > ===
> > RCS file: /cvs/src/etc/mail/Makefile,v
> > retrieving revision 1.11
> > diff -u -p -r1.11 Makefile
> > --- Makefile26 May 2015 14:34:59 -  1.11
> > +++ Makefile8 Dec 2015 07:10:56 -
> > @@ -3,7 +3,7 @@
> >  # Generate the various .db versions from their source files.
> >
> >  DB_FILES= aliases.db
> > -MAKEMAP= /usr/libexec/smtpd/makemap
> > +MAKEMAP= /usr/sbin/makemap
> >
> >  all: ${DB_FILES}
>
> This breaks my system where I use sendmail from ports in /etc/mailer.conf.
>
> cd mail && exec make distribution
> install -c -o root -g wheel -m 644 aliases
/tmp/_etcdir.9nVgeOiVtS/etc/mail/
aliases
> /usr/sbin/makemap -t aliases -o /tmp/_etcdir.9nVgeOiVtS/etc/mail/aliases.db
/tmp/_etcdir.9nVgeOiVtS/etc/mail/aliases
> makemap: error opening type /tmp/_etcdir.9nVgeOiVtS/etc/mail/aliases.db map
/
tmp/_etcdir.9nVgeOiVtS/etc/mail/aliases: Unknown database type
> *** Error 73 in mail (Makefile:17 'distribution')
> *** Error 1 in /usr/src/etc (Makefile:203 'distribution-etc-root-var')
> *** Error 1 in /usr/src (Makefile:83 'build')
>
> man -a newaliases says
>
> Notice: do not use makemap to create the aliases data base, because
> newaliases puts a special token into the data base that is required by
> sendmail.
>
> bluhm

It is building aliases database and can be substituted with
newaliases(8). This should fix build when using sendmail too.  Could
you try this diff please...

Index: Makefile
===
RCS file: /cvs/src/etc/mail/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile8 Dec 2015 09:03:50 -   1.12
+++ Makefile15 Dec 2015 02:41:29 -
@@ -3,7 +3,6 @@
 # Generate the various .db versions from their source files.

 DB_FILES= aliases.db
-MAKEMAP= /usr/sbin/makemap

 all: ${DB_FILES}

@@ -13,8 +12,7 @@ clean:
 distribution:
${INSTALL} -c -o root -g wheel -m 644 aliases \
${DESTDIR}/etc/mail/aliases
-   ${MAKEMAP} -t aliases -o ${DESTDIR}/etc/mail/aliases.db \
-   ${DESTDIR}/etc/mail/aliases
+   newaliases
${INSTALL} -c -o root -g wheel -m 644 smtpd.conf \
${DESTDIR}/etc/mail/smtpd.conf
${INSTALL} -c -o root -g wheel -m 644 spamd.conf \



CVS: cvs.openbsd.org: src

2015-12-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/14 03:38:40

Modified files:
usr.sbin/smtpd : mda.c 

Log message:
Wrap long lines.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/14 03:35:30

Modified files:
usr.sbin/smtpd : envelope.c 

Log message:
Wrap long lines and fix bad indents.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/14 03:31:25

Modified files:
usr.sbin/smtpd : bounce.c 

Log message:
Fix bad indents and whitespaces.

Ok jung@ gilles@



CVS: cvs.openbsd.org: src

2015-12-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/14 03:28:50

Modified files:
usr.sbin/smtpd : filter.c 

Log message:
Wrap long lines and whitespace fixes.

Ok jung@ gilles@



CVS: cvs.openbsd.org: src

2015-12-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/14 02:22:57

Modified files:
usr.sbin/smtpd : makemap.8 

Log message:
Document -d option.

Ok gilles@ jmc@



CVS: cvs.openbsd.org: src

2015-12-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/13 19:56:07

Modified files:
usr.sbin/mailwrapper: mailwrapper.8 mailwrapper.c 

Log message:
Update default MTA reference to smtpd(8). Rectify documentation of
fallback behaviour when configuration file is missing.

Documentation bits from Serguey Parkhomovsky.

Ok jung@ "if the fallback code stays"



CVS: cvs.openbsd.org: src

2015-12-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/13 04:06:19

Modified files:
usr.sbin/smtpd : makemap.c 

Log message:
Move some variables local to makemap().

Suggested by guenther@ Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-12 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/12 04:31:29

Modified files:
usr.sbin/smtpd : lka.c parse.y smtp.c smtp_session.c smtpd-api.h 
 smtpd.c smtpd.conf.5 

Log message:
Implement senders map.

senders table allows to restrict the addresses that an authenticated
user can use in the SMTP dialogue.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-12 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/12 03:26:57

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
In the configuration test mode (smtpd -n) setup queue crypto iff a
valid queue key is specified.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2015-12-10 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/11 00:44:59

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
New '-F' option to let smtpd run in foreground while logging to
syslog.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2015-12-10 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/10 07:07:04

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
free sc_queue_key only when it points to something other than "stdin"
string literal.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-10 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/10 02:33:50

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
Do not fatal when a log_warn suffices.

Ok jung@ gilles@



Re: CVS: cvs.openbsd.org: src

2015-12-10 Thread Sunil Nimmagadda
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   su...@cvs.openbsd.org   2015/12/10 00:49:59
> 
> Modified files:
> usr.sbin/smtpd : queue.c smtpctl.c 
> 
> Log message:
> While listing envelopes using mailq(or smtpctl show queue), pass
> the data between processes by dumping to and loading from a buffer
> which is shorter compared to transferring a structure.  Also fixes
> mailq on platforms where PATH_MAX is way larger than on OpenBSD
> thus exceeding max imsg.
> 
> Ok jung@ millert@

and Ok gilles@



CVS: cvs.openbsd.org: src

2015-12-09 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/10 00:49:59

Modified files:
usr.sbin/smtpd : queue.c smtpctl.c 

Log message:
While listing envelopes using mailq(or smtpctl show queue), pass
the data between processes by dumping to and loading from a buffer
which is shorter compared to transferring a structure.  Also fixes
mailq on platforms where PATH_MAX is way larger than on OpenBSD
thus exceeding max imsg.

Ok jung@ millert@



CVS: cvs.openbsd.org: src

2015-12-09 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/09 05:07:11

Modified files:
usr.sbin/smtpd : smtpd.conf.5 

Log message:
Document forward-only keyword. From Jason Barbier 

Ok gilles@ jung@



Re: CVS: cvs.openbsd.org: src

2015-12-09 Thread Sunil Nimmagadda
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   su...@cvs.openbsd.org   2015/12/09 01:13:28
> 
> Modified files:
> usr.sbin/smtpd/smtpctl: Makefile 
> 
> Log message:
> Install aliases(5), forward(5), makemap(8) and newaliases(8) manpages
> that got accidentally removed while merging makemap(8) into smtpctl(8).
> 
> Spotted by Nathanael Rensen.
> 

This was Ok gilles@.



CVS: cvs.openbsd.org: src

2015-12-09 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/09 01:13:28

Modified files:
usr.sbin/smtpd/smtpctl: Makefile 

Log message:
Install aliases(5), forward(5), makemap(8) and newaliases(8) manpages
that got accidentally removed while merging makemap(8) into smtpctl(8).

Spotted by Nathanael Rensen.



CVS: cvs.openbsd.org: src

2015-12-08 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/08 10:28:03

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
Let smtpd shutdown gracefully with a zero exit code when the priv
process receives a SIGINT/SIGTERM.

Initial diff by nfnty 

Ok gilles@ jung@ millert@



CVS: cvs.openbsd.org: src

2015-12-08 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/08 02:06:32

Modified files:
usr.sbin/mailwrapper: mailer.conf.5 

Log message:
Update EXAMPLES to use smtpctl(8).



CVS: cvs.openbsd.org: src

2015-12-08 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/08 02:03:50

Modified files:
etc/mail   : Makefile 

Log message:
Use mailwrapper path instead of smtpd.

Ok tb@ jung@



Re: CVS: cvs.openbsd.org: www

2015-12-07 Thread Sunil Nimmagadda
> On Mon, Dec 07, 2015 at 05:40:50AM -0700, Sunil Nimmagadda wrote:
> > CVSROOT:/cvs
> > Module name:www
> > Changes by: su...@cvs.openbsd.org   2015/12/07 05:40:50
> > 
> > Modified files:
> > faq: current.html 
> > 
> > Log message:
> > Document merging of makemap(8) into smtpctl(8).
> > 
> > Ok gilles@, jung@
> > 
> 
> I'm confused:
> 
> It says "$ rm -f /usr/libexec/smtpd/makemap", but etc/mail/Makefile
> still contains
> 
> MAKEMAP= /usr/libexec/smtpd/makemap
> [...]
> ${MAKEMAP} -t aliases -o ${DESTDIR}/etc/mail/aliases.db \
> ${DESTDIR}/etc/mail/aliases
> 
> thus breaking 'make build'.
> 
> If I read the source of smtpctl.c correctly, it seems that
> smtpctl/Makefile is missing a LINKS=... line and the above needs to be
> adjusted, no?
> 

Thanks for spotting it, I missed this entry in etc/mail/Makefile.
The idea was to remove yet another executable and use smtpctl(8)
for makemap/newaliases. This diff should fix it. Instead of hardcoding
a specific implementation of makemap path, use the standard mailwrapper
makemap path which will call the configured executable in mailer.conf.

Index: Makefile
===
RCS file: /cvs/src/etc/mail/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- Makefile26 May 2015 14:34:59 -  1.11
+++ Makefile8 Dec 2015 07:10:56 -
@@ -3,7 +3,7 @@
 # Generate the various .db versions from their source files.
 
 DB_FILES= aliases.db
-MAKEMAP= /usr/libexec/smtpd/makemap
+MAKEMAP= /usr/sbin/makemap
 
 all: ${DB_FILES}



CVS: cvs.openbsd.org: www

2015-12-07 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:www
Changes by: su...@cvs.openbsd.org   2015/12/07 09:17:56

Modified files:
faq: current.html 

Log message:
Indent.

Ok mpi@



CVS: cvs.openbsd.org: www

2015-12-07 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:www
Changes by: su...@cvs.openbsd.org   2015/12/07 05:40:50

Modified files:
faq: current.html 

Log message:
Document merging of makemap(8) into smtpctl(8).

Ok gilles@, jung@



CVS: cvs.openbsd.org: src

2015-12-07 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/07 05:29:19

Modified files:
usr.sbin/smtpd : Makefile enqueue.c makemap.c smtpctl.c smtpd.h 
usr.sbin/smtpd/smtpctl: Makefile 
Removed files:
usr.sbin/smtpd/makemap: Makefile 

Log message:
Merge makemap(8) into smtpctl(8).

Ok gilles@, jung@



CVS: cvs.openbsd.org: src

2015-12-07 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/12/07 05:32:06

Modified files:
etc: mailer.conf 

Log message:
Now that makemap(8)/newaliases(8) are merged into smtpctl(8), update
the paths.

Ok gilles@, jung@



CVS: cvs.openbsd.org: src

2015-11-30 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/11/30 05:26:55

Modified files:
usr.sbin/smtpd : envelope.c lka_session.c mda.c parse.y 
 smtpd.conf.5 smtpd.h 

Log message:
While delivering to lmtp or mda, accept optional "as user" parameter
whose privileges would be used instead of the default.

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2015-11-22 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/11/22 23:54:21

Modified files:
usr.sbin/smtpd : bounce.c queue.c 

Log message:
Restructure bounce content as a multi-part MIME message.
Content-Type header diff from Philipp Takacs bureaucracy.de>

Ok gilles@ jung@



CVS: cvs.openbsd.org: src

2015-11-05 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/11/05 02:14:32

Modified files:
usr.sbin/smtpd : control.c queue.c queue_backend.c queue_fs.c 
 smtpctl.8 smtpctl.c smtpd-api.h smtpd.c smtpd.h 

Log message:
Implement smtpctl uncorrupt 

"uncorrupt" moves envelopes from corrupt bucket back to the queue
for further discovery by the daemon.

After correcting the corrupt envelopes, admin could now...

# smtpctl uncorrupt msgid
# smtpctl discover msgid

to schedule the messages.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-11-05 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/11/05 01:59:23

Modified files:
usr.sbin/smtpd : queue_backend.c 

Log message:
Do not terminate message walk on a corrupt envelope.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-10-29 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/29 04:25:36

Modified files:
usr.sbin/smtpd : control.c queue.c queue_backend.c queue_fs.c 
 scheduler.c scheduler_ramqueue.c smtpctl.8 
 smtpctl.c smtpd-api.h smtpd.c smtpd.h 

Log message:
Implement smtpctl discover .

discover subcommand schedules envelopes manually moved to the queue.
It triggers a queue walk searching for envelopes with the given id,
schedules them and informs the user number of envelopes scheduled.
Admins no longer would need to restart the daemon to discover
manually moved messages.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-10-28 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/28 01:24:28

Modified files:
usr.sbin/smtpd : smtpctl.c 

Log message:
Remove dead code.

Ok jung@ gilles@



CVS: cvs.openbsd.org: src

2015-10-26 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/26 10:38:06

Modified files:
usr.sbin/smtpd : makemap.c 

Log message:
Fix makemap(8) for values containing a '#'.

Ok millert@ gilles@



CVS: cvs.openbsd.org: src

2015-10-19 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/19 03:15:35

Modified files:
usr.sbin/smtpd : delivery_lmtp.c 

Log message:
Kill whitespace at eol.

Ok gilles@



CVS: cvs.openbsd.org: src

2015-10-17 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/17 10:07:03

Modified files:
usr.sbin/smtpd : delivery_lmtp.c 

Log message:
Cleanup and simplify LMTP code.

Ok millert@ gilles@



CVS: cvs.openbsd.org: src

2015-10-17 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/17 10:20:46

Modified files:
usr.sbin/smtpd : enqueue.c 

Log message:
Convert some fgetln to getline.

tested and ok gilles@



CVS: cvs.openbsd.org: src

2015-10-17 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/17 10:03:20

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
LMTP delivery requires "inet unix".

Ok millert@ gilles@



CVS: cvs.openbsd.org: src

2015-10-15 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/15 02:18:23

Modified files:
usr.sbin/smtpd : smtpctl.8 smtpctl.c 

Log message:
Let "all" as an argument for "resume envelope", "pause envelope"
and "remove" subcommands.

seems potentially useful millert@, Ok gilles@



CVS: cvs.openbsd.org: src

2015-10-14 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/14 03:14:11

Modified files:
usr.sbin/smtpd : smtpd.c 

Log message:
Convert fgetln to getline.

Ok millert@ eric@ gilles@



CVS: cvs.openbsd.org: src

2015-10-13 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/13 02:33:06

Modified files:
usr.sbin/httpd : server_http.c 

Log message:
Plug a leak.

Ok gilles@, reyk@



CVS: cvs.openbsd.org: src

2015-10-11 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/11 06:50:00

Modified files:
usr.sbin/smtpd : table_ldap.c table_passwd.c table_sqlite.c 
 table_static.c 

Log message:
Convert some fgetln to getline.

Ok gilles@, giovanni@, millert@



CVS: cvs.openbsd.org: src

2015-10-11 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/11 06:09:06

Modified files:
usr.sbin/smtpd : mda.c 

Log message:
Convert some fgetln to getline.

Suggestion and ok millert@, ok gilles@, eric@



Re: CVS: cvs.openbsd.org: src

2015-10-09 Thread Sunil Nimmagadda
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   su...@cvs.openbsd.org   2015/10/09 10:47:14
> 
> Modified files:
>   usr.sbin/smtpd : mta_session.c 
> 
> Log message:
> Convert fgetln(3) to getline(3).
> 
> Ok eric@ todd@ gilles@
> 

Sorry, it was ok millert@



CVS: cvs.openbsd.org: src

2015-10-09 Thread Sunil Nimmagadda
CVSROOT:/cvs
Module name:src
Changes by: su...@cvs.openbsd.org   2015/10/09 10:47:14

Modified files:
usr.sbin/smtpd : mta_session.c 

Log message:
Convert fgetln(3) to getline(3).

Ok eric@ todd@ gilles@