Re: OpenSMTPD 5.7.1 portable - received invalid command RCPT TO ...

2015-08-26 Thread James Lott
Ah ok, probably not the problem I was thinking of then :/

 On Aug 26, 2015, at 11:26 PM, Alan Cheng ach...@gobsd.org wrote:
 
 oh, I'm not able to change that.  The command was actually from email clients 
 (I tried web mail and anroid email client).
 
 
 --
 From:James Lott ja...@lottspot.com
 Time:2015 Aug 27 (Thu) 11:08
 To:Alan Cheng ach...@gobsd.org
 Cc:misc misc@opensmtpd.org
 Subject:Re: OpenSMTPD 5.7.1 portable - received invalid command RCPT TO ...
 
 I believe the R conflicts with an OpenSSL command-- try 'rcpt to' rather than 
 'RCPT TO'
 
 
 On Aug 26, 2015, at 10:00 PM, Alan Cheng ach...@gobsd.org wrote:
 
 
 Hello,
 
 My OpenSMTPD is having problems sending out emails. It gets a error message 
 saying somthing like received invalid command: RCPT 
 TO:alan.ch...@andex.com.
 Turned on debugging but still no clue. 
 Anyone has any pointers? thanks!
 
 Here is related log:
 
 root@cactus:/usr/local/etc# tail -f /var/log/mail.log
 
 Aug 27 01:51:30 cactus smtpd[12220]: debug: smtp: new client on listener: 
 0x953f50
 Aug 27 01:51:30 cactus smtpd[12220]: smtp-in: session e228d1ddb97126ff: 
 connection from host 54.209.64.223.static.js.chinamobile [223.64.209.54] 
 established
 Aug 27 01:51:31 cactus dovecot: imap(acheng): Connection closed in=23 out=501
 Aug 27 01:51:31 cactus smtpd[12220]: debug: session_start_ssl: switching to 
 SSL
 Aug 27 01:51:31 cactus smtpd[12220]: debug: pony: rsae_priv_enc
 Aug 27 01:51:31 cactus smtpd[12220]: smtp-in: session e228d1ddb97126ff: TLS 
 started version=TLSv1/SSLv3 (TLSv1.2), cipher=ECDHE-RSA-AES128-GCM-SHA256, 
 bits=128
 Aug 27 01:51:31 cactus smtpd[12220]: smtp-in: session e228d1ddb97126ff: 
 received invalid command: RCPT TO:alan.ch...@andex.com
 
 And here is my smtpd.conf:
 
 pki cactus.keda.io certificate /etc/ssl/private/cactus.keda.io.crt
 pki cactus.keda.io key /etc/ssl/private/cactus.keda.io.key
 
 listen on localhost
 listen on eth0 tls pki cactus.keda.io auth-optional
 table aliases file:/usr/local/etc/mail/aliases
 table secrets file:/usr/local/etc/mail/secrets
 
 accept for local alias aliases deliver to maildir 
 /var/mail/%{user.username}/
 accept from any for domain keda.io alias aliases deliver to maildir 
 /var/mail/%{user.username}/
 accept for any relay
 
 OS is Ubuntu 15.04 and OpenSMTPD is compiled from 5.7.1 portable release.
 
 Thanks,
 Alan
 


Re: OpenSMTPD 5.7.1 portable - received invalid command RCPT TO ...

