messages not kept in sent folder in mu4e emacs - emacs

I have mu4e smtp setup with the default mu4e mail sending function.
I tried nullmailer but I didn't manage to configure it to work from mu4e.
I was following this tutorial for nailmailer, and this one for the default setup.
I was trying with and without a code that's recommended for gmail (my account is not gmail) because of the way gmail saves the sent items , in order to avoid duplicates (see here for mu4e user manual):
;; don't save messages to Sent Messages, Gmail/IMAP takes care of this
(setq mu4e-sent-messages-behavior 'delete)
The problem I'm facing at the moment is that the sent emails are not saved to the sent folder, not locally and not on the server.
my init file looks like this:
(setq mu4e-sent-folder "/sent"
mu4e-drafts-folder "/drafts"
message-send-mail-function 'smtpmail-send-it
user-mail-address "MY.EMAIL.ADDRESS"
smtpmail-default-smtp-server "MY.SMTP.SERVER"
smtpmail-smtp-server "MY.SMTP.SERVER"
smtpmail-stream-type 'starttls
smtpmail-smtp-service 587)

I found it ..
(require 'smtpmail)
was missing from my init file.
No wonder there was little interest in my question...

Related

How to use applescript to tell Mail to keep a copy of sent message

I use AppleScript and can send messages without any problem, but the "Sent" box does not get a copy of what I sent. However, if I use Mail Application to send messages, the "Sent" box gets a copy of what I sent. So I guess my AppleScript may miss a command or so to tell Mail to keep a copy of the sent messages. What's the command that I missed? Thanks.
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return, visible:true}
tell theNewMessage
set visibile to false
set sender to theSender
make new to recipient at end of to recipients with properties {address:theAddress}
make new attachment with properties {file name:theAttachment} at after the last paragraph
send
delay 5
end tell
end tell
I don’t think you’re missing any command. I copied your script to Script Editor on my iMac, set values for theSubject, theBody, theAddress, theSender, and theAttachment, and ran it. It (a) successfully sent the message, and (b) I was able to view the message it sent in my Sent mailbox.
I tried this both with a known sender and with a random example.com sender. In both cases, it was saved in the default Sent box.
So the issue most likely lies elsewhere. Make sure that the value you’re currently using for theSender maps to an account in Mail that saves sent messages. (If it’s an IMAP account, it may be saving sent messages on the server, and server behavior may be affecting what you see.)
If that doesn’t work, set up some test values for all of the variables in the script except theAddress (using example.com for theSender), and include those (except theAddress) in your question. (If you can use example.com for theAddress, too, do that, but some servers will simply refuse the message immediately, which makes it worthless for testing this particular case.)
Note that you have an error that does not change this behavior; you have “visible” misspelled as “visibile”. However, I tried it both ways and in both cases the outgoing message does get stored in the appropriate Sent box.
Try adding this after you send the message...
set accountReference to first account whose name = "my account name"
synchronize with accountReference

Automatically forward email attachment as textual link in another email

This might be an odd request but I know there must be a way. Here's what I have and would like to do:
Input:
1) An email is sent with an attachment
2) The attached file is a jpg image
Output:
3) An email should be received with a tiny link in the email body
4) The tiny link should point to the image viewable in a browser
Additional Criteria:
5) The destination email address to which the original message is sent can be altered
6) The format of the original mail cannot be altered; the image is always attached
7) The process must be automated, triggered by the original email
I have gmail accounts and a Linux server that could potentially be used but not sure where to start. I've searched quite a bit and found a lot of software that do similar tasks but nothing like this specifically. It seems to be a fairly complicated task and I could use some ideas. Any help is appreciated.
This was a bit of a challenge but I managed to get it done. Here's how:
Input:
1) Send the email with attachment to local postfix smtp server
Processing:
2) Have postfix call procmail when email is received
3) Use procmail as a filter to conditionally call a script
Custom script:
4) Use munpack to convert the attachment to file
5) Use a script to upload the image file to imgur
6) Use a script to make the imgur link tiny
Output:
7) Send an email using mutt with the link in the body
The main problem I had was setting up postfix and finding bugs in the clients trying to send email to the local postfix server. I used an array of tutorials, IRC and tools to debug but tcpdump revealed the final smoking gun.

Mutt Send Signature Hook

