diff options
author | Michael Hanselmann <hansmi@gentoo.org> | 2005-07-20 14:11:05 +0000 |
---|---|---|
committer | Michael Hanselmann <hansmi@gentoo.org> | 2005-07-20 14:11:05 +0000 |
commit | d57683f09de20450d35d5cc0a48bb76304eb3ba0 (patch) | |
tree | 924fa05574c2a7ae148790a946c6d09d6ea55c2b /mail-mta | |
parent | Fix bug 99605 (diff) | |
download | gentoo-2-d57683f09de20450d35d5cc0a48bb76304eb3ba0.tar.gz gentoo-2-d57683f09de20450d35d5cc0a48bb76304eb3ba0.tar.bz2 gentoo-2-d57683f09de20450d35d5cc0a48bb76304eb3ba0.zip |
Rewritten the virtual-domain-outgoing-IP-address patch, enhanced the ebuilds a small bit.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'mail-mta')
-rw-r--r-- | mail-mta/qmail/ChangeLog | 8 | ||||
-rw-r--r-- | mail-mta/qmail/files/1.03-r16/virtual-domain-outgoing-IP-address.patch | 116 | ||||
-rw-r--r-- | mail-mta/qmail/qmail-1.03-r15.ebuild | 9 | ||||
-rw-r--r-- | mail-mta/qmail/qmail-1.03-r16.ebuild | 13 |
4 files changed, 76 insertions, 70 deletions
diff --git a/mail-mta/qmail/ChangeLog b/mail-mta/qmail/ChangeLog index c870b3cf212c..58cba84e864a 100644 --- a/mail-mta/qmail/ChangeLog +++ b/mail-mta/qmail/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for mail-mta/qmail # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/ChangeLog,v 1.53 2005/07/19 15:41:24 hansmi Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/ChangeLog,v 1.54 2005/07/20 14:11:05 hansmi Exp $ + + 20 Jul 2005; Michael Hanselmann <hansmi@gentoo.org> + files/1.03-r16/virtual-domain-outgoing-IP-address.patch, + qmail-1.03-r15.ebuild, qmail-1.03-r16.ebuild: + Rewritten the virtual-domain-outgoing-IP-address patch, enhanced the ebuilds + a small bit. 19 Jul 2005; Michael Hanselmann <hansmi@gentoo.org> qmail-1.03-r16.ebuild: Took out broken virtual-ip-patch, bug #99497 diff --git a/mail-mta/qmail/files/1.03-r16/virtual-domain-outgoing-IP-address.patch b/mail-mta/qmail/files/1.03-r16/virtual-domain-outgoing-IP-address.patch index e122b26a46d3..f1c3d13f8adc 100644 --- a/mail-mta/qmail/files/1.03-r16/virtual-domain-outgoing-IP-address.patch +++ b/mail-mta/qmail/files/1.03-r16/virtual-domain-outgoing-IP-address.patch @@ -1,115 +1,109 @@ -diff -NuarbBw qmail-1.03.orig/qmail-qmqpc.c qmail-1.03/qmail-qmqpc.c ---- qmail-1.03.orig/qmail-qmqpc.c 1998-06-15 03:53:16.000000000 -0700 -+++ qmail-1.03/qmail-qmqpc.c 2005-07-14 01:00:24.000000000 -0700 +diff -u -r qmail-1.03.orig/qmail-qmqpc.c qmail-1.03/qmail-qmqpc.c +--- qmail-1.03.orig/qmail-qmqpc.c 2005-07-19 22:25:48.000000000 +0200 ++++ qmail-1.03/qmail-qmqpc.c 2005-07-19 22:34:27.000000000 +0200 @@ -109,7 +109,7 @@ qmqpfd = socket(AF_INET,SOCK_STREAM,0); if (qmqpfd == -1) die_socket(); - if (timeoutconn(qmqpfd,&ip,PORT_QMQP,10) != 0) { -+ if (timeoutconn(qmqpfd,&ip, ( struct ip_address * ) 0, PORT_QMQP,10) != 0) { // JAK ++ if (timeoutconn(qmqpfd,&ip,(struct ip_address*)0,PORT_QMQP,10) != 0) { lasterror = 73; if (errno == error_timeout) lasterror = 72; close(qmqpfd); -diff -NuarbBw qmail-1.03.orig/qmail-remote.c qmail-1.03/qmail-remote.c ---- qmail-1.03.orig/qmail-remote.c 2005-07-14 00:50:58.000000000 -0700 -+++ qmail-1.03/qmail-remote.c 2005-07-14 01:01:22.000000000 -0700 +diff -u -r qmail-1.03.orig/qmail-remote.c qmail-1.03/qmail-remote.c +--- qmail-1.03.orig/qmail-remote.c 2005-07-19 22:25:48.000000000 +0200 ++++ qmail-1.03/qmail-remote.c 2005-07-20 14:51:20.000000000 +0200 @@ -52,6 +52,9 @@ stralloc auth_b64_pass = {0}; stralloc auth_status = {0}; -+stralloc smtphost = { 0 }; // JAK -+ipalloc smtpip = { 0 }; // JAK ++stralloc smtphost = {0}; ++ipalloc smtpip = {0}; + saa reciplist = {0}; struct ip_address partner; -@@ -902,9 +905,27 @@ - - addrmangle(&sender,argv[2],&flagalias,0); +@@ -904,6 +907,20 @@ -+ // 'canonhost' now should contain the canonical name of the sender's host. -+ // Most of the time this is a local domain name, but sometimes the domain -+ // name of a forwarded email. -+ -+ stralloc_copy ( &smtphost, &canonhost ); // JAK -+ dns_ip ( &smtpip, &smtphost ); // JAK -+ if (!saa_readyplus(&reciplist,0)) temp_nomem(); if (ipme_init() != 1) temp_oserr(); - -+ // JAK => -+ // Check if the obtained SMTP IP address is one of the addresses -+ // on this machine. If it is, set 'helohost' to 'smtphost'. -+ -+ if ( ipme_is ( &smtpip.ix -> ip ) ) -+ stralloc_copy ( &helohost, &smtphost ); -+ else -+ smtpip.ix -> ip.d [ 0 ] = smtpip.ix -> ip.d [ 1 ] = smtpip.ix -> ip.d [ 2 ] = smtpip.ix -> ip.d [ 3 ] = 0; -+ -+ // JAK <= ++ ++ // 'canonhost' now should contain the canonical name of the sender's host. ++ // Most of the time this is a local domain name, but sometimes the domain ++ // name of a forwarded email. ++ if(!stralloc_copy(&smtphost, &canonhost)) temp_nomem(); ++ dns_ip(&smtpip, &smtphost); + ++ // Check if the obtained SMTP IP address is one of the addresses ++ // on this machine. If it is, set 'helohost' to 'smtphost'. ++ if(smtpip.len > 0 && ipme_is(&smtpip.ix->ip)) { ++ stralloc_copy(&helohost, &smtphost); ++ }else{ ++ byte_zero(smtpip.ix->ip.d, sizeof(smtpip.ix->ip.d)); ++ } + flagallaliases = 1; recips = argv + 3; - while (*recips) { -@@ -951,7 +972,7 @@ +@@ -951,7 +968,7 @@ if (smtpfd == -1) temp_oserr(); if (qmtp_priority(ip.ix[i].pref)) { - if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) qmtp_port,timeoutconnect) == 0) { -+ if (timeoutconn(smtpfd,&ip.ix[i].ip, &smtpip.ix -> ip, (unsigned int) port,timeoutconnect) == 0) { // JAK ++ if (timeoutconn(smtpfd,&ip.ix[i].ip,&smtpip.ix->ip,(unsigned int) qmtp_port,timeoutconnect) == 0) { tcpto_err(&ip.ix[i].ip,0); partner = ip.ix[i].ip; qmtp(); /* does not return */ -diff -NuarbBw qmail-1.03.orig/remoteinfo.c qmail-1.03/remoteinfo.c ---- qmail-1.03.orig/remoteinfo.c 1998-06-15 03:53:16.000000000 -0700 -+++ qmail-1.03/remoteinfo.c 2005-07-14 01:00:24.000000000 -0700 +@@ -960,7 +977,7 @@ + smtpfd = socket(AF_INET,SOCK_STREAM,0); + if (smtpfd == -1) temp_oserr(); + } +- if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) smtp_port,timeoutconnect) == 0) { ++ if (timeoutconn(smtpfd,&ip.ix[i].ip,&smtpip.ix->ip,(unsigned int) smtp_port,timeoutconnect) == 0) { + tcpto_err(&ip.ix[i].ip,0); + partner = ip.ix[i].ip; + #ifdef TLS +diff -u -r qmail-1.03.orig/remoteinfo.c qmail-1.03/remoteinfo.c +--- qmail-1.03.orig/remoteinfo.c 2005-07-19 22:25:48.000000000 +0200 ++++ qmail-1.03/remoteinfo.c 2005-07-19 22:33:05.000000000 +0200 @@ -49,7 +49,7 @@ byte_copy(&sin.sin_addr,4,ipl); sin.sin_port = 0; if (bind(s,(struct sockaddr *) &sin,sizeof(sin)) == -1) { close(s); return 0; } - if (timeoutconn(s,ipr,113,timeout) == -1) { close(s); return 0; } -+ if (timeoutconn(s,ipr,ipl,113,timeout) == -1) { close(s); return 0; } // JAK ++ if (timeoutconn(s,ipr,ipl,113,timeout) == -1) { close(s); return 0; } fcntl(s,F_SETFL,fcntl(s,F_GETFL,0) & ~O_NDELAY); len = 0; -diff -NuarbBw qmail-1.03.orig/timeoutconn.c qmail-1.03/timeoutconn.c ---- qmail-1.03.orig/timeoutconn.c 1998-06-15 03:53:16.000000000 -0700 -+++ qmail-1.03/timeoutconn.c 2005-07-14 01:00:24.000000000 -0700 +diff -u -r qmail-1.03.orig/timeoutconn.c qmail-1.03/timeoutconn.c +--- qmail-1.03.orig/timeoutconn.c 2005-07-19 22:25:48.000000000 +0200 ++++ qmail-1.03/timeoutconn.c 2005-07-20 14:27:50.000000000 +0200 @@ -10,9 +10,10 @@ #include "byte.h" #include "timeoutconn.h" -int timeoutconn(s,ip,port,timeout) -+int timeoutconn(s,ip,smtpip,port,timeout) // JAK ++int timeoutconn(s,ip,localip,port,timeout) int s; struct ip_address *ip; -+struct ip_address *smtpip; // JAK ++struct ip_address *localip; unsigned int port; int timeout; { -@@ -22,6 +23,25 @@ +@@ -22,6 +23,17 @@ fd_set wfds; struct timeval tv; -+ // JAK => -+ // If 'smtpip' != 0.0.0.0 bind () it as outgoing SMTP IP address. -+ -+ if ( ( smtpip != 0 ) && -+ ( smtpip -> d [ 0 ] != 0 ) && -+ ( smtpip -> d [ 1 ] != 0 ) && -+ ( smtpip -> d [ 2 ] != 0 ) && -+ ( smtpip -> d [ 3 ] != 0 ) ) -+ { -+ byte_zero ( &sin, sizeof ( sin ) ); -+ byte_copy ( &sin.sin_addr.s_addr, 4, smtpip ); -+ sin.sin_family = AF_INET; -+ -+ if ( bind ( s, ( struct sockaddr * ) &sin, sizeof ( sin ) ) ) -+ return ( -1 ); -+ } -+ -+ // JAK <= ++ // If 'smtpip' != 0.0.0.0 bind () it as outgoing SMTP IP address. ++ if(localip && (localip->d[0] || localip->d[1] || localip->d[2] || localip->d[3])) { ++ byte_zero(&sin, sizeof(sin)); ++ byte_copy(&sin.sin_addr.s_addr, 4, localip); ++ sin.sin_family = AF_INET; + ++ // Don't return if it doesn't work out. Otherwise, it would ++ // fail if the user uses the moreipme functionality. ++ bind(s, (struct sockaddr*)&sin, sizeof(sin)); ++ } ++ byte_zero(&sin,sizeof(sin)); byte_copy(&sin.sin_addr,4,ip); x = (char *) &sin.sin_port; diff --git a/mail-mta/qmail/qmail-1.03-r15.ebuild b/mail-mta/qmail/qmail-1.03-r15.ebuild index b389f44aeeb6..f33a18c16664 100644 --- a/mail-mta/qmail/qmail-1.03-r15.ebuild +++ b/mail-mta/qmail/qmail-1.03-r15.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r15.ebuild,v 1.29 2005/07/18 05:13:41 anarchy Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r15.ebuild,v 1.30 2005/07/20 14:11:05 hansmi Exp $ inherit toolchain-funcs eutils fixheadtails flag-o-matic @@ -434,6 +434,11 @@ buildtcprules() { } pkg_postinst() { + if [[ ! -x /var/qmail/bin/queue-fix ]]; then + eerror "Can't find /var/qmail/bin/queue-fix -- have you rm -rf'd /var/qmail?" + einfo "Please remerge net-mail/queue-fix and don't do that again!" + die "Can't find /var/qmail/bin/queue-fix" + fi einfo "Setting up the message queue hierarchy ..." # queue-fix makes life easy! @@ -485,7 +490,7 @@ pkg_preinst() { else fail=1 fi - if [ "${fail}" = "1" ]; then + if [ "${fail}" = 1 -a -f ${old} ]; then eerror "Error moving $old to $new, be sure to check the" eerror "configuration! You may have already moved the files," eerror "in which case you can delete $old" diff --git a/mail-mta/qmail/qmail-1.03-r16.ebuild b/mail-mta/qmail/qmail-1.03-r16.ebuild index 3a09028f7af0..8888ab202023 100644 --- a/mail-mta/qmail/qmail-1.03-r16.ebuild +++ b/mail-mta/qmail/qmail-1.03-r16.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r16.ebuild,v 1.29 2005/07/19 15:41:24 hansmi Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r16.ebuild,v 1.30 2005/07/20 14:11:05 hansmi Exp $ inherit toolchain-funcs eutils fixheadtails flag-o-matic @@ -251,8 +251,9 @@ src_unpack() { epatch ${FILESDIR}/${PVR}/invalid-envelope-sender-log.patch # See bug 98961 - # hansmi, 2005-07-19: This patch is broken, needs fixing, #99497 - # epatch ${FILESDIR}/${PVR}/virtual-domain-outgoing-IP-address.patch + # Sort-of rewritten by hansmi@g.o, because the old patch was heavily broken + # (caused qmail-remote to segfault) + epatch ${FILESDIR}/${PVR}/virtual-domain-outgoing-IP-address.patch # See bug #90631 if use logmail; then @@ -380,7 +381,7 @@ src_install() { for i in mailer-daemon postmaster root do - if [ ! -f ${ROOT}/var/qmail/alias/.qmail-${i} ]; then + if [[ ! -f ${ROOT}/var/qmail/alias/.qmail-${i} ]]; then touch ${D}/var/qmail/alias/.qmail-${i} fowners alias:qmail /var/qmail/alias/.qmail-${i} fi @@ -477,7 +478,7 @@ buildtcprules() { src=${ROOT}${TCPRULES_DIR}/${f} cdb=${ROOT}${TCPRULES_DIR}/${f}.cdb tmp=${ROOT}${TCPRULES_DIR}/.${f}.tmp - cat ${src} 2>/dev/null | tcprules ${cdb} ${tmp} + cat ${src} 2>/dev/null | tcprules ${cdb} ${tmp} < ${src} done } @@ -546,7 +547,7 @@ pkg_preinst() { else fail=1 fi - if [ "${fail}" = "1" ]; then + if [ "${fail}" = 1 -a -f ${old} ]; then eerror "Error moving $old to $new, be sure to check the" eerror "configuration! You may have already moved the files," eerror "in which case you can delete $old" |