Bug 239409 - mail/milter-greylist build fails when sendmail configured for SMTP Authentication
Summary: mail/milter-greylist build fails when sendmail configured for SMTP Authentica...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-23 18:58 UTC by Wayne Sierke
Modified: 2019-08-04 21:47 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (m.tsatsenko)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Sierke 2019-07-23 18:58:53 UTC
The "standard" method of enabling SMTP Authentication for Sendmail includes adding the following to /etc/make.conf:

SENDMAIL_CFLAGS=-I/usr/local/include -DSASL
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=-lsasl2

Refer:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/SMTP-Auth.html
https://svnweb.freebsd.org/ports/head/security/cyrus-sasl2/files/Sendmail.README?view=markup

This configuration causes poudriere builds of milter-greylist to fail, and also local builds via /usr/ports if cyrus-sasl2 is not already installed.

Since enabling SMTP Authentication in Sendmail seems to be essentially a "supported" configuration it would be better if that configuration did not hinder compilation of related ports unnecessarily. A solution for milter-greylist is to add a conditional dependency on security/cyrus-sasl2, such as:

--- Makefile.1  2019-07-23 03:50:02.878890000 +0000
+++ Makefile    2019-07-24 00:02:07.740684000 +0000
@@ -57,6 +57,10 @@
 
 .include <bsd.port.options.mk>
 
+.if ${SENDMAIL_CFLAGS:M-DSASL}
+LIB_DEPENDS+=  libsasl2.so:security/cyrus-sasl2
+.endif
+
 LIBS+=         -lpthread
 
 GNU_CONFIGURE= yes
Comment 1 m.tsatsenko 2019-07-25 22:37:43 UTC
I am not sure. 
Although what you are suggesting will do the trick it may cause some trouble in the future. Why we dont just add SASL option to the port?
Comment 2 m.tsatsenko 2019-08-04 01:17:28 UTC
Well, I had a look at this.
It seems that the problem is caused by very old workaround which is not needed anymore.
Could you please confirm commenting out following lines passing SENDMAIL_FLAGS to the build solves for problem for you:
POSTFIX_LDFLAGS_OFF=            ${SENDMAIL_LDFLAGS}
POSTFIX_LIBS_OFF=               ${SENDMAIL_LDADD}
Comment 3 Wayne Sierke 2019-08-04 06:49:37 UTC
(In reply to m.tsatsenko from comment #2)
I confirm that removing those lines from the port Makefile resolves the build problem when tested with poudriere.

Thank you very much for identifying that.
Comment 4 m.tsatsenko 2019-08-04 21:47:53 UTC
Hello,
Thanks for feedback. I will submit a patch to fix this next few days.