-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Got a small issue when a printer scans to email. I get this error in the SMTP2Graph logs.
{"error":"{"code":"ErrorSendAsDenied","message":"The user account which was used to submit this request does not have the right to send mail on behalf of the specified sending account., Cannot submit message."}
I have no way of changing this old printer, but in the .eml email file, I changed the "From:" field as shown below. I wrote a quick script to adjust the files every minute or so to automatically change the field. Can SMTP2Graph detect this behavior and fix it before trying to submit to Graph?
"From: [email protected] <[email protected]>" TO "From: <[email protected]>"
Powershell script:
# Get Files
$allfiles = Get-ChildItem -Path C:\ProgramData\SMTP2Graph\mailroot\queue -Filter *.eml
# Fix Files
foreach ($file in $allfiles) {
$filecontent = Get-Content -Path $file.FullName -Raw
$filecontent -replace 'From: [email protected] <[email protected]>','From: <[email protected]>' | Set-Content -Path $file.FullName
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request