2015-08-26 Thread James Lott
I believe the R conflicts with an OpenSSL command-- try 'rcpt to' rather than 
'RCPT TO'


 On Aug 26, 2015, at 10:00 PM, Alan Cheng ach...@gobsd.org wrote:
 
 
 Hello,
 
 My OpenSMTPD is having problems sending out emails. It gets a error message 
 saying somthing like received invalid command: RCPT 
 TO:alan.ch...@andex.com.
 Turned on debugging but still no clue. 
 Anyone has any pointers? thanks!
 
 Here is related log:
 
 root@cactus:/usr/local/etc# tail -f /var/log/mail.log
 
 Aug 27 01:51:30 cactus smtpd[12220]: debug: smtp: new client on listener: 
 0x953f50
 Aug 27 01:51:30 cactus smtpd[12220]: smtp-in: session e228d1ddb97126ff: 
 connection from host 54.209.64.223.static.js.chinamobile [223.64.209.54] 
 established
 Aug 27 01:51:31 cactus dovecot: imap(acheng): Connection closed in=23 out=501
 Aug 27 01:51:31 cactus smtpd[12220]: debug: session_start_ssl: switching to 
 SSL
 Aug 27 01:51:31 cactus smtpd[12220]: debug: pony: rsae_priv_enc
 Aug 27 01:51:31 cactus smtpd[12220]: smtp-in: session e228d1ddb97126ff: TLS 
 started version=TLSv1/SSLv3 (TLSv1.2), cipher=ECDHE-RSA-AES128-GCM-SHA256, 
 bits=128
 Aug 27 01:51:31 cactus smtpd[12220]: smtp-in: session e228d1ddb97126ff: 
 received invalid command: RCPT TO:alan.ch...@andex.com
 
 And here is my smtpd.conf:
 
 pki cactus.keda.io certificate /etc/ssl/private/cactus.keda.io.crt
 pki cactus.keda.io key /etc/ssl/private/cactus.keda.io.key
 
 listen on localhost
 listen on eth0 tls pki cactus.keda.io auth-optional
 table aliases file:/usr/local/etc/mail/aliases
 table secrets file:/usr/local/etc/mail/secrets
 
 accept for local alias aliases deliver to maildir 
 /var/mail/%{user.username}/
 accept from any for domain keda.io alias aliases deliver to maildir 
 /var/mail/%{user.username}/
 accept for any relay
 
 OS is Ubuntu 15.04 and OpenSMTPD is compiled from 5.7.1 portable release.
 
 Thanks,
 Alan


Re: [Extras] Problems with sqlite tables

2015-07-26 Thread James Lott
Well it turns out I had some incorrect paths and an error in my query config, 
so certainly no one could have saved me from myself... `smtpd -d` is 
exactly what I needed in order to figure out my problems though. Thanks for 
all the help everyone!

On Sunday, July 26, 2015 10:03:45 Edgar Pettijohn wrote:
 On 07/26/15 02:47, Joerg Jung wrote:
  Am 25.07.2015 um 22:18 schrieb James Lott ja...@lottspot.com
  
  mailto:ja...@lottspot.com:
  Interestingly, it looks to me like opensmtpd does actually check the
  /usr/local/libexec/opensmtpd directory for modules. When I remove the
  module from that directory, smtpd does not even start anymore (as
  opposed to starting and instantly giving up).
  
  root@smtp:/usr/local/etc/mail-config # mv
  /usr/local/libexec/opensmtpd/table-sqlite /usr/libexec/smtpd/
  root@smtp:/usr/local/etc/mail-config # service smtpd onestart
  Performing sanity check on smtpd configuration:
  fatal: table_create: backend sqlite does not exist
  /usr/local/etc/rc.d/smtpd: WARNING: failed precmd routine for smtpd
  
  If that path is hardcoded in the upstream OpenSMTPD source, then I
  would guess I'm dealing with a patched codebase... I guess I'll have
  to try grabbing the upstream sources directly and see if I run into
  the same issue.
  
  Forget that, the path is not hardcoded and not your problem.
  I misread an #ifdef in the portable code.
  
  Sorry for the noise!!
  
  On 07/25/2015 12:08 PM, Joerg Jung wrote:
  On Sat, Jul 25, 2015 at 10:52:36AM -0700, James Lott wrote:
  Hey folks,
  
  I'm running OpenSMTPD 5.7.1 + table-sqlite from extras. I'm simply
  trying to get the sqlite tables to work at all. I haven't even gotten
  as far as trying to use them in my rules. I have the following config
  files:
  
  == smtpd.conf
  table aliasesfile:/etc/mail/aliases
  table mxdb  sqlite:/usr/local/etc/mail-
