Hey all -

We're using the pclzip module along with a custom module to send a zip of files attached to nodes, using Views bulk operations. However, the temporary zip files created by pclzip aren't stored in a web-accessible location, so the url checking in _mimemail_file filtered them out so they weren't sent along.

This patch adds a check before the URL creation steps to see if the file already exists on the server with the path that's passed in as-is.

Let me know if you have any questions or issues with the patch -- I'd love to see this included in the next version so I don't have to worry about patching it when we do updates :)

Thanks,

Isaac

Comments

sgabe’s picture

Title: Patch to allow non-web-accessible files to be sent as attachments » Allow non-web-accessible files as attachments
Version: 6.x-1.0-alpha5 » 6.x-1.x-dev
StatusFileSize
new1.97 KB

Patch attached against current development snapshot.

sgabe’s picture

StatusFileSize
new2.16 KB

I think we should use is_file() instead of file_exists().

sgabe’s picture

funkytraffic’s picture

It would be great to choose in the GUI, if the files get attached or not.

sgabe’s picture

Do you mean an option to disable attachments?

funkytraffic’s picture

Sometimes it is better if inserted images stay on the website to keep the mails small. Sometimes it is better to attach them inside the mail.

This should be an option of Mime Mail independent of relative or absolute pathes.

By the way: The issue is for me related to the question of the insert module, which creates absolute pathes:
http://drupal.org/node/880016

isaac.niebeling’s picture

That's a whole different issue, though, and should be started as a feature request.

jantoine’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.94 KB

The patch from #2 works as expected. I was able to attach a file from the servers /tmp directory. I did have a bit of trouble applying the patch via 'git apply', so I have attached a patch that has been created via 'git diff'.

Cheers,

Antoine

sgabe’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 6.x-1.x and it was already available in 7.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.