Re: OpenBSD 5.7 Asterisk sendmail voice mail as email

2015-05-29 Thread Stuart Henderson
On 2015-05-28, Peter Fraser p...@thinkage.ca wrote:
 Asterisk seems to run fine on 5.7 with one exception. 
 I normally have voice mail messages send as emails.
 These emails are not being send.

It's fixed in -current, for 5.7 try adding this to modules.conf and
restarting asterisk:

noload = res_xmpp.so

Alternatively I can put together a diff for p11-kit to work around it.



Re: OpenBSD 5.7 Asterisk sendmail voice mail as email

2015-05-29 Thread Stuart Henderson
On 2015-05-29, Stuart Henderson s...@spacehopper.org wrote:
 On 2015-05-28, Peter Fraser p...@thinkage.ca wrote:
 Asterisk seems to run fine on 5.7 with one exception. 
 I normally have voice mail messages send as emails.
 These emails are not being send.

 It's fixed in -current, for 5.7 try adding this to modules.conf and
 restarting asterisk:

 noload = res_xmpp.so

There is a chance that additional noload lines may be needed for anything
else that uses p11-kit.

 Alternatively I can put together a diff for p11-kit to work around it.

p11-kit diff here, I think this ought to do the trick, though running
-current may be easier ;)

Index: Makefile
===
RCS file: /cvs/ports/security/p11-kit/Makefile,v
retrieving revision 1.39
diff -u -p -r1.39 Makefile
--- Makefile12 Oct 2014 06:16:19 -  1.39
+++ Makefile29 May 2015 21:55:24 -
@@ -7,6 +7,7 @@ SHARED_ONLY=Yes
 COMMENT=   library for loading and enumurating of PKCS\#11 modules
 
 DISTNAME=  p11-kit-0.22.1
+REVISION=  0
 
 CATEGORIES=security
 
Index: patches/patch-common_library_c
===
RCS file: patches/patch-common_library_c
diff -N patches/patch-common_library_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-common_library_c  29 May 2015 21:55:24 -
@@ -0,0 +1,35 @@
+$OpenBSD$
+--- common/library.c.orig  Fri Oct  3 19:58:34 2014
 common/library.c   Fri May 29 22:52:42 2015
+@@ -63,8 +63,6 @@ p11_mutex_t p11_library_mutex;
+ pthread_once_t p11_library_once = PTHREAD_ONCE_INIT;
+ #endif
+ 
+-unsigned int p11_forkid = 1;
+-
+ static char *
+ thread_local_message (void)
+ {
+@@ -105,13 +103,6 @@ _p11_library_get_thread_local (void)
+   return local;
+ }
+ 
+-static void
+-count_forks (void)
+-{
+-  /* Thread safe, executed in child, one thread exists */
+-  p11_forkid++;
+-}
+-
+ void
+ p11_library_init_impl (void)
+ {
+@@ -120,8 +111,6 @@ p11_library_init_impl (void)
+   p11_mutex_init (p11_library_mutex);
+   pthread_key_create (thread_local, free);
+   p11_message_storage = thread_local_message;
+-
+-  pthread_atfork (NULL, NULL, count_forks);
+ }
+ 
+ void
Index: patches/patch-common_library_h
===
RCS file: patches/patch-common_library_h
diff -N patches/patch-common_library_h
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-common_library_h  29 May 2015 21:55:24 -
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- common/library.h.orig  Fri Oct  3 19:58:34 2014
 common/library.h   Fri May 29 22:52:42 2015
+@@ -44,8 +44,6 @@
+ 
+ extern p11_mutex_t p11_library_mutex;
+ 
+-extern unsigned int p11_forkid;
+-
+ #define   p11_lock()   p11_mutex_lock 
(p11_library_mutex);
+ 
+ #define   p11_unlock() p11_mutex_unlock 
(p11_library_mutex);
Index: patches/patch-common_mock_c
===
RCS file: patches/patch-common_mock_c
diff -N patches/patch-common_mock_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-common_mock_c 29 May 2015 21:55:24 -
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- common/mock.c.orig Mon Oct  6 06:29:32 2014
 common/mock.c  Fri May 29 22:52:42 2015
