Help with sending messages

102 views
Skip to first unread message

Charles-H. Schulz

unread,
Mar 20, 2015, 3:10:01 PM3/20/15
to mu-di...@googlegroups.com
Hello,

Sorry to come back on this issue. I installed, configured and set mu4e, offlineimap, etc. and all this works well. I really like it. But I cannot for the life of me understand what I'm supposed to do about the SMTP part.

Reading the manual, I should use the smtpmail package to connect to my different smtp servers; the rest is done through message mode.

Checking both marmalade and elpa I don't have smtpmail, and it does not seem to be built in. Adding my smtp credentials to my init file does not help either. What am I missing?

Thanks,

Charles.

Dirk-Jan C. Binnema

unread,
Mar 20, 2015, 3:34:35 PM3/20/15
to mu-di...@googlegroups.com
Smtpmail is part of emacs.

I'd recommend starting with setting up a normal, single account as in
the manual, and only start with multiple smtp-servers if that works.

Apart from that, I understand it's frustrating when things do not work
as expected, but to get help from the list, please be very precise in
what you tried, what you expected to happen, and what actually happened.

Cheers,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Charles-H. Schulz

unread,
Mar 20, 2015, 5:31:33 PM3/20/15
to mu-di...@googlegroups.com

Hello Dirk-Jan,

Le 20 mars 2015 20:34, "Dirk-Jan C. Binnema" <dj...@djcbsoftware.nl> a écrit :
>
>
> On Friday Mar 20 2015, Charles-H. Schulz wrote:
>
> > Hello,
> >
> > Sorry to come back on this issue. I installed, configured and set mu4e,
> > offlineimap, etc. and all this works well. I really like it. But I cannot
> > for the life of me understand what I'm supposed to do about the SMTP part.
> >
> > Reading the manual, I should use the smtpmail package to connect to my
> > different smtp servers; the rest is done through message mode.
> >
> > Checking both marmalade and elpa I don't have smtpmail, and it does not
> > seem to be built in. Adding my smtp credentials to my init file does not
> > help either. What am I missing?
>
> Smtpmail is part of emacs.
>
> I'd recommend starting with setting up a normal, single account as in
> the manual, and only start with multiple smtp-servers if that works.

Hadn't thought of that and thank you for your answer!

>
> Apart from that, I understand it's frustrating when things do not work
> as expected, but to get help from the list, please be very precise in
> what you tried, what you expected to >happen, and what actually happened.

Indeed, I should have and will try to be the next time. For the first time in years I do feel like a newbie :-)

Thanks again, I will let the list know how it went.

Best,

Charles.

>
> Cheers,
> Dirk.
>
> --
> Dirk-Jan C. Binnema                  Helsinki, Finland
> e:dj...@djcbsoftware.nl           w:www.djcbsoftware.nl
> pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
>

> --
> You received this message because you are subscribed to the Google Groups "mu-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Charles-H. Schulz

unread,
Mar 22, 2015, 2:07:14 PM3/22/15
to mu-di...@googlegroups.com
Hello again,

So, here are a couple more points that I would need to get clarified. 
I commented out all the SMTP servers except one, and I tried sending messages from that outgoing server only. I got the same result, meaning: message-mode will appear with a From field that reads like system user name (me) @localhost. The To field has the right address. 

Several details caught my attention. The Message ID field claims it is not configured :
"<xyz@localhost-i-did-not-set--mail-host-address--so-tickle-me>"

On top of that, mu4e won't launch without forcing me to set up a set of local Sent, Draft and Trash folders. This of course leads me to think that something does not tell the system to use the SMTP server. The error message I get if I refuse to set the local folders is that the (mu4e-sent-folder) has not been configured. Searching in my init file does indeed confirm it has not been configured but I thought I had configured the SMTP part already?

When attempting to compose and send a message myself, the default settings will ask me the type of outgoing server, its address and my credentials. But I will get the following error message and the message will not be sent:

