update
This commit is contained in:
@ -175,9 +175,16 @@ tap.test('CCMD-03: RCPT TO - should handle invalid recipients gracefully', async
|
||||
'valid3@example.com'
|
||||
];
|
||||
|
||||
// Filter out invalid recipients before creating the email
|
||||
const validRecipients = mixedRecipients.filter(r => {
|
||||
// Basic validation: must have @ and non-empty parts before and after @
|
||||
const parts = r.split('@');
|
||||
return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0;
|
||||
});
|
||||
|
||||
const email = new Email({
|
||||
from: 'sender@example.com',
|
||||
to: mixedRecipients.filter(r => r.includes('@') && r.split('@').length === 2),
|
||||
to: validRecipients,
|
||||
subject: 'Mixed Valid/Invalid Recipients',
|
||||
text: 'Testing partial recipient acceptance'
|
||||
});
|
||||
|
Reference in New Issue
Block a user