config/mxdb/smtpd.sqlite.conf
  listen on localhost port 2587
  accept for local alias aliases deliver to mbox
  accept for any relay
  
  ==smtpd.sqlite.conf
  dbpath   /usr/local/var/mxdb.sqlite
  query_domainselect name from domain where domain = ?
  query_alias select destination from alias where
  alias_user||'@'||alias_domain = ?
  
  OpenSMTPD will pass the config tests and start, but will then
  immediately
  die.
  
  Jul 25 10:36:36 smtp smtpd[61374]: info: OpenSMTPD 5.7.1p1 
starting
  Jul 25 10:36:36 smtp smtpd[61375]: info: startup [debug mode]
  Jul 25 10:36:36 smtp smtpd[61378]: warn: table-proc: pipe closed
  Jul 25 10:36:36 smtp smtpd[61378]: fatal: table-proc: exiting
  Jul 25 10:36:36 smtp smtpd[61376]: warn: queue - lka: pipe closed
  Jul 25 10:36:36 smtp smtpd[61377]: warn: control - lka: pipe closed
  Jul 25 10:36:36 smtp smtpd[61375]: warn: parent - lka: pipe closed
  Jul 25 10:36:36 smtp smtpd[61380]: warn: pony - lka: pipe closed
  Jul 25 10:36:36 smtp smtpd[61379]: warn: scheduler - queue: pipe
  closed
  Jul 25 10:36:36 smtp smtpd[61381]: warn: ca - control: pipe closed
  
  Smtpd will start and run just fine if I comment out the table mxdb
  line.
 
 Are you starting like so:
 
 # smtpd -d
 
 If so add some v's:
 
 # smtpd -d
 
 Otherwise maybe just make sure smtpd.sqlite.conf and mxdb.sqlite exist
 ie no typos.
 
  I'm not sure, but I have a guess for you:
  
  I think -extras configure.ac has a bug where tables, filters, etc
  are installed in $prefix/libexec/opensmtpd
  
  But smtpd explicitly looks in (hardcoded) /usr/libexec/smtpd for them.
  
  Thus, your table-sqlite is not loaded correctly and smtpd dies.
  
  Regards,
  Joerg
 
 Unrelated to OP problem, but this is an issue for OpenBSD version. It
 installs to /usr/libexec/opensmtpd, but smtpd wants it in
 /usr/libexec/smtpd.  ./configure --libexecdir=/usr/libexec/smtpd makes
 it install to /usr/libexec/smtpd/opensmtpd.

-- 
James Lott

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



[Extras] Problems with sqlite tables

2015-07-25 Thread James Lott

Hey folks,

I'm running OpenSMTPD 5.7.1 + table-sqlite from extras. I'm simply 
trying to get the sqlite tables to work at all. I haven't even gotten as 
far as trying to use them in my rules. I have the following config files:


== smtpd.conf
table aliases file:/etc/mail/aliases
table mxdb  sqlite:/usr/local/etc/mail-config/mxdb/smtpd.sqlite.conf
listen on localhost port 2587
accept for local alias aliases deliver to mbox
accept for any relay

==smtpd.sqlite.conf
dbpath   /usr/local/var/mxdb.sqlite
query_domainselect name from domain where domain = ?
query_alias select destination from alias where 
alias_user||'@'||alias_domain = ?


OpenSMTPD will pass the config tests and start, but will then 
immediately die.