" Sending via mail...
smtpmail-send-it: Sending failed: 554 5.7.1 <da...@dodo.net>: Relay access denied "

How can I edit the smtpmail config to make it send through the smtp server of my choice?

Thanks,

Charles.



> To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+unsubscribe@googlegroups.com.

Alexis

unread,
Mar 22, 2015, 10:33:28 PM3/22/15
to mu-di...@googlegroups.com

On 2015-03-23T05:07:12+1100, Charles-H. Schulz
<charles....@gmail.com> said:

CS> On top of that, mu4e won't launch without forcing me to set
up a CS> set of local Sent, Draft and Trash folders. This of
course leads CS> me to think that something does not tell the
system to use the CS> SMTP server. The error message I get if I
refuse to set the local CS> folders is that the
(mu4e-sent-folder) has not been CS> configured. Searching in my
init file does indeed confirm it has CS> not been configured but
I thought I had configured the SMTP part CS> already?

SMTP is about 'email in motion' (Simple Mail /Transfer/ Protocol),
not
'email at rest'. So when you configure your SMTP setup, you're
telling
the system how to send email, not where to keep a copy of that
same
email depending on whether or not sending was successful. Thus, in
addition to configuring SMTP, you need to configure a 'sent'
folder appropriately.


Alexis.

Charles-H. Schulz

unread,
Mar 23, 2015, 6:01:50 AM3/23/15
to mu-di...@googlegroups.com
Hello Alexis,


Indeed; I had overlooked that point and thought that just setting the smtp server details would have mu4e automatically store messages on the server itself. Thanks for the tip!
How would I set it then? Something like the line below?
(setq (mu4e-sent-folder) "smtp.myoutgoingserver.com") 

The second issue would be to configure mu4e to store sent mails on several smtp servers matching the email it's been sent to...

Thanks,

Charles.
 

Alexis

unread,
Mar 23, 2015, 6:41:15 AM3/23/15
to mu-di...@googlegroups.com

On 2015-03-23T21:01:49+1100, Charles-H. Schulz
<charles....@gmail.com> said:


CS> Indeed; I had overlooked that point and thought that just
setting CS> the smtp server details would have mu4e automatically
store CS> messages on the server itself. Thanks for the tip! How
would I CS> set it then? Something like the line below? (setq
CS> (mu4e-sent-folder) "smtp.myoutgoingserver.com")

CS> The second issue would be to configure mu4e to store sent
mails CS> on several smtp servers matching the email it's been
sent to...

No, an SMTP server is something that only stores mail as part of
the process of forwarding it on to its destination. Fundamentally,
it's not a mail storage system; it's a mail delivery system. An
SMTP server is but a waypoint, in the same manner that a post
office isn't (usually!) the /ultimate/ destination for mail, but
merely a temporary stop on the way to that destination.

Consequently, `mu4e-sent-folder` needs to specify a storage
location on a system that /does/ handle mail storage. In my case,
i don't use IMAP-based email, and simply store sent messages on my
laptop, in a folder called "sent", which is itself within a folder
~/.Mail.

Thus, my `mu4e` setup looks in part like:

(setq mu4e-maildir "~/.Mail")
(setq mu4e-sent-folder "/sent")

Note, however, that mail can be stored on POP3 servers:

https://en.wikipedia.org/wiki/Post_Office_Protocol

or IMAP servers:

https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol

To a first approximation, if you're wanting to store the mail you
send somewhere other than the device you're sending it from, you
probably wanting to set up `mu4e` to use IMAP (assuming your email
provider supports it).


Alexis.

Charles-H. Schulz

unread,
Mar 23, 2015, 6:48:51 AM3/23/15
to mu-di...@googlegroups.com
 I'd want to store the email locally (and I know how to do that) but also ensure it is stored somewhere on the server itself. This would indeed mean something like that for me:
