Emailing files via Autofiler

6 views
Skip to first unread message

yepyepyep

unread,
May 14, 2010, 6:16:30 PM5/14/10
to Automaton
If I wanted to email files via Autofiler what would be the best way to
go about that? I really don't know how to code (so I don't even know
where to start with applescript or automator), but I would really,
really, really like to be able to email files as attachments
automatically on a regular basis.

--
You received this message because you are subscribed to the Google Groups "Automaton" group.
To post to this group, send email to auto...@googlegroups.com.
To unsubscribe from this group, send email to automaton+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/automaton?hl=en.

Automaton Support

unread,
May 14, 2010, 8:05:47 PM5/14/10
to auto...@googlegroups.com, yepyepyep

Hmm, maybe I should think about making this a built-in action since it is rather tricky to figure out on your own. But for now, you can use this shell script. Use the run shell command action, hit edit, and put this into the in-line text. Make sure you cut and paste exactly including quotation marks etc.
Change the subject, from and to fields as appropriate:

FROM="som...@somewhere.com"
TO="some...@aplace.com"
SUBJECT="Some mail for you"

MIMETYPE=`file --mime-type "${1}"`

(
echo "From: ${FROM}
To: ${TO}
Subject: ${SUBJECT}
Mime-Version: 1.0
Content-Type: ${MIMETYPE}
Content-Disposition: attachment; filename=${1};
Content-Transfer-Encoding: base64"
openssl enc -base64 -in "${1}"
) | /usr/sbin/sendmail -t -oi

Automaton Support

unread,
May 30, 2010, 3:57:06 AM5/30/10
to auto...@googlegroups.com

Hi,

I've been thinking about this problem. I don't know if my previous advice helped, it would probably depend on your particular internet connectivity. But I've been working on a more general and better solution. It's not quite ready yet, but will you be interested to do some beta testing?

On 15/05/2010, at 8:16 AM, yepyepyep wrote:

yepyepyep

unread,
Jun 2, 2010, 11:08:03 PM6/2/10
to Automaton
Absolutely I would, post a link to the beta and I'll test it out.

Automaton Support

unread,
Jun 15, 2010, 10:17:13 AM6/15/10
to auto...@googlegroups.com

Hi,

I've uploaded a beta version here. It adds a mail action to AutoFiler



<tr><td>mail to</td><td>This allows you to send an email when the rule is applied. You can optionally attach the matching file to the email. Sending emails requires some configuration. The easiest way is to click <b>Edit</b> in the rule editor and borrow the settings from Mail.app. This allows you to use Mail.app as a way to test the validity of your settings. If you use this option, AutoFiler always uses the current settings for that Mail.app account. Otherwise you can select Custom, for your mail account in which case you have to manually enter your From: address, and as well you can select Custom for the SMTP server, in which case you have to enter the hostname, and optionally the username and password for the server.
<br/><br/>
Passwords for SMTP servers are stored in your Keychain for security. When you access the passwords OS-X will bring up a dialogue asking to use your keychain information. It's important that you select <b>Always Allow</b> since AutoFiler will need to access the keychain when it is sending an email in the background, and otherwise it could bring AutoFiler to a halt asking you to reauthorise access. 
<br/><br/>
The mail rule will attempt to immediately send the mail through the server. If it fails, the rule will return failure. You could for example, set up your rules to show a Growl message at this point. If you have ticked "Cache when offline", then mail that fails to send on the initial attempt is stored internally for up to 2 weeks, and retried at incremental intervals, similarly to how an SMTP server does it. In this case, if the network is down, the email will go though eventually when you reconnect, provided AutoFiler is running.
<br/><br/>
The special tokens ${FILE} and ${PATH} will be replaced in the subject and body of the message with the filename or  full path of the matching file.</td></tr>

--
Chris
Reply all
Reply to author
Forward
0 new messages