I've got a send hook setup in Mutt for my signature. I usually have a few links in my sig that one customer of mine doesn't like, their email always spits it back. So to fix this I made a new signature file just for this client and setup a send hook in mutt that when it's going to this client it adds this special signature:
send-hook "~t #domain.com" set signature=~/.mutt/branded.sig
set signature="~/.mutt/sig"
The problem now is that once I send an email to this customer then all other emails even if they go to another email address now have the new signature.
How do I tell Mutt that anything other than that email gets the regular signature?
Instead of that second "set signature" line, you want to set another send-hook for "anything other than that".
For example:
send-hook . set signature="~/.mutt/sig"
send-hook "~t #domain.com" set signature=~/.mutt/branded.sig

Mail list address visible in receivers To: field

I'm trying to set up a custom mailing list for my site.
When a user(user#bar.com) sends a mails to list#foo.com. The mail should automatically be sent to the subscribers.
Making the actual sending isn't that hard. But when the emails get delivered I get the "This message may not have been sent by..." warning.
This doesn't look to Cool.
First:
How do I prevent this message from showing (Most important)
How can I make the receiver see the list#foo.com address instead of their own. (Like google's mailing lists)
Note: The receiver should still be able to see the actual sender in the from field.
I've read some other posts on the topic, mentioning all kinds off different headers. But I Can't seem to get it to work.
I'm using PHPmailer and heres a part of my code:
<?php
include(class.phpmailer.php);
$real_to = "user#bar.com";
$mail = new PHPMailer();
$mail->IsMail();
$mail->AddReplyTo($_POST['from_mail'], $_POST['from_name']);
$mail->Host = "mail.foo.com";
$mail->From = $_POST['from_mail'];
$mail->Sender = "list#foo.com";
$mail->MessageID = $_POST['msgID'];
$mail->FromName = $_POST['from_name'];
$mail->AddAddress($listmail);
$mail->Subject = $_POST['subject'];
$mail->ContentType = $_POST['content_type'];
$mail->addCustomHeader("X-BeenThere: " . $listmail);
$mail->addCustomHeader("Precedence: list");
$mail->addCustomHeader("Precedence: list");
$mail->addCustomHeader("Envelope-To: " . "list#foo.com");
//$mail->addCustomHeader("Received: " . $_POST['received']);
$mail->Body = $_POST['body'];
$mail->Send();
?>
I'm not so sure about what is needed in php code, but here are some general mail-server tips. It is possible that some of your problem might lie in your header information or in your mail-server's configuration.
When I used our local mailserver to send messages to mailing lists, I discovered that people were not receiving mail on certain domains. When I looked through the mail server logs (hMailServer) I saw that the server on the recipient was rejecting the messages.
The problem turned out to be that my domain was missing a reverse ip lookup registration in the ISP's domain settings.
I believe this can also be the source of some mail recipients getting your messages tagged with spam notices and warnings (as your case may be).
Another point to consider is that you have a return-path address specified in your headers - this is not the same as the reply address - it is a setting used by mail-servers when they talk to each other. Check out this little troubleshooting guide.
I ended up making a cronjob that updated the mail list adding all recipients as aliases instead.
This solved all wierd message about the massage not originating from the sender. I dont know if this is a good method. But it works.
I also added a PTR reccord. Installed DKIM suport and set up a SPF reccord. This solved all spam marking.
Now the problem is solved.

email not proper in rails 3

I've same problem like here. But still not able to solve it.
I've followed steps from here. but doing so doesn't sends mail.
The log file says: Mail is sent. but at the other side mail is not received.
Any ideas why?
Check your SMTP settings and make sure you have defined the right settings for your e-mail host. If you are using a sender e-mail other than Gmail then your settings will be different to the ones used in the Railscast.
The file to check is here: config/initializers/setup_mail.rb.
Edit: It still may be possible that the settings you used in jsp may not match perfectly with the 'phrasing' that Rails expects in the setup_mail.rb file. I have frequently come up against this problem where a slight difference in what SMTP settings you mention / don't mention / how they are worded will determine whether the e-mails send/receive or not.
If your logs show the e-mail is sending to a valid e-mail address (and you are not receiving those e-mails in your inbox or spam filter) then the problem, as far as I know, is most likely to be your SMTP. My advice is to check online for the Rails-specific SMTP settings for your e-mail provider, or in the case that you cannot find them, try different combinations until you find the correct one.
Okay the problem is solved. Problem was my file corresponding to action was not at proper place. Here is quick view on how to do it:
Add following to actionmailer:-
def send_mail
attachments['1.pdf'] = File.read('c:/1.pdf')
mail(:to => "harsh#xyz.com", :subject => "xyz", :from=>"harsh#xyz.com")
mail.deliver
end
Notes:- Make sure that the smtp settings are correct and the file corresponding to the action (In this example send_mail.rhtml) is present under appropriate folder.