(setq mu4e-sent-folder "~/.Maildir/XYZ/Sent")
But I'd need to ensure a copy is sent to the sent folder of my xyz.com server through smtp. I already have the smtp settings for that in my init file, and that's what I don't understand, as it won't pick up a default From field + Sent folder whenever I compose or want to reply to an email. But we're coming closer to the solution I think :-)

Thanks

Charles. 

Alexis

unread,
Mar 23, 2015, 7:08:09 AM3/23/15
to mu-di...@googlegroups.com

On 2015-03-23T21:48:50+1100, Charles-H. Schulz
<charles....@gmail.com> said:


CS> I'd want to store the email locally (and I know how to do
that) CS> but also ensure it is stored somewhere on the server
itself. This CS> would indeed mean something like that for me:
(setq CS> mu4e-sent-folder "~/.Maildir/XYZ/Sent") But I'd need to
ensure a CS> copy is sent to the sent folder of my xyz.com server
through CS> smtp.

But as i've mentioned a couple of times now, end-users basically
can't use an SMTP server for email storage. (Just as people
generally can't use their local post office to store, on a
long-term basis, all their physical mail.) And as i said at the
end of my last email, the most likely way you /can/ store sent
email on a remote server is via IMAP, /not/ SMTP.


Alexis.

Charles-H. Schulz

unread,
Mar 23, 2015, 10:59:31 AM3/23/15
to mu-di...@googlegroups.com
 I got that - so would it work then if I were to set the following?
(setq mu4e-sent-folder "~/Maildir/XYZ/sent")
(setq mu4e-sent-folder "imap.xyz.com/sent")

Best,

Charles.

Dirk-Jan C. Binnema

unread,
Mar 23, 2015, 11:21:17 AM3/23/15
to mu-di...@googlegroups.com
Note, the top one should not be a file-system path, but a maildir,
relative to `mu4e-maildir'. See the documentation:
C-h v mu4e-sent-folder RET

Getting your local mu4e-sent-folder synchronized with an IMAP folder is
a job for e.g. offlineimap. There are examples of all this in the
manual.

Charles-H. Schulz

unread,
Mar 23, 2015, 11:55:18 AM3/23/15
to mu-di...@googlegroups.com
2015-03-23 16:21 GMT+01:00 Dirk-Jan C. Binnema <dj...@djcbsoftware.nl>:

On Monday Mar 23 2015, Charles-H. Schulz wrote:

> 2015-03-23 12:08 GMT+01:00 Alexis <flexi...@gmail.com>:
>
>>
>> On 2015-03-23T21:48:50+1100, Charles-H. Schulz <charles....@gmail.com>
>> said:
>>
>>
>> CS>  I'd want to store the email locally (and I know how to do that) CS>
>> but also ensure it is stored somewhere on the server itself. This CS> would
>> indeed mean something like that for me: (setq CS> mu4e-sent-folder
>> "~/.Maildir/XYZ/Sent") But I'd need to ensure a CS> copy is sent to the
>> sent folder of my xyz.com server through CS> smtp.
>>
>> But as i've mentioned a couple of times now, end-users basically can't use
>> an SMTP server for email storage. (Just as people generally can't use their
>> local post office to store, on a long-term basis, all their physical mail.)
>> And as i said at the end of my last email, the most likely way you /can/
>> store sent email on a remote server is via IMAP, /not/ SMTP.
>>
>>
>  I got that - so would it work then if I were to set the following?
> (setq mu4e-sent-folder "~/Maildir/XYZ/sent")
> (setq mu4e-sent-folder "imap.xyz.com/sent")

Note, the top one should not be a file-system path, but a maildir,
relative to `mu4e-maildir'. See the documentation:
  C-h v mu4e-sent-folder RET

Getting your local mu4e-sent-folder synchronized with an IMAP folder is
a job for e.g. offlineimap. There are examples of all this in the
manual.


Hah - it is becoming clearer now :-)
Let's see... 

thanks,

Charles. 

Charles-H. Schulz

unread,
Mar 24, 2015, 3:56:24 AM3/24/15
to mu-di...@googlegroups.com
Hello,

