unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* file-error "not a regular file"
@ 2015-12-28  3:07 Peter Salazar
  2015-12-28  4:01 ` fauno
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Salazar @ 2015-12-28  3:07 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

Hello,

I'm using notmuch-mode from within Emacs to send email using async/mbsync
through Gmail. However, every time I send email from within Emacs, I get
this error:

Debugger entered--Lisp error: (file-error "not a regular file"
"/Users/peter/Dropbox/mail/gmail/sent")
  insert-file-contents("/Users/peter/Dropbox/mail/gmail/sent" nil 0 100)
  mail-file-babyl-p("/Users/peter/Dropbox/mail/gmail/sent")
  message-output("/Users/peter/Dropbox/mail/gmail/sent")
  message-do-fcc()
  message-send()
  send-message-without-bullets()
  call-interactively(send-message-without-bullets nil nil)
  command-execute(send-message-without-bullets)

Does anyone know how to fix this?

I can share relevant details from my .mbsyncrc if that would be helpful.

Thanks!

[-- Attachment #2: Type: text/html, Size: 1054 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-28  3:07 file-error "not a regular file" Peter Salazar
@ 2015-12-28  4:01 ` fauno
  2015-12-28 14:46   ` David Bremner
  0 siblings, 1 reply; 12+ messages in thread
From: fauno @ 2015-12-28  4:01 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

Peter Salazar <cycleofsong@gmail.com> writes:

> Hello,
>
> I'm using notmuch-mode from within Emacs to send email using async/mbsync
> through Gmail. However, every time I send email from within Emacs, I get
> this error:

i got this message too for fcc with default values, i'm on emacs 24.5
with notmuch 0.21

-- 
:O

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 584 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-28  4:01 ` fauno
@ 2015-12-28 14:46   ` David Bremner
  2015-12-29  0:36     ` fauno
  2015-12-29  5:54     ` file-error "not a regular file" Peter Salazar
  0 siblings, 2 replies; 12+ messages in thread
From: David Bremner @ 2015-12-28 14:46 UTC (permalink / raw)
  To: fauno, notmuch, Peter Salazar

fauno <fauno@kiwwwi.com.ar> writes:

> Peter Salazar <cycleofsong@gmail.com> writes:
>
>> Hello,
>>
>> I'm using notmuch-mode from within Emacs to send email using async/mbsync
>> through Gmail. However, every time I send email from within Emacs, I get
>> this error:
>
> i got this message too for fcc with default values, i'm on emacs 24.5
> with notmuch 0.21
>

Can either of you replicate the problem with a minimal configuration,
ideally with "emacs -q", followed by "M-x load-library <return>
notmuch"?

If so, does the path in the Fcc header exist? If so, what is it? a file,
a directory, a symlink?

For me, in emacs 24.5 / notmuch 0.21, with emacs -q, if that path is
missing I am prompted to create it. If I refuse, then I later get a
message about not being a maildir.

I guess the tl;dr is that I can't duplicate this problem. Looking at the
traceback Peter provided, it looks like he is using
"send-message-without-bullets" to send the message. Since this isn't a
notmuch function, it's likely bypassing the notmuch fcc setup that
notmuch-mua-send and notmuch-mua-send-and-exit do.


d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-28 14:46   ` David Bremner
@ 2015-12-29  0:36     ` fauno
  2015-12-30  9:38       ` Michal Sojka
  2015-12-29  5:54     ` file-error "not a regular file" Peter Salazar
  1 sibling, 1 reply; 12+ messages in thread
From: fauno @ 2015-12-29  0:36 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 583 bytes --]

David Bremner <david@tethera.net> writes:

> I guess the tl;dr is that I can't duplicate this problem. Looking at the
> traceback Peter provided, it looks like he is using
> "send-message-without-bullets" to send the message. Since this isn't a
> notmuch function, it's likely bypassing the notmuch fcc setup that
> notmuch-mua-send and notmuch-mua-send-and-exit do.

i've found the issue.  i'm using jl-encrypt that expects email written
in message-mode, and since notmuch is now a minor mode some functions
that were expected to be there didn't work anymore.

-- 
:O

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 584 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-28 14:46   ` David Bremner
  2015-12-29  0:36     ` fauno
@ 2015-12-29  5:54     ` Peter Salazar
  2015-12-29 20:44       ` David Bremner
  1 sibling, 1 reply; 12+ messages in thread
From: Peter Salazar @ 2015-12-29  5:54 UTC (permalink / raw)
  To: David Bremner; +Cc: fauno, notmuch

[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]

Hi David,

Thanks for looking into this. Much appreciated.

Yes, following your steps, emacs -q followed by "M-x load-library <return>
notmuch", I was able to send an email without the error. It prompted me for
my smtp server, username, and password, then returned this:

Sending email
Sending email done
Invalid image size (see `max-image-size')
Mark set
Saving file
/Users/peter/Dropbox/mail/gmail/sent/tmp/1451367804.6837_72197_1.Infinity.local...
Wrote
/Users/peter/Dropbox/mail/gmail/sent/tmp/1451367804.6837_72197_1.Infinity.local
Sending...done

