bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)
http://www.simplejavamail.org
Apache License 2.0
1.23k stars 270 forks source link

Dependency problem with obsolete ical4j #545

Closed ucchino closed 2 months ago

ucchino commented 2 months ago

I have a strange behavior with an obsolete version (3.x) of ical4j without the outlook module included in my project. At the moment I only use simplejavamail core and main module. I would have expected that the ical4j dependency was required only if the Outlook module was used. The behavior is the following: the mail server is contacted, but the message body is not inserted. The Socket goes into time out exception:

Partial log follows:

RCPT TO:mail@gmail.com 250 2.1.5 Ok DEBUG SMTP: Verified Addresses DEBUG SMTP: User mail@gmail.com DATA 354 End data with . Date: Sun, 15 Sep 2024 14:19:16 +0200 (CEST) From: info info@server.it Reply-To: info info@server.it To: ucchino mail@gmail.com Message-ID: 136393487.1.1726402756274@WOPR.mshome.net Subject: TEST MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_1855610584.1726402756220" Disposition-Notification-To: info info@server.it Return-Receipt-To: info info@server.it

QUIT DEBUG SMTP: exception reading response, THROW: java.net.SocketTimeoutException: Read timed out

bbottema commented 2 months ago

I would have expected that the ical4j dependency was required only if the Outlook module was used.

ical4j implements iCalendar data streams as defined in RFC2445. Most popular calendaring tools, such as Lotus Notes, Outlook and Apple's iCal support this standard.

Simple Java Mail only has a dependency on the DTO objects from ical4j-vcard, not the entire library. If you really need it, you can exclude it altogether.

<dependencies>
    <dependency>
        <groupId>org.simplejavamail</groupId>
        <artifactId>simple-java-mail</artifactId>
        <version>{your_version}</version>
        <exclusions>
            <exclusion>
                        <groupId>org.mnode.ical4j</groupId>
                        <artifactId>ical4j-vcard</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>