It seems I'm making progress. I set the default maildir and sent folder; but this time I cannot compose or reply a message and I get the following : " Symbol's function definition is void: my-mu4e-set-account" which is used by the Compose pre-hook. I added a (setq my-mu4e-set-account "XYZ") which is my default account but obviously it does not work. Did I understand it right that I need to define my default account from which I'll compose my messages?

Thanks,

Charles.

Charles-H. Schulz

unread,
Mar 24, 2015, 9:39:25 AM3/24/15
to mu-di...@googlegroups.com

Hello again,


Plezse disregard my post above. Reading the doc on the multiple account settings I have identified what the function depends on. As I only use one smtp account it does not seem to be needed at this time.

More on this later, and sorry for the inconvenience.

Charles.


Charles-H. Schulz

unread,
Mar 26, 2015, 6:49:37 PM3/26/15
to mu-di...@googlegroups.com
hello everyone,

I've made some real progress. In fact it seems that handling the sending of emails from several servers is pretty much done in the sense that: when I reply to a message, the right from: field will appear as expected but for some reason I have problem with smtpmail now. When sending the message, I get a "smtpmail not running".  I did eval it though but I'm at pain understanding what's wrong...

Best,

Charles.

Charles.



Charles-H. Schulz

unread,
Mar 27, 2015, 6:44:17 PM3/27/15
to mu-di...@googlegroups.com
Hello,

2015-03-26 23:49 GMT+01:00 Charles-H. Schulz <charles....@gmail.com>:
hello everyone,



I've made some real progress. In fact it seems that handling the sending of emails from several servers is pretty much done in the sense that: when I reply to a message, the right from: field will appear as expected but for some reason I have problem with smtpmail now. When sending the message, I get a "smtpmail not running".  I did eval it though but I'm at pain understanding what's wrong...



