File corruption after transmission over GMail using mutt + msmtp - oauth-2.0

Nowadays, email recipients had give me feedback that attached files that I sent was corrupted. I use Mutt + msmtp + offlineimap and OAuth GMail app implementation.
Here is headers I got from echo#xxxxx.xxxx.xx:
From: Marcelo <xxxxxxxxx#gmail.com>
To: echo <echo#xxxxx.xxxxx.xx>
Date: Fri, 20 May 2022 12:35:49 -0300
Subject: Test 7
[-- Anexo No.1 --]
[-- Tipo: text/plain, Codificação: 7bit, Tamanho: 0K --]
[-- Anexo No.2: TCC-v3.docx --]
[-- Tipo: application/vnd.openxmlformats-officedocument.wordprocessingml.document, Codificação:
base64, Tamanho: 71K --]
[-- application/vnd.openxmlformats-officedocument.wordprocessingml.document não é aceito (use
'v' para ver esta parte) --]
And here is Attached View (after v in mutt page index)
I 1 <no description> [text/plain, 7bit, us-ascii, 0K]
A 2 TCC-v3.docx [applica/vnd.openxm, base64, 71K]
And here is the Attached file that are stored in GMail sent box.
My muttrc have this:
set send_charset="us-ascii:iso-8859-1:iso-8859-15:windows-1252:utf-8"
I already tried this, also:
set use_8bitmime
or
set use_8bitmime = yes
Have you some clue to point me out?

Related

FETCH command IMAP based on headers defined by RFC822

I have this command come from Thunderbird client email:
6 UID fetch 1 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type Reply-To)])
To respond it, I send the follows statements:
* 1 FETCH (UID 1 RFC822.SIZE 526 BODY[] {526}
* FLAGS (\Seen)
From: "Bob Smith" <bob#bar.com>
To: "John Smith" <john#foo.com>
Cc: "Joe Aaron" <joe#bar.com>
Subject: Sintaxe correta para criação de cabeçalhos de email
Date: 30 Jul 1996 11:54:54 -0000
Message-ID: <OTJMCQtXnqgMaP1rLJi-cD9IvuH+xuVndE-DoWAZB0cbdffqHdw#mail.gmail.com>
Reply-To: <bob#bar.com>
After this, Thunderbird client not send any command, and don't fetch nothing more and messages don't appear in mailbox.
In Thunderbird client the message "download message" start and never dropout
Is the first time that I study IMAP servers and I no have any idea how to proceed in this question.
Thanks;
Did you send the " OK FETCH completed" response? You must do that to signal command completion to the client.
Check the FETCH command section in the IMAP RFC. More specifically page 58 reveals an OK response example.

How to use CATENATE command in IMAP

Already been through RFC 4469.
Just wanted to know how exactly I can use the CATENATE command.
I also referred the example given in the RFC. But couldn't really execute it against the server.
Any help will be appreciated.
I know this is old issue, but since I was looking this myself, and noticed this I thought I'd share what I found.
So. The simple examples:
s SELECT INBOX
a APPEND INBOX (\Seen) CATENATE (TEXT {53+}
Date: Tue, 03 Jan 2017 22:39:40 +0200
Hello, world.
)
This will work with modern system. You can also use
s SELECT INBOX
a APPEND INBOX (\Seen) CATENATE (TEXT {53}
Date: Tue, 03 Jan 2017 22:39:40 +0200
Hello, world.
)
The thing about catenate is that it can also combine input from other emails. You can do this with URL.
a APPEND INBOX CATENATE (URL "/INBOX;UIDVALIDITY=1483364905/;UID=2/;SECTION=HEADER" TEXT {8}
Hello..
)
a OK [APPENDUID 1483364905 4] Append completed.
FETCH 4:4 (BODY[])
Date: Tue, 03 Jan 2017 22:39:40 +0200
Hello..
)
a OK Fetch completed.
And we have reused headers from mail with UID 2 in INBOX. UIDVALIDITY can be acquired by saying s STATUS INBOX.
The examples in the IETF are bit spooky, but they show how to use mime multipart as input.

how to use Use images (html tag)in message body of net smtp in ruby on rails?

I m developing web application using Ruby on Rails. I want to display an image in mail using net/smtp..
my code is...
msgstr = <<END_OF_MESSAGE
From: Your Name <your#mail.address>
To: Destination Address <someone#example.com>
MIME-Version: 1.0
Content-type: text/html
Subject: test message
Date: Sat, 23 Jun 2001 16:26:43 +0900
Message-Id: <unique.message.id.string#example.com>
<img src = "/my_proj/public/images/logo.jpeg" alt= "logo">
<b> This is a test message.</b>
END_OF_MESSAGE
require 'net/smtp'
Net::SMTP.start('your.smtp.server', 25) do |smtp|
smtp.send_message msgstr,
'your#mail.address',
'his_addess#example.com'
end
It is sending mail with all tags but not displaying th image while displaying alternate text. I hav put jpeg file every where n tested it.. but its not gettng the path of file and diplying the alternate text. Please anyone help me.. how to define path of file... or where to put this image file.
I have changed
Content-type: text/html image/jpeg
but still its not working.