+@@ -46,7 +46,6 @@
+ #include debug.h
+ #include dict.h
+ #include array.h
+-#include library.h
+ 
+ #include assert.h
+ #include ctype.h
Index: patches/patch-p11-kit_modules_c
===
RCS file: patches/patch-p11-kit_modules_c
diff -N patches/patch-p11-kit_modules_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-p11-kit_modules_c 29 May 2015 21:55:24 -
@@ -0,0 +1,152 @@
+$OpenBSD$
+--- p11-kit/modules.c.orig Mon Oct  6 06:29:32 2014
 p11-kit/modules.c  Fri May 29 22:52:42 2015
+@@ -158,7 +158,7 @@ typedef struct _Module {
+ 
+   /* Initialization, mutex must be held */
+   p11_mutex_t initialize_mutex;
+-  unsigned int initialize_called;
++  bool initialize_called;
+   p11_thread_id_t initialize_thread;
+ } Module;
+ 
+@@ -247,6 +247,7 @@ free_module_unlocked (void *data)
+   p11_debug_precond (module unloaded without C_Finalize having 
been 
+  called for each C_Initialize);
+   } else {
++  assert (!mod-initialize_called);
+   assert (mod-initialize_thread == 0);
+   }
+ 
+@@ -632,7 +633,7 @@ initialize_module_inlock_reentrant (Module *mod)
+   p11_unlock ();
+   p11_mutex_lock (mod-initialize_mutex);
+ 
+-  if (mod-initialize_called != p11_forkid) {
++  if (!mod-initialize_called) {
+   p11_debug (C_Initialize: calling);
+ 
+   rv = mod-virt.funcs.C_Initialize (mod-virt.funcs,
+@@ -642,12 +643,10 @@ initialize_module_inlock_reentrant (Module *mod)
+ 
+   /* Module was 

OpenBSD 5.7 Asterisk sendmail voice mail as email

2015-05-28 Thread Peter Fraser
Asterisk seems to run fine on 5.7 with one exception. 
I normally have voice mail messages send as emails.
These emails are not being send.

/usr/local/share/examples/asterisk/default/voicemail.conf

has a  variable 

;mailcmd=/usr/sbin/sendmail -t

which I believe will end up using smptd

since I wanted to use sendmail 
I put into my  /etc/asterisk/voicemail.conf

mailcmd=/usr/local/libexec/sendmail/sendmail -t

and did a

voicemail reload
from within asterisk and it still did not work.

 I even tried  
mailcmd = sh -c cat /home/pjf/messages

after creating message and chmod 777 messages
the file messages was not changed.

any ideas on what I am missing



Re: OpenBSD 5.7 Asterisk sendmail voice mail as email

2015-05-28 Thread John Merriam
On Thu, 28 May 2015, Peter Fraser wrote:

 Asterisk seems to run fine on 5.7 with one exception. 
 I normally have voice mail messages send as emails.
 These emails are not being send.
 
 /usr/local/share/examples/asterisk/default/voicemail.conf
 
 has a  variable 
 
 ;mailcmd=/usr/sbin/sendmail -t
 
 which I believe will end up using smptd
 
 since I wanted to use sendmail 
 I put into my  /etc/asterisk/voicemail.conf
 
 mailcmd=/usr/local/libexec/sendmail/sendmail -t
 
 and did a
 
 voicemail reload
 from within asterisk and it still did not work.
 
  I even tried  
 mailcmd = sh -c cat /home/pjf/messages
 
 after creating message and chmod 777 messages
 the file messages was not changed.
 
 any ideas on what I am missing
 

Have a look at /usr/local/share/doc/pkg-readmes/sendmail-*

Particularly the 'Tweaking /etc/mailer.conf' and 'Client mail queue 
ownership' sections.  I would bet that either your /var/spool/clientmqueue 
isn't owned by _smmsp:_smmsp or your submit.cf is using the old smmsp 
user/group.

-- 

John Merriam



Re: OpenBSD 5.7 Asterisk sendmail voice mail as email

2015-05-28 Thread Peter Fraser
After a couple of private email

The is no messages in the /var/spool/smtpd structure from asterisk

and one other thing I tried was to use femail  which will works when manual 
invoked 
and I believe uses nothing other that tcpip

Asterisk behaves as if the mail program is not being called at all

-Original Message-
From: owner-m...@openbsd.org [mailto:owner-m...@openbsd.org] On Behalf Of Peter 
Fraser
Sent: Thursday, May 28, 2015 2:18 PM
To: 'misc@openbsd.org'
Subject: OpenBSD 5.7  Asterisk  sendmail  voice mail as email

Asterisk seems to run fine on 5.7 with one exception. 
I normally have voice mail messages send as emails.
These emails are not being send.

/usr/local/share/examples/asterisk/default/voicemail.conf

has a  variable 

;mailcmd=/usr/sbin/sendmail -t

which I believe will end up using smptd

since I wanted to use sendmail
I put into my  /etc/asterisk/voicemail.conf

mailcmd=/usr/local/libexec/sendmail/sendmail -t

and did a

voicemail reload
from within asterisk and it still did not work.

 I even tried
mailcmd = sh -c cat /home/pjf/messages

after creating message and chmod 777 messages the file messages was not changed.

any ideas on what I am missing



Re: Openbsd 5.7 and sendmail

2015-05-27 Thread Peter Fraser
Thanks I managed to miss noting  that I should look at 
/usr/local/share/doc/pkg-readmes/sendmail-*

-Original Message-
From: owner-m...@openbsd.org [mailto:owner-m...@openbsd.org] On Behalf Of John 
Merriam
Sent: Tuesday, May 26, 2015 12:20 PM
To: Peter Fraser
Cc: 'misc@openbsd.org'
Subject: Re: Openbsd 5.7 and sendmail

On Tue, 26 May 2015, Peter Fraser wrote:

 I put OpenBSD 5.7 up, but because we make use of the SpamHaus I didn't want 
 to move to smtpd.
 
 It was easy enough to put sendmail in but I found I could not rebuild 
 my /etc/mail/access.db
 
 makemap did not like the To: prefix in the /etc/mail/access file.
 
 being somewhat slow to took me a couple of days to realize that there 
 are now 2 makemap's
 
 /usr/libexec/smtpd/makemap
 
 and
 
 /usr/local/libexec/sendmail/makemap
 
 using the right one for sendmail fixed my problem.
 

You may need to edit your /etc/mailer.conf file.  See the mailer.conf(5) man 
page and /usr/local/share/doc/pkg-readmes/sendmail-*

-- 

John Merriam



Re: Openbsd 5.7 and sendmail

2015-05-26 Thread Antoine Jacoutot
On Tue, May 26, 2015 at 04:11:24PM +, Peter Fraser wrote:
 I put OpenBSD 5.7 up, but because we make use of the SpamHaus I didn't want 
 to move to smtpd.
 
 It was easy enough to put sendmail in but I found I could not rebuild my 
 /etc/mail/access.db
 
 makemap did not like the To: prefix in the /etc/mail/access file.
 
 being somewhat slow to took me a couple of days to realize that there are now 
 2 makemap's
 
 /usr/libexec/smtpd/makemap
 
 and
 
 /usr/local/libexec/sendmail/makemap
 
 using the right one for sendmail fixed my problem.

Yes, the pkg-readme already documents this 
(/usr/local/share/doc/pkg-readmes/sendmail-*):

snip
Tweaking /etc/mailer.conf
-
Two scripts are provided along with this package.  Run sendmail-enable
to adjust your mailer.conf(5), and sendmail-disable to revert your
changes.

-- 
Antoine



Openbsd 5.7 and sendmail

2015-05-26 Thread Peter Fraser
I put OpenBSD 5.7 up, but because we make use of the SpamHaus I didn't want to 
move to smtpd.

It was easy enough to put sendmail in but I found I could not rebuild my 
/etc/mail/access.db

makemap did not like the To: prefix in the /etc/mail/access file.

being somewhat slow to took me a couple of days to realize that there are now 2 
makemap's

/usr/libexec/smtpd/makemap

and

/usr/local/libexec/sendmail/makemap

using the right one for sendmail fixed my problem.



Re: Openbsd 5.7 and sendmail

2015-05-26 Thread John Merriam
On Tue, 26 May 2015, Peter Fraser wrote:

 I put OpenBSD 5.7 up, but because we make use of the SpamHaus I didn't want 
 to move to smtpd.
 
 It was easy enough to put sendmail in but I found I could not rebuild my 
 /etc/mail/access.db
 
 makemap did not like the To: prefix in the /etc/mail/access file.
 
 being somewhat slow to took me a couple of days to realize that there are now 
 2 makemap's
 
 /usr/libexec/smtpd/makemap
 
 and
 
 /usr/local/libexec/sendmail/makemap
 
 using the right one for sendmail fixed my problem.
 

You may need to edit your /etc/mailer.conf file.  See the mailer.conf(5) 
man page and /usr/local/share/doc/pkg-readmes/sendmail-*

-- 

John Merriam