At certain times, AdapLink requires messages to be delivered to the end users (like error message, etc).
The exact delivery method needs to be configured by the server administrator with the help of message configuration file parameters.
Location: $AdapLink_service\acconfig\alink.msg.config.props.
If the configuration file is not yet present at the respective location, then the message handler factory just before creating a message will also auto generate a file with the default values.
Parameter ‘msg.transport.nature’ governs the overall nature of message delivery. The default nature is to save messages locally on the server file system.
ac.msg.transport.nature=localfile
If message is saved locally, then it is administrators responsibility to deliver the message to the end user as all messages are saved locally.
The locally saved file contains human readable text, which contains message header (From, TO, CC, BCC, Subject), body, etc. which can be further used by the administrator when manually delivering the message.
ac.msg.transport.nature=mail
If the policy is to send message by email, then additional parameters need to be configured. The additional parameters include JavaMail related parameters.
ac.msg.admin. prefix parameters are used to configure administrator details.
Default values:
# Server Administrator details
ac.msg.admin.name=AdapLink Administrator
ac.msg.admin.email=AdapLinkAdmin@localhost
ac.msg.automatic. prefix parameters are used to configure automatic mailer details.
Default values:
# Server automatic mailer details
ac.msg.automatic.name=AdapLink Service
ac.msg.automatic.email=AdapLinkAuto@localhost
AdapLink relies on JavaMail API to send emails.
For JavaMail reference:
http://java.sun.com/products/javamail/FAQ.html
http://java.sun.com/products/javamail/Third_Party.html
# Transport layer
mail.transport.protocol=smtp
mail.smtp.host=localhost
mail.smtp.port=25
# [Optional] Address for handling Bounced Messages
mail.smtp.from=AdapLinkReply@localhost
# if SSL
mail.smtp.port=465
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false
# SMTP send mail server Authentication
mail.smtp.auth=true
mail.smtp.user=username
mail.smtp.password=password
Some sentences are comments and they always starts with #.
Incorrect:
Transport layer
[Optional] Address for handling Bounced Messages
Correct:
#Transport layer
#[Optional] Address for handling Bounced Messages
To start with, look at server log files at $AdapLink_serviceapache-tomcat\logs\
Assumption: Email ID is assumed to be user@localhost; you need to replace with a valid ID of your choice.
Complete message: Error message 501 Syntax error, parameters in command “MAIL FROM:Administrator<user@localhost>” unrecognized or missing
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 501 Syntax error, parameters in command "MAIL FROM:Administrator<user@localhost>" unrecognized or missing
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1128)
... 30 more
This could be due to an older SMTP server version.
Trial and error based solutions:
Solution 1:
mail.smtp.from=user@localhost
Solution 2:
If solution 1 fails then comment the above key value pair as below
#mail.smtp.from=user@localhost