Ruby IMAP library: How can I upload .eml files to an imap server again? - ruby

In this thread, I got help with a script to catch all of my emails in their respective folders together with the attachments via the modules net/imap and the gem email.
I had to change my provider. So now I have the problem of choosing a new email provider and re-upload my emails to that account.
Can you kindly give me advice how to do this with these (or further) modules? Meanwhile, I look through the documentations again myself. I don't want to be spoon fed, it's just that I am not knowledgable with the IMAP RFCs right now, but need the access right now.
If I read a file mail = Mail.read('path/to/file.eml'), how would I upload every attribute from the .eml file and how would I upload the attachments saved in the same file?

Related

Monitor sender's attachment (names only) with Gmail API or Mail Audit API (or with other APIs)?

I'm trying to create an app to monitor employee's file attachments using Google's APIs.
I know that I could download all the emails from the audited user list using Mail Audit API and run scripts on the mails but would there be a better way to get sender's email address with attached file names?
Unfortunately, the only options available are the ones you have already suggested.
However, what you can do is to file a feature request on Google's Issue Tracker here and provide all the necessary details about your use-case and what is it that you want to achieve.

Send file via Teams (like MAPISendMail)

My (editor-like) Windows desktop program can create a new e-mail with the current project attached using MAPISendMail. A customer wants the same functionality for Microsoft Teams.
For the web version, I think I can probably do that with Graph API.
But I can't find anything for the desktop app version. Is there a way to do that?
Bonus:
It would be great if the user could manually specify recipient + body text in Teams (and not in my program).
So you can't actually attach files to messages directly - you basically upload the file to a web location, and then provide a link to the file in the message. As an example, you can upload to the SharePoint document library that exists in the "Files" tab (something like this). Then, in terms of sending the message, you can send to a Team/Channel quite easily using a Webhook. This does not support #mentions the moment though. Another option is to use Graph to send the message.
If you're wanting instead to send a kind of 'private' message to the user, you'd need to look into creating a bot, and sending a 'Proactive' message

Yasoon - Modify existing email, replace file with http(s) share link

Can the Yasoon Outlook development system modify existing emails, so that I could replace all attachments with links to the file from our internal cloud storage environment?
Or does anyone know of an app that will let me do this? I have seen the ones for Box/Dropbox/etc, but we are using FileCloud, and they have a very rich API in addition to the storage being hosted internally.
What the company would like to do is the following:
Select attachments by criteria
Upload the attachment(s) to FileCloud (FileCloud API)
Set the file as shared, with the mailfile owner being the only
authorized user (FileCloud API)
Replace the file in the email with the new share URL from FileCloud
And continue on until all selected attachments have
been processed in the mail file.
Tobi from Yasoon here, sorry for not getting back earlier.
Our tool is probably overblown for this use case though it's possible (https://github.com/yasoonOfficial/com.yasoon.attachment.export)
But you should probably look into the new Outlook API: https://dev.outlook.com/MailAppsGettingStarted/GetStarted

How do I compose a Gmail message with an attachment from a URL?

I am writing a little script in Ruby that searches for a file in a directory and creates a new Gmail message to send. It should have the name of the file in the subject field, and the file as an attachment.
I have this URL http://pastie.org/3240209 which gets me to the compose page of Gmail, and fills the subject with the name of a PDF file.
I want to add this file as an attachment. Can I do that somehow through the URL?
If you have to send something with gmail, you should not be doing it that way. Google exposes gmail through standard IMAP and SMTP. You can use oauth to connect to these services in ruby. See http://code.google.com/apis/gmail/oauth/. You can use oauth along with the ruby standard SMTP library to send gmail then.

Photo uploading via email

I'd like to be able to upload photos via email, which I've seen (and used) on eat.ly and meetups.jquery.com but I haven't been able to work out how to do this, does anyone have a solution?
Essentially I believe the process should be something like this:
1) user adds picture to email on mobile device then send to a specific email address, say 'photos#mydomain.com'
2) email server, cron job or something else looks at the senders address and tells it to add the attachement to that account
3) photo shows up on users profile page
I run Apache servers, with MySQL, PHP, and a JQuery framework. I have email servers running Courier, and I missing anything?
The simplest way to do this is to make a cron job that checks the email account using POP, and parses and process any incoming emails.
To read the image attachments, you'll need a MIME parser.
For more specific advice, please tell us what language you're trying to write the script in.
Here is a PHP POP client.

Resources