imap command for save a message to draft

i'm building a simple webMail and use imap protocol.
i want to add draft option to my webmail & need an imap command for save a message(which not completed composition) in draft folder?
could anybody help me?
Use the APPEND command. It doesn't matter if the message is incomplete. As long as it's a properly formatted email with a header and a body, you can add it to a folder.
APPEND is in fact the only command that exists in IMAP that allows you to add new content to the remote server, so you would use the same command to save the completed message to a "Sent" folder.
Example:
C: A003 APPEND saved-messages (\Seen) {310}
S: + Ready for literal data
C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
C: From: Fred Foobar
C: Subject: afternoon meeting
C: To: mooch#owatagu.siam.edu
C: Message-Id:
C: MIME-Version: 1.0
C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
C:
C: Hello Joe, do you think we can meet at 3:30 tomorrow?
C:
S: A003 OK APPEND completed

ActionMailer - limit on number of recipients?

I've got Capistrano set up to send emails after deploying my RoR (2.3.8) application. I have a config/cap_mailer.rb file that basically looks like:
ActionMailer::Base.smtp_settings = {
:address => my,
:port => exchange,
:domain => server,
:authentication => settings,
:user_name => are,
:password => here
}
class CapMailer < ActionMailer::Base
def deploy_notification(cap_vars)
recipients cap_vars[:notify_emails]
from 'deploy#my.org'
subject "New app!"
body "Deployed application...blah blah blah"
end
end
Then, in my deploy.rb file, I have the following:
require 'config/cap_mailer.rb'
...
desc "Email recipients of deployment"
task :notify do
puts " * Sending notification email"
set :notify_emails, ["test1#my.org", "test2#my.org", etc.]
CapMailer.deliver_deploy_notification(self)
end
Now this all works fine and dandy......until I put more than 7 email addresses in the :notify_emails array. Up to 7 works fine, but when I put 8 or more (all valid addresses), the email gets screwed up a little bit (still goes through to the first 7, at least). Looking at the email header, it shows that it is cutting off the 8th (and 9th, 10th, ...) address from the 'To:' and putting it in the message body.
HEADER:
thread-index: AcyaZxlga08L9p35QYKJ22aiGG2zeA==
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By ...
Received: from exchange.my.org ([ip address]) by ...; Thu, 3 Nov 2011 14:28:08 -0600
Date: Thu, 3 Nov 2011 14:28:08 -0600
From: deploy#my.org
To: test1#my.org,
test2#my.org,
test3#my.org,
test4#my.org,
test5#my.org,
test6#my.org,
test7#my.org
HEADER:
BODY:
test8#my.org
Message-Id:
<4eb2f95816341_135ff800c21ac130#my_box.local.tmail>
Subject: New app!
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Return-Path: deploy#my.org
X-OriginalArrivalTime: 03 Nov 2011 20:28:08.0494 (UTC)
FILETIME=[19601CE0:01CC9A67]
Deployed application...blah blah blah
BODY:
In addition, the subject does not appear on the email, even though the "error text" in the message body shows the correct subject.
Does anyone have any idea why this is happening? What is it about having 8 or more recipients that breaks it? I've Googled around and can't find anything about ActionMailer having a limit on the number of recipients (even if there were, that's a small limit). Is there something I'm missing? Any help is appreciated! I really need to be able to send to 8 or more recipients.
UPDATE: Setting the recipients directly with an array of 8 or more addresses still breaks things, so this clearly seems like a problem with ActionMailer and not Capistrano.
recipients ["test1#my.org", "test2#my.org", "test3#my.org", "test4#my.org",
"test5#my.org", "test6#my.org", "test7#my.org", "test8#my.org", "test9#my.org"]
The 7th email address is not followed by a comma, which could be the problem. Try passing a string to recipients, like cap_vars[:notify_emails].join(','), with no newlines.
Try passing a string to recipients without commas (there have been reports of commas as a problem), like:
cap_vars[:notify_emails].join(' ')
With all respect some simple things that you might overlook in debugging difficult errors:
If its mail server related install it on another production server? If you not sure it is the mail server acting up looking for another error may be of no help.
Try upgrade rails / ruby ? Perhaps its a bug in the code

Resources