To answer your other question, yes, there is an Fcc: header when I try to
send email from my regular Emacs configuration. It's the same header I saw
when I sent email from the minimal configuration:

Fcc: /Users/peter/Dropbox/mail/gmail/sent

That directory does indeed exist:

drwxr-xr-x@ 9 peter  staff  306 Dec 27 21:54 *sent*
And it contains:

.DS_Store    .mbsyncstate *.nnmaildir*   .uidvalidity *cur*          *new*
        *tmp*
Does this give us any leads?

Thanks again.

On Mon, Dec 28, 2015 at 9:46 AM, David Bremner <david@tethera.net> wrote:

> fauno <fauno@kiwwwi.com.ar> writes:
>
> > Peter Salazar <cycleofsong@gmail.com> writes:
> >
> >> Hello,
> >>
> >> I'm using notmuch-mode from within Emacs to send email using
> async/mbsync
> >> through Gmail. However, every time I send email from within Emacs, I get
> >> this error:
> >
> > i got this message too for fcc with default values, i'm on emacs 24.5
> > with notmuch 0.21
> >
>
> Can either of you replicate the problem with a minimal configuration,
> ideally with "emacs -q", followed by "M-x load-library <return>
> notmuch"?
>
> If so, does the path in the Fcc header exist? If so, what is it? a file,
> a directory, a symlink?
>
> For me, in emacs 24.5 / notmuch 0.21, with emacs -q, if that path is
> missing I am prompted to create it. If I refuse, then I later get a
> message about not being a maildir.
>
> I guess the tl;dr is that I can't duplicate this problem. Looking at the
> traceback Peter provided, it looks like he is using
> "send-message-without-bullets" to send the message. Since this isn't a
> notmuch function, it's likely bypassing the notmuch fcc setup that
> notmuch-mua-send and notmuch-mua-send-and-exit do.
>
>
> d
>
>

