1

While configuring mail service com.day.cq.mailer.DefaultMailService, I came to know that SMTP port should be an integer (smtp.port=I"465").

But if I try configuring using sling:OsgiConfig node, as the CRX is not providing Integer for data type (only Decimal, Double and Long), I am not able to achieve this.

Is there any alternative?

Dileepa
  • 1,019
  • 1
  • 15
  • 40

2 Answers2

2

Use String type in sling:OsgiConfig node to give the smtp:port in CRX/DE. This is internally processed by DefaultMailService.

If we see the DefaultMailService implementation smtp.port is String, is processed by annotations

@Property(intValue={25})
private static final String SMTP_PORT = "smtp.port";
Sandeep Kumar
  • 1,758
  • 1
  • 22
  • 39
0

Sandeep is wrong, the internal representation is not String. The SMTP_PORT variable is of type String, because it holds a label and not the field value. The actual value is of type int. But you can set the value to Long in crx.de, because the value will be internally cast to int then. String might also work, but I did not test that.

Oliver Gebert
  • 1,166
  • 1
  • 6
  • 20