Still new at posting issues so if this isn't in the right format/procedure be forgiving.
Basically -- I was trying to create a new class to use: HTMLMailSystem__SMTPMailSystem
When I was initially creating the class, I was getting temporary file could not be copied type of error, went and checked through things, saw the tmp inc file being created for the class, but it wasn't being copied. Digging into the module deeper, on line 135 of mailsystem.module I discovered the line of code that was being the problem: $class_dir = file_build_uri('mailsystem');
The file_build_uri creates something like public:// or private://, however in my case with the S3FS module being used it was creating "s3://HTMLMailSystem__SmtpMailSystem.mail.inc", which down the line on line 177 ( if (file_unmanaged_save_data($class_contents, $class_file, FILE_EXISTS_REPLACE)) { ), $classfile was simply "/HTML.....mail.inc", which wouldn't fly obviously.
I was able to force it to work for my purposes by forcing $class_dir = 'private://mailsystem';
It worked and its in the registry for me now and works for what I need and its stored in the registry so it shouldn't resurface for me - but is there some method of reworking where it places the file or what default scheme it uses?
Comment | File | Size | Author |
---|---|---|---|
#7 | mailsystem-n2687265-7.patch | 2.01 KB | DamienMcKenna |
Comments
Comment #2
N20 CreditAttribution: N20 commentedWe are using s3fs as well and it's a big mess with these files created by mailsystem.
You could use try using mailsystem-7.x-3.0-alpha1 or as i did 7.x-3.x-dev. Both do not need any files at all.
But be aware of this: https://www.drupal.org/node/2700547
I still had plenty struggles with both version. Theme was broken and the site slowed down a lot read here and here. Also a class was missing (can't find the patch for that right now).
Comment #3
terrylb CreditAttribution: terrylb commentedWe're having this same issue too except when trying to create a new class of MIMEMailSystem_SmtpMailSystem. It returns the error:
File temporary://file2Gqcq2 could not be copied, because the destination directory is not configured correctly.
I can see that "
destination directory
" has an empty value.It's a production site so I can't risk wiping everything out as #2 says is possible with mailsystem-7.x-3.0-alpha1 or 7.x-3.x-dev.
This ends up being a problem for Drupal installs on AWS using S3 that also want to send html email with the Simple Email Service (SES) as the SMTP server. Using SES has the added benefit of email authentication with their easy implementation of SPF and DKIM records.
Would love to hear if this is going to be fixed or if there's an alternative method to get this working using Mime Mail, SMTP Mail, S3 and SES.
Comment #4
terrylb CreditAttribution: terrylb as a volunteer commentedJust to follow up on my previous post and help someone else, I was able to get Mime + SMTP working by setting $class_dir = 'private://mailsystem'; inside mailsystem.module. In addition, the checkbox for Send links only in the MIME Mail module needed to be enabled otherwise email wasn't sent and errors showed in the log: "phpmailerException: Message body empty in PHPMailer->Send() (line 577 of /var/app/current/sites/all/modules/contrib/smtp/smtp.phpmailer.inc)"
Comment #5
dobe CreditAttribution: dobe as a volunteer commentedI wanted to chime in here. My guess is that @terrylb is running a single AWS instance. With there private directory not being controlled by S3.
Issue here is that what if you have your private directory on S3. Then drupal tries to autoload an external file... which I don't think is possible.
Second issue. IF you do have your private filesystem local to your install (not on s3) and if you have more then 1 EC2 instance... then when you save your new class file... Well only the instance that was being used when you save the file gets that new file. So it may be better to register you own class with the file that is generated.
Comment #6
dobe CreditAttribution: dobe as a volunteer commentedFollow up herre:
I created a file that is basically what is generated by mailsystem
MyCustomMailSystem.mail.inc
added this to my custom module directory.
Then added this to mycustom.info module file so it will get auto loaded.
files[] = MyCustomMailSystem.mail.inc
About to test if this works for me. But it should :D
Comment #7
DamienMcKennaDoes this work? I tried to combine a change someone made ages ago on a project I've taken over, with the latest codebase.