Package version
10.2.0
Describe the bug
When configuring SMTP transport with connection pooling options in AdonisJS v7, TypeScript reports type errors:
Object literal may only specify known properties, and 'pool' does not exist in type 'SMTPConfig'.
Object literal may only specify known properties, but 'maxConnections' does not exist in type 'SMTPConfig'. Did you mean to write 'connection'?
Object literal may only specify known properties, and 'maxMessages' does not exist in type 'SMTPConfig'.
Example config that triggers the errors:
smtp: transports.smtp({
host: env.get('SMTP_HOST'),
port: env.get('SMTP_PORT'),
pool: true,
maxConnections: 5,
maxMessages: 100,
}),
These options work correctly at runtime because nodemailer detects pool: true and internally uses SMTPPool transport. The issue is purely a type definition gap — SMTPConfig in src/types.ts includes SMTPConnection.Options but not the pool-specific properties from nodemailer's SMTPPool.Options.
Reproduction repo
N/A — can be reproduced by adding pool: true to any SMTP config in an AdonisJS v7 app.
Current workaround
Using @ts-ignore to suppress the type errors.
Fix
I've already implemented a fix that uses Partial<Pick<SMTPPool.Options, 'pool' | 'maxConnections' | 'maxMessages' | 'rateDelta' | 'rateLimit'>> to add the missing pool properties to SMTPConfig. All existing tests pass. Happy to open a PR if this approach looks good.
Package version
10.2.0
Describe the bug
When configuring SMTP transport with connection pooling options in
AdonisJS v7, TypeScript reports type errors:Example config that triggers the errors:
These options work correctly at runtime because nodemailer detects
pool: trueand internally usesSMTPPooltransport. The issue is purely a type definition gap —SMTPConfiginsrc/types.tsincludesSMTPConnection.Optionsbut not the pool-specific properties from nodemailer'sSMTPPool.Options.Reproduction repo
N/A — can be reproduced by adding
pool: trueto any SMTP config in an AdonisJS v7 app.Current workaround
Using
@ts-ignoreto suppress the type errors.Fix
I've already implemented a fix that uses
Partial<Pick<SMTPPool.Options, 'pool' | 'maxConnections' | 'maxMessages' | 'rateDelta' | 'rateLimit'>>to add the missing pool properties toSMTPConfig. All existing tests pass. Happy to open a PR if this approach looks good.