More specifically, aside the "smtpmail not running" output which is a bit baffling, when composing a message I will get the following output: "Wrong type argument: sequencep, smtpmail-smtp-server" and no new message buffer will be opened. So there's something with the smtp that I don't get right; perhaps part of it is that I did something wrong (or didn't do enough to configure) message-mode? Keep in mind that emacs read my init file without any error message output when starting emacs.

Thanks for your help,

Charles.

Jon Miller

unread,
Mar 27, 2015, 7:27:16 PM3/27/15
to mu-di...@googlegroups.com
I believe the recommendation earlier was to use msmtp for sending your
email. A common set of variables to set would be the following:

(setq message-send-mail-function 'message-send-mail-with-sendmail
sendmail-program "msmtp")

If you Google search for "mu4e msmtp" you'll find plenty of mu4e user's blog
posts about configuring it properly. I personally set a my-mu4e-account-alist
variable[1] with my multiple account information but I've introduced a
`msmtp-account' variable that will match the 'account' line within my ~/.msmtprc
file. I then have a function that is ran in the `message-send-mail-hook' to
set the `message-sendmail-extra-arguments' variable[2] which is then passed
along to the invocation of msmtp for sending the mail.

[1]: https://github.com/jonEbird/dotfiles/blob/master/.emacs.d/my_configs/email_config.el#L9
[2]: https://github.com/jonEbird/dotfiles/blob/master/.emacs.d/my_configs/email_config.el#L159-L181

--
Jon Miller

Charles-H. Schulz

unread,
Mar 28, 2015, 6:19:24 AM3/28/15
to mu-di...@googlegroups.com

Hello Jon,

I do not believe that msmtp was recommended, rather what was said was that smtpmail is part of emacs (and it is) and has to be configured properly to work with mu4e .

That being said I shall keep msmtp and your pointers as an option if I cannot figure out the actual issue at hand. I have seen several people around who recommend msmtp with mu4e.

Thanks,

Charles.

Gour

unread,
Mar 29, 2015, 3:05:48 AM3/29/15
to mu-di...@googlegroups.com
"Charles-H. Schulz" <charles....@gmail.com> writes:

> I do not believe that msmtp was recommended, rather what was said was that
> smtpmail is part of emacs (and it is) and has to be configured properly to
> work with mu4e .

Based on some reading in Emacs wiki, I've got a feeling that smtpmail is
not suitable for multiple-accounts setup and that msmtp is recommended
which I also use atm with Gnus.

However, I noticed some mu4e-related posts using smtpmail and wonder
what is, in general, considered better/simpler/recommended way for mu4e
& multiple accounts?


Sincerely,
Gour

--
One who restrains the senses of action but whose mind dwells on
sense objects certainly deludes himself and is called a pretender.

Charles-H. Schulz

unread,
Mar 29, 2015, 4:35:32 AM3/29/15
to mu-di...@googlegroups.com

Hello Gour,

Le dim 29 mars 2015 09:05, Gour <go...@atmarama.net> a écrit :

"Charles-H. Schulz" <charles....@gmail.com> writes:

>  I do not believe that msmtp was recommended, rather what was said was that
> smtpmail is part of emacs (and it is) and has to be configured properly to
> work with mu4e .

Based on some reading in Emacs wiki, I've got a feeling that smtpmail is
not suitable for multiple-accounts setup and that msmtp is recommended
which I also use atm with Gnus.

However, I noticed some mu4e-related posts using smtpmail and wonder
what is, in general, considered better/simpler/recommended way for mu4e
& multiple

accounts?



There is an elisp package available called smtp-multi but it is very unclear how to use it. I thought it would have replaced smtpmail but it did not - it seems to work in conjunction with it. I haven't figured it out yet and do not believe it is even necessary to use it.

I have read good things about nullmailer as well.

Hope this helps,

Charles.

Xavier Maillard

unread,
Mar 29, 2015, 8:47:16 AM3/29/15
to mu-di...@googlegroups.com
Hello,

That would be valuable if everyone on this mailing-list could try to
be concice: please cite and quote the part you want to comment on
instead of answering the whole thing.

I found this topic interesting but, this is getting a whole mess
since there is clearly something wrong in your citation setup.

Please fix that ;)

Thank you.

P.S: I keep the message intact just to show you what's wrong.
-- Xavier.

Eduardo Mercovich

unread,
Apr 15, 2015, 4:21:28 PM4/15/15
to mu-di...@googlegroups.com
Hi.

> > I do not believe that msmtp was recommended, rather what was said
> > was that smtpmail is part of emacs (and it is) and has to be
> > configured properly to work with mu4e .[...]

> [...] I thought it would have replaced smtpmail but it
> did not - it seems to work in conjunction with it. I haven't figured it
> out yet and do not believe it is even necessary to use it.

I have mu4e running with multiple accounts (although all are Google
based, the only new one does not still fights me) and I don't have msmtp
installed, at least from the info in my (Debian) package manager.

> I have read good things about nullmailer as well.

I did also, and like the idea very much, since sending mail is the only
thing that makes me wait in mu4e, because it's in realtime. The best
reference I saw is in
http://vxlabs.com/2014/06/06/configuring-emacs-mu4e-with-nullmailer-offlineimap-and-multiple-identities/

Does anyone tried it? (that is not Charl Botha, which I believe is on
this list too). :)

It's on my TODO list for mu4e, which runs slow since I still don't know
much and so, these experiments take me a ridiculous long time.

Best...

--
e

Gour

unread,
Apr 16, 2015, 1:30:08 AM4/16/15
to mu-di...@googlegroups.com

Eduardo Mercovich <eduardo....@gmail.com> writes:

> Does anyone tried it? (that is not Charl Botha, which I believe is on
> this list too). :)

I use multiple (mostly non-Gmail) accounts and msmtp is deployed for sending
mail.


Sincerely,
Gour

--
Everyone is forced to act helplessly according to the qualities
he has acquired from the modes of material nature; therefore no
one can refrain from doing something, not even for a moment.

Reply all
Reply to author
Forward
0 new messages