[-- Attachment #2: Type: text/html, Size: 4404 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-29  5:54     ` file-error "not a regular file" Peter Salazar
@ 2015-12-29 20:44       ` David Bremner
  2015-12-29 21:34         ` Peter Salazar
  0 siblings, 1 reply; 12+ messages in thread
From: David Bremner @ 2015-12-29 20:44 UTC (permalink / raw)
  To: Peter Salazar; +Cc: notmuch

Peter Salazar <cycleofsong@gmail.com> writes:


> Yes, following your steps, emacs -q followed by "M-x load-library <return>
> notmuch", I was able to send an email without the error. It prompted me for
> my smtp server, username, and password, then returned this:
>

[snip]
> Does this give us any leads?

It seems to be some interaction with your configuration. I'm not
familiar with this "send-message-without-bullets" function. Perhaps you
could point us to the source?

d

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-29 20:44       ` David Bremner
@ 2015-12-29 21:34         ` Peter Salazar
  2015-12-29 21:48           ` David Edmondson
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Salazar @ 2015-12-29 21:34 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

send-message-without-bullets simply turns off org-bullets-mode before doing
message-send, since org-bullets-mode seemed to be interfering with
org-mime-htmlize.

(defun send-message-without-bullets ()
  (interactive)
  (remove-hook 'org-mode-hook 'org-bullets-mode)
  (message-send)
  (add-hook 'org-mode-hook 'org-bullets-mode))

I also have this:

(setq message-send-hook (quote (org-mime-htmlize)))


On Tue, Dec 29, 2015 at 3:44 PM, David Bremner <david@tethera.net> wrote:

> Peter Salazar <cycleofsong@gmail.com> writes:
>
>
> > Yes, following your steps, emacs -q followed by "M-x load-library
> <return>
> > notmuch", I was able to send an email without the error. It prompted me
> for
> > my smtp server, username, and password, then returned this:
> >
>
> [snip]
> > Does this give us any leads?
>
> It seems to be some interaction with your configuration. I'm not
> familiar with this "send-message-without-bullets" function. Perhaps you
> could point us to the source?
>
> d
>
>

[-- Attachment #2: Type: text/html, Size: 1695 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-29 21:34         ` Peter Salazar
@ 2015-12-29 21:48           ` David Edmondson
  2016-01-04 10:11             ` Peter Salazar
  0 siblings, 1 reply; 12+ messages in thread
From: David Edmondson @ 2015-12-29 21:48 UTC (permalink / raw)
  To: Peter Salazar, David Bremner; +Cc: notmuch

On Tue, Dec 29 2015, Peter Salazar <cycleofsong@gmail.com> wrote:
> send-message-without-bullets simply turns off org-bullets-mode before doing
> message-send, since org-bullets-mode seemed to be interfering with
> org-mime-htmlize.
>
> (defun send-message-without-bullets ()
>   (interactive)
>   (remove-hook 'org-mode-hook 'org-bullets-mode)
>   (message-send)

This is wrong for notmuch - you need to use `notmuch-mua-send' rather
than calling `message-send' directly.

>   (add-hook 'org-mode-hook 'org-bullets-mode))
>
> I also have this:
>
> (setq message-send-hook (quote (org-mime-htmlize)))
>
>
> On Tue, Dec 29, 2015 at 3:44 PM, David Bremner <david@tethera.net> wrote:
>
>> Peter Salazar <cycleofsong@gmail.com> writes:
>>
>>
>> > Yes, following your steps, emacs -q followed by "M-x load-library
>> <return>
>> > notmuch", I was able to send an email without the error. It prompted me
>> for
>> > my smtp server, username, and password, then returned this:
>> >
>>
>> [snip]
>> > Does this give us any leads?
>>
>> It seems to be some interaction with your configuration. I'm not
>> familiar with this "send-message-without-bullets" function. Perhaps you
>> could point us to the source?
>>
>> d
>>
>>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-29  0:36     ` fauno
@ 2015-12-30  9:38       ` Michal Sojka
  2015-12-30 14:14         ` notmuch-mua and jl-encrypt (was: file-error "not a regular file") fauno
  0 siblings, 1 reply; 12+ messages in thread
From: Michal Sojka @ 2015-12-30  9:38 UTC (permalink / raw)
  To: fauno, notmuch

Hi fauno,

On Tue, Dec 29 2015, fauno wrote:
> David Bremner <david@tethera.net> writes:
>
>> I guess the tl;dr is that I can't duplicate this problem. Looking at the
>> traceback Peter provided, it looks like he is using
>> "send-message-without-bullets" to send the message. Since this isn't a
>> notmuch function, it's likely bypassing the notmuch fcc setup that
>> notmuch-mua-send and notmuch-mua-send-and-exit do.
>
> i've found the issue.  i'm using jl-encrypt that expects email written
> in message-mode, and since notmuch is now a minor mode some functions
> that were expected to be there didn't work anymore.

can you share more details about how do you use jl-encrypt and which
functions do not work? Recently, I posted a few patches that fix some
problems related to the replacing message-mode with
notmuch-message-mode. Maybe, there is more what we can do to not break
user's setups.

From a brief look at jl-encrypt, it seems it is tightly bound to gnus,
because it uses gnus-message-setup-hook. Maybe it will work again with
notmuch if you use my patch [1] and run

    (add-hook 'message-setup-hook 'jl-encrypt-if-possible)

-Michal

[1] id:1450690875-2111-2-git-send-email-sojkam1@fel.cvut.cz

^ permalink raw reply	[flat|nested] 12+ messages in thread

* notmuch-mua and jl-encrypt (was: file-error "not a regular file")
  2015-12-30  9:38       ` Michal Sojka
@ 2015-12-30 14:14         ` fauno
  2016-01-02 21:24           ` Michal Sojka
  0 siblings, 1 reply; 12+ messages in thread
From: fauno @ 2015-12-30 14:14 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

Michal Sojka <sojkam1@fel.cvut.cz> writes:
> can you share more details about how do you use jl-encrypt and which
> functions do not work? Recently, I posted a few patches that fix some
> problems related to the replacing message-mode with
> notmuch-message-mode. Maybe, there is more what we can do to not break
> user's setups.

i've been using jl-encrypt unmodified with notmuch for a while now.  i
just require it on my .emacs

since 0.21, i had to rebind notmuch-message-mode C-c C-c and C-s C-s
keys:

(define-key notmuch-message-mode-map (kbd "C-c C-c") 'jl-message-send-and-exit)
(define-key notmuch-message-mode-map (kbd "C-c C-s") 'jl-message-send)

and solved the issue of fcc by setting notmuch-fcc-dirs to nil and
making my mta send me bcc of my own email.

this has worked correctly for the last week.

> From a brief look at jl-encrypt, it seems it is tightly bound to gnus,
> because it uses gnus-message-setup-hook. Maybe it will work again with
> notmuch if you use my patch [1] and run
>
>     (add-hook 'message-setup-hook 'jl-encrypt-if-possible)

i applied your patch to the 0.21 release and byte-compiled notmuch-mua.el

the message is sent unencrypted unless i rebind C-c C-c as before.  the
email is encrypted but it asks for the recipient, which i'm guessing
emacs can't figure out for itself anymore?

also tested with `emacs -q` and loading this file, and jl-encrypt never
asks to encrypt the email when possible:

# /tmp/emacs

(require 'notmuch)
(add-to-list 'load-path "~/.emacs.d/lisp/")
(require 'jl-encrypt)
(add-hook 'message-setup-hook 'jl-encrypt-if-possible)
(add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)

by adding the C-c C-c rebind, it gets to encrypt, but asks for recipient
again.

i hope this info is useful :)

> -Michal
>
> [1] id:1450690875-2111-2-git-send-email-sojkam1@fel.cvut.cz

-- 
:D

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 584 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: notmuch-mua and jl-encrypt (was: file-error "not a regular file")
  2015-12-30 14:14         ` notmuch-mua and jl-encrypt (was: file-error "not a regular file") fauno
@ 2016-01-02 21:24           ` Michal Sojka
  0 siblings, 0 replies; 12+ messages in thread
From: Michal Sojka @ 2016-01-02 21:24 UTC (permalink / raw)
  To: fauno, notmuch

Hi fauno,

On Wed, Dec 30 2015, fauno wrote:
> Michal Sojka <sojkam1@fel.cvut.cz> writes:
>> can you share more details about how do you use jl-encrypt and which
>> functions do not work? Recently, I posted a few patches that fix some
>> problems related to the replacing message-mode with
>> notmuch-message-mode. Maybe, there is more what we can do to not break
>> user's setups.
>
> i've been using jl-encrypt unmodified with notmuch for a while now.  i
> just require it on my .emacs
>
> since 0.21, i had to rebind notmuch-message-mode C-c C-c and C-s C-s
> keys:
>
> (define-key notmuch-message-mode-map (kbd "C-c C-c") 'jl-message-send-and-exit)
> (define-key notmuch-message-mode-map (kbd "C-c C-s") 'jl-message-send)
>
> and solved the issue of fcc by setting notmuch-fcc-dirs to nil and
> making my mta send me bcc of my own email.
>
> this has worked correctly for the last week.
>
>> From a brief look at jl-encrypt, it seems it is tightly bound to gnus,
>> because it uses gnus-message-setup-hook. Maybe it will work again with
>> notmuch if you use my patch [1] and run
>>
>>     (add-hook 'message-setup-hook 'jl-encrypt-if-possible)
>
> i applied your patch to the 0.21 release and byte-compiled notmuch-mua.el
>
> the message is sent unencrypted unless i rebind C-c C-c as before.  the
> email is encrypted but it asks for the recipient, which i'm guessing
> emacs can't figure out for itself anymore?
>
> also tested with `emacs -q` and loading this file, and jl-encrypt never
> asks to encrypt the email when possible:
>
> # /tmp/emacs
>
> (require 'notmuch)
> (add-to-list 'load-path "~/.emacs.d/lisp/")
> (require 'jl-encrypt)
> (add-hook 'message-setup-hook 'jl-encrypt-if-possible)
> (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)
>
> by adding the C-c C-c rebind, it gets to encrypt, but asks for recipient
> again.

I looked into this and I think that the following workaround could work
for you:

    (defun jl-notmuch-message-send-and-exit (&optional arg)
      (interactive "P")
      (let ((message-fcc-handler-function #'notmuch-fcc-handler))
        (jl-message-send-and-exit arg)))
     
    (defun jl-notmuch-message-send (&optional arg)
      (interactive "P")
      (let ((message-fcc-handler-function #'notmuch-fcc-handler))
        (jl-message-send arg)))
     
    (define-key notmuch-message-mode-map (kbd "C-c C-c") 'jl-notmuch-message-send-and-exit)
    (define-key notmuch-message-mode-map (kbd "C-c C-s") 'jl-notmuch-message-send)

Unfortunately, I couldn't find a less intrusive solution for now,
because notmuch uses the same "trick" (remapping keyboard shortcuts) as
jl-encrypt to override message sending from message.el. This means that
either jl-encrypt or notmuch can be bound to these keys but not both.

Notmuch has to use this mechanism until the bug [1] is fixed in Emacs.

Another possibility would be to introduce something like
notmuch-send-hook which would allow other packages to hook into notmuch
sending process, but this could be even more complex that the above
workaround, so I don't think it is worth the effort.

Best regards,
-Michal

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21174

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: file-error "not a regular file"
  2015-12-29 21:48           ` David Edmondson
@ 2016-01-04 10:11             ` Peter Salazar
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Salazar @ 2016-01-04 10:11 UTC (permalink / raw)
  To: David Edmondson; +Cc: David Bremner, notmuch

[-- Attachment #1: Type: text/plain, Size: 1702 bytes --]

This seems to have done the trick! Thank you so much!

This is wrong for notmuch - you need to use `notmuch-mua-send' rather
> than calling `message-send' directly.



On Tue, Dec 29, 2015 at 4:48 PM, David Edmondson <dme@dme.org> wrote:

> On Tue, Dec 29 2015, Peter Salazar <cycleofsong@gmail.com> wrote:
> > send-message-without-bullets simply turns off org-bullets-mode before
> doing
> > message-send, since org-bullets-mode seemed to be interfering with
> > org-mime-htmlize.
> >
> > (defun send-message-without-bullets ()
> >   (interactive)
> >   (remove-hook 'org-mode-hook 'org-bullets-mode)
> >   (message-send)
>
> This is wrong for notmuch - you need to use `notmuch-mua-send' rather
> than calling `message-send' directly.
>
> >   (add-hook 'org-mode-hook 'org-bullets-mode))
> >
> > I also have this:
> >
> > (setq message-send-hook (quote (org-mime-htmlize)))
> >
> >
> > On Tue, Dec 29, 2015 at 3:44 PM, David Bremner <david@tethera.net>
> wrote:
> >
> >> Peter Salazar <cycleofsong@gmail.com> writes:
> >>
> >>
> >> > Yes, following your steps, emacs -q followed by "M-x load-library
> >> <return>
> >> > notmuch", I was able to send an email without the error. It prompted
> me
> >> for
> >> > my smtp server, username, and password, then returned this:
> >> >
> >>
> >> [snip]
> >> > Does this give us any leads?
> >>
> >> It seems to be some interaction with your configuration. I'm not
> >> familiar with this "send-message-without-bullets" function. Perhaps you
> >> could point us to the source?
> >>
> >> d
> >>
> >>
> > _______________________________________________
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > https://notmuchmail.org/mailman/listinfo/notmuch
>

[-- Attachment #2: Type: text/html, Size: 3471 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-04 10:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-28  3:07 file-error "not a regular file" Peter Salazar
2015-12-28  4:01 ` fauno
2015-12-28 14:46   ` David Bremner
2015-12-29  0:36     ` fauno
2015-12-30  9:38       ` Michal Sojka
2015-12-30 14:14         ` notmuch-mua and jl-encrypt (was: file-error "not a regular file") fauno
2016-01-02 21:24           ` Michal Sojka
2015-12-29  5:54     ` file-error "not a regular file" Peter Salazar
2015-12-29 20:44       ` David Bremner
2015-12-29 21:34         ` Peter Salazar
2015-12-29 21:48           ` David Edmondson
2016-01-04 10:11             ` Peter Salazar

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).