diff options
author | Wesley Shields <wxs@FreeBSD.org> | 2009-02-12 00:41:34 +0000 |
---|---|---|
committer | Wesley Shields <wxs@FreeBSD.org> | 2009-02-12 00:41:34 +0000 |
commit | 9dcab6ff8fe25cad14e5409730efbd53f8d908ac (patch) | |
tree | 8c831418c6b0a379fa7b56d69f425660d9ce63bf /mail/dma | |
parent | f018254623fc6c522af4c5addd9f76e3918db20d (diff) | |
download | ports-9dcab6ff8fe25cad14e5409730efbd53f8d908ac.tar.gz ports-9dcab6ff8fe25cad14e5409730efbd53f8d908ac.zip |
Notes
Diffstat (limited to 'mail/dma')
-rw-r--r-- | mail/dma/Makefile | 55 | ||||
-rw-r--r-- | mail/dma/distinfo | 3 | ||||
-rw-r--r-- | mail/dma/files/dma.rb | 58 | ||||
-rw-r--r-- | mail/dma/files/patch-Makefile | 6 | ||||
-rw-r--r-- | mail/dma/files/patch-libexec_dma_net.c | 21 | ||||
-rw-r--r-- | mail/dma/files/pkg-message.in | 31 | ||||
-rw-r--r-- | mail/dma/pkg-descr | 11 | ||||
-rw-r--r-- | mail/dma/pkg-plist | 14 |
8 files changed, 199 insertions, 0 deletions
diff --git a/mail/dma/Makefile b/mail/dma/Makefile new file mode 100644 index 000000000000..6bb99e3064ac --- /dev/null +++ b/mail/dma/Makefile @@ -0,0 +1,55 @@ +# New ports collection makefile for: dma +# Date created: 2009-01-17 +# Whom: Daniel Roethlisberger <daniel@roe.ch> +# +# $FreeBSD$ +# + +PORTNAME= dma +PORTVERSION= 20090208 +CATEGORIES= mail ipv6 +MASTER_SITES= http://mirror.roe.ch/dist/dma/ + +MAINTAINER= daniel@roe.ch +COMMENT= DragonFly Mail Agent, a small MTA for local/outbound mail + +USE_BZIP2= yes +USE_OPENSSL= yes + +MAN8= dma.8 + +CFLAGS+= -I${OPENSSLINC} +LDFLAGS+= -L${OPENSSLLIB} + +SUB_FILES= pkg-message + +post-patch: + @${REINPLACE_CMD} -e 's,/etc/dma,${PREFIX}/etc/dma,g' \ + ${WRKSRC}/libexec/dma/dma.8 \ + ${WRKSRC}/libexec/dma/dma.h + @${REINPLACE_CMD} -e 's, /etc/dma, ${PREFIX}/etc/dma,g' \ + ${WRKSRC}/etc/dma/dma.conf + @${REINPLACE_CMD} -e '/^WARNS/d' ${WRKSRC}/libexec/dma/Makefile + +do-install: + ${INSTALL} -o root -g mail -m 2555 ${WRKSRC}/libexec/dma/dma ${PREFIX}/libexec + ${INSTALL_SCRIPT} ${FILESDIR}/dma.rb ${PREFIX}/libexec + ${INSTALL_MAN} ${WRKSRC}/libexec/dma/dma.8 ${PREFIX}/man/man8/ + ${MKDIR} ${PREFIX}/etc/dma +.for i in dma.conf virtusertable + ${INSTALL_DATA} -m 0644 ${WRKSRC}/etc/dma/${i} ${PREFIX}/etc/dma/${i}.sample +.endfor + ${INSTALL} -o root -g mail -m 0640 ${WRKSRC}/etc/dma/auth.conf \ + ${PREFIX}/etc/dma/auth.conf.sample +.for i in dma.conf virtusertable auth.conf + if [ ! -f ${PREFIX}/etc/dma/${i} ]; then \ + ${CP} -p ${PREFIX}/etc/dma/${i}.sample \ + ${PREFIX}/etc/dma/${i} ; \ + fi +.endfor + ${INSTALL} -d -o root -g mail -m 770 /var/spool/dma + +post-install: + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/mail/dma/distinfo b/mail/dma/distinfo new file mode 100644 index 000000000000..9c6684314f4e --- /dev/null +++ b/mail/dma/distinfo @@ -0,0 +1,3 @@ +MD5 (dma-20090208.tar.bz2) = 3284c870aad1c5248254aeee9cb2ae9d +SHA256 (dma-20090208.tar.bz2) = 77524d6f6366e69d730c3d8cdcf2fe35a0cd28a6da7425def11bd4881043eaa3 +SIZE (dma-20090208.tar.bz2) = 17252 diff --git a/mail/dma/files/dma.rb b/mail/dma/files/dma.rb new file mode 100644 index 000000000000..3c7fc992bde7 --- /dev/null +++ b/mail/dma/files/dma.rb @@ -0,0 +1,58 @@ +#!/usr/bin/env ruby +# Copyright (c) 2009 Daniel Roethlisberger <daniel@roe.ch> +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice unmodified, this list of conditions, and the following +# disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# Wrapper around dma(8) which implements the missing -t sendmail option. +# WARNING: The address parsing is very incomplete and might break. + +require 'open3' + +dma = $0.gsub(/.rb$/, '') + +if ARGV.delete "-t" + msg = STDIN.read + head, cr, body = msg.split(/(?<=\n)(\r?)\n/, 2) + tmphead = head.gsub(/\n\s+/m, ' ') + rcpts = [] + tmphead.gsub(/^(?:to|cc|bcc):\s.*$/i) do |match| + match.sub(/^[^:]+:\s*/, '').split(/\s*[,;]\s*/).each do |addr| + rcpts << addr.sub(/.*<([^<>]+)>.*/, '\\1') + end + end + head.gsub!(/^bcc:.*\n/i, '') + Open3.popen3(dma, *ARGV.concat(rcpts)) do |i,o,e| + i.write head + i.write "#{cr}\n" + i.write body + i.close_write + print o.read + print e.read + end +else + exec(dma, *ARGV) +end + diff --git a/mail/dma/files/patch-Makefile b/mail/dma/files/patch-Makefile new file mode 100644 index 000000000000..f0fdffdf85df --- /dev/null +++ b/mail/dma/files/patch-Makefile @@ -0,0 +1,6 @@ +--- /dev/null 2009-01-17 17:24:56.000000000 +0100 ++++ Makefile 2009-01-17 17:25:04.000000000 +0100 +@@ -0,0 +1,3 @@ ++DISTRIBUTION=portsmaildma ++SUBDIR=libexec/dma ++.include <bsd.subdir.mk> diff --git a/mail/dma/files/patch-libexec_dma_net.c b/mail/dma/files/patch-libexec_dma_net.c new file mode 100644 index 000000000000..0319794b7d09 --- /dev/null +++ b/mail/dma/files/patch-libexec_dma_net.c @@ -0,0 +1,21 @@ +--- libexec/dma/net.c.orig 2008-09-30 19:47:21.000000000 +0200 ++++ libexec/dma/net.c 2009-01-17 19:02:43.000000000 +0100 +@@ -342,14 +342,10 @@ + it->queueid); + else + goto out; +- } +- +- /* +- * If the user doesn't want STARTTLS, but SSL encryption, we +- * have to enable SSL first, then send EHLO +- */ +- if (((config->features & STARTTLS) == 0) && +- ((config->features & SECURETRANS) != 0)) { ++ /* ++ * The client SHOULD send an EHLO command as the ++ * first command after a successful TLS negotiation. ++ */ + send_remote_command(fd, "EHLO %s", hostname()); + if (read_remote(fd, 0, NULL) != 2) { + syslog(LOG_ERR, "%s: remote delivery deferred: " diff --git a/mail/dma/files/pkg-message.in b/mail/dma/files/pkg-message.in new file mode 100644 index 000000000000..37d7cc6be3b6 --- /dev/null +++ b/mail/dma/files/pkg-message.in @@ -0,0 +1,31 @@ + +To enable dma please edit /etc/mail/mailer.conf to replace all lines +referring to another MTA with the following: + +sendmail %%PREFIX%%/libexec/dma +send-mail %%PREFIX%%/libexec/dma + +If you need sendmail -t compatibility, e.g. for send-pr(1), you may use the +ruby wrapper script instead (make sure to install lang/ruby as well): + +sendmail %%PREFIX%%/libexec/dma.rb +send-mail %%PREFIX%%/libexec/dma.rb + +Note that the ruby wrapper only supports a subset of what is considered valid +email address syntax by the relevant RFCs. + +If you not need sendmail anymore, please add in your rc.conf: + +sendmail_enable="NO" +sendmail_submit_enable="NO" +sendmail_outbound_enable="NO" +sendmail_msp_queue_enable="NO" + +And you can disable some sendmail specific daily maintenance routines in your +/etc/periodic.conf file: + +daily_clean_hoststat_enable="NO" +daily_status_mail_rejects_enable="NO" +daily_status_include_submit_mailq="NO" +daily_submit_queuerun="NO" + diff --git a/mail/dma/pkg-descr b/mail/dma/pkg-descr new file mode 100644 index 000000000000..2112b74b7124 --- /dev/null +++ b/mail/dma/pkg-descr @@ -0,0 +1,11 @@ +The DragonFly Mail Agent is a small Mail Transport Agent (MTA), +designed for home and office use. It accepts mails from locally +installed Mail User Agents (MUA) and delivers the mails either +locally or to a remote destination. Remote delivery includes +several features like TLS/SSL support and SMTP authentication. + +Since dma is not intended as a replacement for real, big MTAs +like sendmail(8) or postfix(1), it does not listen on port 25 +for incoming connections. + +WWW: http://www.dragonflybsd.org/ diff --git a/mail/dma/pkg-plist b/mail/dma/pkg-plist new file mode 100644 index 000000000000..b20339017cbe --- /dev/null +++ b/mail/dma/pkg-plist @@ -0,0 +1,14 @@ +libexec/dma +libexec/dma.rb +@unexec if cmp -s %D/etc/dma/dma.conf.sample %D/etc/dma/dma.conf; then rm -f %D/etc/dma/dma.conf; fi +etc/dma/dma.conf.sample +@exec if [ ! -f %B/dma.conf ] ; then cp -p %B/%f %B/dma.conf; fi +@unexec if cmp -s %D/etc/dma/auth.conf.sample %D/etc/dma/auth.conf; then rm -f %D/etc/dma/auth.conf; fi +etc/dma/auth.conf.sample +@exec if [ ! -f %B/auth.conf ] ; then cp -p %B/%f %B/auth.conf; fi +@unexec if cmp -s %D/etc/dma/virtusertable.sample %D/etc/dma/virtusertable; then rm -f %D/etc/dma/virtusertable; fi +etc/dma/virtusertable.sample +@exec if [ ! -f %B/virtusertable ] ; then cp -p %B/%f %B/virtusertable; fi +@dirrmtry etc/dma +@exec install -d -o root -g mail -m 770 /var/spool/dma +@unexec rmdir /var/spool/dma 2>/dev/null || true |