Skip to content

Commit 9a371de

Browse files
committed
use mailFrom to set sendmail services
1 parent 695b940 commit 9a371de

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

builders/mailpit.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const setConfigOptions = require('../utils/setConfigOptions');
1919
* @typedef {object} MailpitConfig
2020
* @property {string} version - Version of Mailpit to use
2121
* @property {string[]} supported - Supported versions of Mailpit
22-
* @property {string[]} sendFrom - Services to configure for sending mail to Mailpit
22+
* @property {string[]} mailFrom - Services to configure for sending mail to Mailpit
2323
* @property {number} maxMessages - Maximum number of messages to store before truncating
2424
* @property {number} port - SMTP port to use for sending mail to Mailpit
2525
* @property {boolean} ssl - Whether to use SSL for the Mailpit UI
@@ -49,7 +49,7 @@ module.exports = {
4949
config: {
5050
version: '1.20',
5151
supported: ['1.20'],
52-
sendFrom: [],
52+
mailFrom: [],
5353
maxMessages: 500,
5454
port: 1025,
5555
confSrc: path.resolve(__dirname, '..', 'config'),
@@ -108,7 +108,7 @@ module.exports = {
108108
options.meUser = 'root';
109109

110110
// Add senders information to options
111-
options.info = {sendFrom: options.sendFrom};
111+
options.info = {mailFrom: options.mailFrom};
112112

113113
// Set configuration options for the Lando service
114114
setConfigOptions({
@@ -127,7 +127,7 @@ module.exports = {
127127
addBuildStep(buildSteps, options._app, options.name, 'build_as_root_internal');
128128

129129
// Configure other services to use Mailpit
130-
options.sendFrom.forEach(service => {
130+
options.mailFrom.forEach(service => {
131131
options.sources.push({
132132
services: _.set({}, service, {
133133
environment: {

examples/mailpit/.lando.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
type: php:8.2
55
smtpserver:
66
type: mailpit
7-
sendFrom:
7+
mailFrom:
88
- phpserver
99

1010
# This is important because it lets lando know to test against the plugin in this repo

test/mailpit.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('Mailpit Builder', function() {
3939
mockOptions = {
4040
data: 'data_smtpserver',
4141
meUser: undefined,
42-
sendFrom: ['phpserver'],
42+
mailFrom: ['phpserver'],
4343
info: undefined,
4444
name: 'smtpserver',
4545
port: undefined,
@@ -57,7 +57,7 @@ describe('Mailpit Builder', function() {
5757
expect(instance.id).to.equal('smtpserver');
5858
expect(instance.options.name).to.equal('smtpserver');
5959
expect(instance.options.data).to.equal('data_smtpserver');
60-
expect(instance.options.sendFrom).to.deep.equal(['phpserver']);
60+
expect(instance.options.mailFrom).to.deep.equal(['phpserver']);
6161
});
6262

6363
it('should use default values when not provided in options', () => {
@@ -108,11 +108,11 @@ describe('Mailpit Builder', function() {
108108
expect(mailpitService.volumes).to.deep.equal(['data_smtpserver:/data']);
109109
});
110110

111-
it('should configure other services when sendFrom is provided', () => {
111+
it('should configure other services when mailFrom is provided', () => {
112112
const LandoMailpitService = mailpitBuilder.builder(mockParent, mailpitBuilder.config);
113113
const instance = new LandoMailpitService('smtpserver', mockOptions);
114114

115-
// Check that the sendFrom services are configured in options.sources
115+
// Check that the mailFrom services are configured in options.sources
116116
const phpserverSource = instance.options.sources.find(source =>
117117
source.services && source.services.phpserver,
118118
);

0 commit comments

Comments
 (0)