Jul 25 10:36:36 smtp smtpd[61374]: info: OpenSMTPD 5.7.1p1 starting
Jul 25 10:36:36 smtp smtpd[61375]: info: startup [debug mode]
Jul 25 10:36:36 smtp smtpd[61378]: warn: table-proc: pipe closed
Jul 25 10:36:36 smtp smtpd[61378]: fatal: table-proc: exiting
Jul 25 10:36:36 smtp smtpd[61376]: warn: queue - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61377]: warn: control - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61375]: warn: parent - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61380]: warn: pony - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61379]: warn: scheduler - queue: pipe closed
Jul 25 10:36:36 smtp smtpd[61381]: warn: ca - control: pipe closed

Smtpd will start and run just fine if I comment out the table mxdb line.

This issue is being experienced on FreeBSD 10.1. Am I doing something 
wrong that anyone might be able to point to? Thanks in advance for any 
pointers!


--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: [Extras] Problems with sqlite tables

2015-07-25 Thread James Lott
Interestingly, it looks to me like opensmtpd does actually check the 
/usr/local/libexec/opensmtpd directory for modules. When I remove the 
module from that directory, smtpd does not even start anymore (as 
opposed to starting and instantly giving up).


root@smtp:/usr/local/etc/mail-config # mv 
/usr/local/libexec/opensmtpd/table-sqlite /usr/libexec/smtpd/

root@smtp:/usr/local/etc/mail-config # service smtpd onestart
Performing sanity check on smtpd configuration:
fatal: table_create: backend sqlite does not exist
/usr/local/etc/rc.d/smtpd: WARNING: failed precmd routine for smtpd

If that path is hardcoded in the upstream OpenSMTPD source, then I would 
guess I'm dealing with a patched codebase... I guess I'll have to try 
grabbing the upstream sources directly and see if I run into the same 
issue.


On 07/25/2015 12:08 PM, Joerg Jung wrote:

On Sat, Jul 25, 2015 at 10:52:36AM -0700, James Lott wrote:

Hey folks,

I'm running OpenSMTPD 5.7.1 + table-sqlite from extras. I'm simply trying to
get the sqlite tables to work at all. I haven't even gotten as far as trying
to use them in my rules. I have the following config files:

== smtpd.conf
table aliases file:/etc/mail/aliases
table mxdb  sqlite:/usr/local/etc/mail-config/mxdb/smtpd.sqlite.conf
listen on localhost port 2587
accept for local alias aliases deliver to mbox
accept for any relay

==smtpd.sqlite.conf
dbpath   /usr/local/var/mxdb.sqlite
query_domainselect name from domain where domain = ?
query_alias select destination from alias where
alias_user||'@'||alias_domain = ?

OpenSMTPD will pass the config tests and start, but will then immediately
die.

Jul 25 10:36:36 smtp smtpd[61374]: info: OpenSMTPD 5.7.1p1 starting
Jul 25 10:36:36 smtp smtpd[61375]: info: startup [debug mode]
Jul 25 10:36:36 smtp smtpd[61378]: warn: table-proc: pipe closed
Jul 25 10:36:36 smtp smtpd[61378]: fatal: table-proc: exiting
Jul 25 10:36:36 smtp smtpd[61376]: warn: queue - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61377]: warn: control - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61375]: warn: parent - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61380]: warn: pony - lka: pipe closed
Jul 25 10:36:36 smtp smtpd[61379]: warn: scheduler - queue: pipe closed
Jul 25 10:36:36 smtp smtpd[61381]: warn: ca - control: pipe closed

Smtpd will start and run just fine if I comment out the table mxdb line.

I'm not sure, but I have a guess for you:

I think -extras configure.ac has a bug where tables, filters, etc
are installed in $prefix/libexec/opensmtpd

But smtpd explicitly looks in (hardcoded) /usr/libexec/smtpd for them.

Thus, your table-sqlite is not loaded correctly and smtpd dies.

Regards,
Joerg

  

This issue is being experienced on FreeBSD 10.1. Am I doing something wrong
that anyone might be able to point to? Thanks in advance for any pointers!

--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org