Re: OpenSMTPD 6.4.0 from OBSD -current virtual users problem

2018-09-22 Thread Denis
Still beating with real user delivery "5.2.4 error". What should I do to
have mail delivery working between real users registered on a mail server?

On 8/19/2018 12:56 AM, Denis wrote:
> Hi there,
> 
> After "upgrade" OpenSMTPd to 6.4.0 (smtpd.conf syntax has been
> corrected) from OpenBSD -current having trouble with aliased addresses.
> 
> If I tried to send mail to alias address I receive error from mail program:
> 
> 'An error occurred while sending mail. The mail server responded:
> ,5.2.4 Mailing list expansion problem., Please check the message
> recipient "ali...@domain.tld" and try again'
> 
> mlmmj does not send emails also by OSMTPd 6.4.0. I have only one list
> named 'all' for broadcast messages. So if I sent to a...@domain.tld I
> receive nothing.
> 
> Previously, OpenSMTPD 6.0 from OpenBSD 6.3 sources look for 'aliases'
> from 'aliases.db' and 'virtuals' from PostgreSQL database. All works
> smoothly as it should be.
> 
> To exclude possible PGSQL issues for 'virtuals' I've added to smtpd.conf
> lookup for 'virtuals' from plain text file:
> 
> ...
> table aliases db:/etc/mail/aliases.db
> table virtuals file:/etc/mail/virtuals
> # table virtuals postgres:/etc/mail/smtpd-pgsql.conf
> ...
> 
> In all cases (when 'table virtuals file:/..' or 'table virtuals
> postgres:/..' or using mlmmj, or mail to aliased address) I have the
> same debug messages by running smtpd 6.4.0 in table debug mode:
> 
> # smtpd -dv -T virtuals -T lookup
> 
> ...
> 77205978ce2bed68 smtp connected address=local host=domain.tld
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "support" as ALIAS in table db:aliases -> "myaddr"
> debug: aliases_get: returned 1 aliases
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> 77205978ce2bed68 smtp failed-command address=local host=domain.tld
> command="RCPT TO: " result="524 5.2.4 Mailing list
> expansion problem"
> debug: control -> client: pipe closed
> debug: clearing p=client, fd=11, pid=0
> 77205978ce2bed68 smtp disconnected address=local host=domain.tld
> reason=disconnect
> ...
> 
> What can be wrong?
> 
> Denis
> 
> 
> 
> 
> 

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



Re: OpenSMTPD 6.4.0 from OBSD -current virtual users problem

2018-09-11 Thread Denis
Emails from 'real' users (like u...@domain3.tld) to 'aliases' (like
alia...@domain.tld) works fine from outside and locally. I fixed it by
setting different machine name from domain[1-3].tld in /etc/myname.
Before that I have received "5.2.4 error" for aliased (virtuals) users
like for 'real' users now.

All the smtpd-pgsql.conf queries have no changes after migration
OpenSMTPd 6.0 -> 6.4.

I've just tested smtpd with /etc/mail/virtuals flat file instead of
PGSQL query, but the same "5.2.4 error" is still present.

cat /etc/mail/smtpd.conf
...
table virtuals file:/etc/mail/virtuals
...
---

cat /etc/mail/virtuals
# Virtual addresses for external mail
ali...@domain3.tld  u...@domain3.tld
u...@domain3.tldvmail

# Mailing list addresses
broadc...@domain3.tld   "|/usr/local/bin/mlmmj-receive -L
/var/spool/mlmmj/broadcast/"

# Misc addresses
ali...@domain3.tld  u...@domain3.tld
ali...@domain3.tld  u...@domain3.tld
ali...@domain3.tld  u...@domain3.tld
ali...@domain3.tld  u...@domain3.tld
---

Aliases works as from flat file and from aliases.db smoothly after
fixing /etc/myname:

cat /etc/mail/aliases
#   $OpenBSD: aliases,v 1.66 2018/07/23 14:15:14 florian Exp $

# '/usr/bin/newaliases' must be run after this file is updated to show
it to smtpd

# Basic system aliases - must be present
MAILER-DAEMON:  postmaster
postmaster: root

### Pseudo accounts redirections
daemon: root
ftp-bugs:   root
operator:   root
uucp:   root
www:root

### System default aliases
root:   user
support:user
user:   u...@domain3.tld

# mlmmj list members
broadcast:  "|/usr/local/bin/mlmmj-receive -L 
/var/spool/mlmmj/broadcast/"

### Pseudo accounts shouldn't receive mail
_dhcp: /dev/null
...

### RFC2142: network operations mailbox names
#abuse: root
#noc:   root
#security:  root

### RFC2142: support mailbox names for specific Internet services
#hostmaster:root
#usenet:root
#news:  usenet
#webmaster: root
#ftp:   root
---

OpenBSD 6.3amd64 is used.

Please advice.

On 9/7/2018 10:34 PM, Matt Schwartz wrote:
> Can you share your smtpd.conf and virtual users table? Please also let
> me know if you use a userbase table and share  it as well. Also, are the
> forwards going through a .forward file?
> 
> On Sep 7, 2018 2:44 PM, "Denis"  > wrote:
> 
> Since /etc/myname changed to a different one from virtual domain name
> used in OpenSMTPd mlmmj mailing lists work well, aliases work as it
> should be too.
> 
> But I can't send mail to a users with 'real' mailboxes in the same
> domain served by OpenSMTPd where aliased users present also.
> 
> For instance:
> us...@domain.tld can send to ali...@domain.tld alias2@ alias3@
> but
> us...@domain.tld can't send to us...@domain.tld user3@ user4@ and other
> users with 'real' mailboxes in the same domain.
> 
> 'An error occurred while sending mail. The mail server responded:
> ,5.2.4 Mailing list expansion problem., Please check the message
> recipient "us...@domain.tld" and try again'
> 
> #tail -n 20 /var/log/maillog
> smtpd[6323] smtp failed-command address=12.34.56.78 host=12.34.56.78
> command="RCPT TO:" result="524 52.4 Mailing list
> expansion problem"
> smtpd[6323] smtp failed-command address=12.34.56.78 host=12.34.56.78
> command="RCPT TO:" result="524 52.4 Mailing list
> expansion problem"
> ..
> 
> Outgoing mail sends well. Incoming mail receives well too.
> 
> opensmtpd works with dovecot imap together.
> 
> Any advises will be highly appreciated.
> 
> On 8/19/2018 12:57 PM, Denis wrote:
> > Solved. The problem was with /etc/myname which has the same name
> as one
> > of virtual domains used for smtpd.
> >
> > On 8/19/2018 12:56 AM, Denis wrote:
> >> Hi there,
> >>
> >> After "upgrade" OpenSMTPd to 6.4.0 (smtpd.conf syntax has been
> >> corrected) from OpenBSD -current having trouble with aliased
> addresses.
> >>
> >> If I tried to send mail to alias address I receive error from
> mail program:
> >>
> >> 'An error occurred while sending mail. The mail server responded:
> >> ,5.2.4 Mailing list expansion problem., Please check the message
> >> recipient "ali...@domain.tld" and try again'
> >>
> >> mlmmj does not send emails also by OSMTPd 6.4.0. I have only one list
> >> named 'all' for broadcast messages. So if I sent to a...@domain.tld I
> >> receive nothing.
> >>
> >> Previously, OpenSMTPD 6.0 from OpenBSD 6.3 sources look for 'aliases'
> >> from 'aliases.db' and 'virtuals' from PostgreSQL database. All works
> >> smoothly as it should be.
> >>
> >> To exclude 

Re: OpenSMTPD 6.4.0 from OBSD -current virtual users problem

2018-09-11 Thread Denis
I fetch some data from PGSQL database, please let me know if you need
any additional config files considering PGSQL tables.
There is no .forward file used since OpenSMTPd 6.0.

The same configuration (except syntax changes in smtpd.conf) works
perfectly for smtpd 6.0.

I actively use domain3.tld with this configuration. Other domains are
suspended for now. So all the actions happened with domain3.tld.

cat /etc/mail/smtpd.conf
#   $OpenBSD: smtpd.conf,v 1.11 2018/06/04 21:10:58 jmc Exp $

# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.

### blacklist filtering
# filter dnsbl-sorbsdnsbl   "-h dnsbl.sorbs.net"
# filter dnsbl-spamcop  dnsbl   "-h bl.spamcop.net"
# filter dnsbl-spamhaus dnsbl   "-h zen.spamhaus.org"
# filter dnsbl-all  chain   dnsbl-sorbs dnsbl-spamcop dnsbl-spamhaus

### pki
pki smtp.domain1.tld cert "/etc/ssl/mail/smtp.domain1.tld.crt"
pki smtp.domain1.tld key "/etc/ssl/mail/private/smtp.domain1.tld.key"
pki smtp.domain2.tld cert "/etc/ssl/mail/smtp.domain2.tld.crt"
pki smtp.domain2.tld key "/etc/ssl/mail/private/smtp.domain2.tld.key"
pki smtp.domain3.tld cert "/etc/ssl/mail/smtp.domain3.tld.crt"
pki smtp.domain3.tld key "/etc/ssl/mail/private/smtp.domain3.tld.key"

pki smtp.domain3.tld dhe auto

smtp ciphers
ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-GCM-SHA384:TLSv1.2:SSLv3

smtp max-message-size 20M

### tables
table sources {12.34.56.78}
table helonames {12.34.56.78 = smtp.domain3.tld}
table aliases db:/etc/mail/aliases.db
table domains postgres:/etc/mail/smtpd-pgsql.conf
table virtuals postgres:/etc/mail/smtpd-pgsql.conf
table passwd postgres:/etc/mail/smtpd-pgsql.conf
table userinfo postgres:/etc/mail/smtpd-pgsql.conf

### listen ports
listen on lo0 tls pki smtp.domain3.tld hostnames {12.34.56.78 =
smtp.domain3.tld}
listen on lo0 smtps auth  pki smtp.domain3.tld hostname
smtp.domain3.tld
listen on lo0 port submission tls-require auth  pki
smtp.domain3.tld hostname smtp.domain3.tld
listen on lo0 port 10028 tag DKIM_OUT
# Spampd will relay emails after parsing
listen on lo0 port 10026 tag SPAM_IN

### actions
action "local-aliases" lmtp "/var/dovecot/lmtp" rcpt-to alias 
action "virtual-users" lmtp "/var/dovecot/lmtp" rcpt-to virtual 
action "spampd-in" relay host smtp://127.0.0.1:10025
action "relay-to-backup-mx" relay backup mx smtp1.domain3.tld
action "dkim-sign" relay host smtp://127.0.0.1:10027
action "outbound" relay src  helo-src 

### allow local messages
match from local for local action "local-aliases"
match tag SPAM_IN for local action "local-aliases"
### allow vitual domains
match from any for domain  action "virtual-users"
match tag SPAM_IN from any for domain  action "virtual-users"
### allow outgoing mail
match auth from any for any action "outbound"

### Untagged mail send to SpamAssassin (spampd)
#match from any for domain  action "spampd-in"

### Relay signed emails
match tag DKIM_OUT for domain  action "outbound"

### Sign emails by DKIM proxy
#match for domain  action "dkim-sign"
-

cat /etc/mail/smtpd-pgsql.conf
### smtpd.conf refers to postgres:/etc/mail/smtpd-pgsql.conf

conninfo host=127.0.0.1 dbname=authdb user=user password=secret

query_alias SELECT destination FROM virtuals WHERE aliasid=$1
query_domain SELECT domain FROM domains WHERE domain=$1 LIMIT 1
#query_domain SELECT REPLACE ('@', ''), realm FROM users WHERE realm=$1
LIMIT 1
query_credentials SELECT userid, passwd FROM users WHERE userid=$1 AND
active='1'
query_userinfo SELECT CONCAT (userid, realm) AS user, uid, gid  FROM
users WHERE userid=$1 AND active='1'
-


On 9/7/2018 10:34 PM, Matt Schwartz wrote:
> Can you share your smtpd.conf and virtual users table? Please also let
> me know if you use a userbase table and share  it as well. Also, are the
> forwards going through a .forward file?
> 
> On Sep 7, 2018 2:44 PM, "Denis"  > wrote:
> 
> Since /etc/myname changed to a different one from virtual domain name
> used in OpenSMTPd mlmmj mailing lists work well, aliases work as it
> should be too.
> 
> But I can't send mail to a users with 'real' mailboxes in the same
> domain served by OpenSMTPd where aliased users present also.
> 
> For instance:
> us...@domain.tld can send to ali...@domain.tld alias2@ alias3@
> but
> us...@domain.tld can't send to us...@domain.tld user3@ user4@ and other
> users with 'real' mailboxes in the same domain.
> 
> 'An error occurred while sending mail. The mail server responded:
> ,5.2.4 Mailing list expansion problem., Please check the message
> recipient "us...@domain.tld" and try again'
> 
> #tail -n 20 /var/log/maillog
> smtpd[6323] smtp failed-command address=12.34.56.78 host=12.34.56.78
> command="RCPT TO:" result="524 52.4 Mailing list
> expansion problem"
> smtpd[6323] smtp failed-command address=12.34.56.78 host=12.34.56.78
> command="RCPT TO:" 

Re: OpenSMTPD 6.4.0 from OBSD -current virtual users problem

2018-09-07 Thread Denis
Since /etc/myname changed to a different one from virtual domain name
used in OpenSMTPd mlmmj mailing lists work well, aliases work as it
should be too.

But I can't send mail to a users with 'real' mailboxes in the same
domain served by OpenSMTPd where aliased users present also.

For instance:
us...@domain.tld can send to ali...@domain.tld alias2@ alias3@
but
us...@domain.tld can't send to us...@domain.tld user3@ user4@ and other
users with 'real' mailboxes in the same domain.

'An error occurred while sending mail. The mail server responded:
,5.2.4 Mailing list expansion problem., Please check the message
recipient "us...@domain.tld" and try again'

#tail -n 20 /var/log/maillog
smtpd[6323] smtp failed-command address=12.34.56.78 host=12.34.56.78
command="RCPT TO:" result="524 5.2.4 Mailing list
expansion problem"
smtpd[6323] smtp failed-command address=12.34.56.78 host=12.34.56.78
command="RCPT TO:" result="524 5.2.4 Mailing list
expansion problem"
...

Outgoing mail sends well. Incoming mail receives well too.

opensmtpd works with dovecot imap together.

Any advises will be highly appreciated.

On 8/19/2018 12:57 PM, Denis wrote:
> Solved. The problem was with /etc/myname which has the same name as one
> of virtual domains used for smtpd.
> 
> On 8/19/2018 12:56 AM, Denis wrote:
>> Hi there,
>>
>> After "upgrade" OpenSMTPd to 6.4.0 (smtpd.conf syntax has been
>> corrected) from OpenBSD -current having trouble with aliased addresses.
>>
>> If I tried to send mail to alias address I receive error from mail program:
>>
>> 'An error occurred while sending mail. The mail server responded:
>> ,5.2.4 Mailing list expansion problem., Please check the message
>> recipient "ali...@domain.tld" and try again'
>>
>> mlmmj does not send emails also by OSMTPd 6.4.0. I have only one list
>> named 'all' for broadcast messages. So if I sent to a...@domain.tld I
>> receive nothing.
>>
>> Previously, OpenSMTPD 6.0 from OpenBSD 6.3 sources look for 'aliases'
>> from 'aliases.db' and 'virtuals' from PostgreSQL database. All works
>> smoothly as it should be.
>>
>> To exclude possible PGSQL issues for 'virtuals' I've added to smtpd.conf
>> lookup for 'virtuals' from plain text file:
>>
>> ...
>> table aliases db:/etc/mail/aliases.db
>> table virtuals file:/etc/mail/virtuals
>> # table virtuals postgres:/etc/mail/smtpd-pgsql.conf
>> ...
>>
>> In all cases (when 'table virtuals file:/..' or 'table virtuals
>> postgres:/..' or using mlmmj, or mail to aliased address) I have the
>> same debug messages by running smtpd 6.4.0 in table debug mode:
>>
>> # smtpd -dv -T virtuals -T lookup
>>
>> ...
>> 77205978ce2bed68 smtp connected address=local host=domain.tld
>> lookup: check "local" as NETADDR in table static: -> found
>> lookup: check "domain.tld" as DOMAIN in table static: -> found
>> lookup: lookup "support" as ALIAS in table db:aliases -> "myaddr"
>> debug: aliases_get: returned 1 aliases
>> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
>> debug: aliases_get: returned 1 aliases
>> lookup: check "local" as NETADDR in table static: -> found
>> lookup: check "domain.tld" as DOMAIN in table static: -> found
>> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
>> debug: aliases_get: returned 1 aliases
>> lookup: check "local" as NETADDR in table static: -> found
>> lookup: check "domain.tld" as DOMAIN in table static: -> found
>> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
>> debug: aliases_get: returned 1 aliases
>> lookup: check "local" as NETADDR in table static: -> found
>> lookup: check "domain.tld" as DOMAIN in table static: -> found
>> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
>> debug: aliases_get: returned 1 aliases
>> lookup: check "local" as NETADDR in table static: -> found
>> lookup: check "domain.tld" as DOMAIN in table static: -> found
>> 77205978ce2bed68 smtp failed-command address=local host=domain.tld
>> command="RCPT TO: " result="524 5.2.4 Mailing list
>> expansion problem"
>> debug: control -> client: pipe closed
>> debug: clearing p=client, fd=11, pid=0
>> 77205978ce2bed68 smtp disconnected address=local host=domain.tld
>> reason=disconnect
>> ...
>>
>> What can be wrong?
>>
>> Denis
>>
>>
>>
>>
>>
> 

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



Re: OpenSMTPD 6.4.0 from OBSD -current virtual users problem

2018-08-19 Thread Denis
Solved. The problem was with /etc/myname which has the same name as one
of virtual domains used for smtpd.

On 8/19/2018 12:56 AM, Denis wrote:
> Hi there,
> 
> After "upgrade" OpenSMTPd to 6.4.0 (smtpd.conf syntax has been
> corrected) from OpenBSD -current having trouble with aliased addresses.
> 
> If I tried to send mail to alias address I receive error from mail program:
> 
> 'An error occurred while sending mail. The mail server responded:
> ,5.2.4 Mailing list expansion problem., Please check the message
> recipient "ali...@domain.tld" and try again'
> 
> mlmmj does not send emails also by OSMTPd 6.4.0. I have only one list
> named 'all' for broadcast messages. So if I sent to a...@domain.tld I
> receive nothing.
> 
> Previously, OpenSMTPD 6.0 from OpenBSD 6.3 sources look for 'aliases'
> from 'aliases.db' and 'virtuals' from PostgreSQL database. All works
> smoothly as it should be.
> 
> To exclude possible PGSQL issues for 'virtuals' I've added to smtpd.conf
> lookup for 'virtuals' from plain text file:
> 
> ...
> table aliases db:/etc/mail/aliases.db
> table virtuals file:/etc/mail/virtuals
> # table virtuals postgres:/etc/mail/smtpd-pgsql.conf
> ...
> 
> In all cases (when 'table virtuals file:/..' or 'table virtuals
> postgres:/..' or using mlmmj, or mail to aliased address) I have the
> same debug messages by running smtpd 6.4.0 in table debug mode:
> 
> # smtpd -dv -T virtuals -T lookup
> 
> ...
> 77205978ce2bed68 smtp connected address=local host=domain.tld
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "support" as ALIAS in table db:aliases -> "myaddr"
> debug: aliases_get: returned 1 aliases
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> lookup: lookup "myaddr" as ALIAS in table db:aliases -> "mya...@domain.tld"
> debug: aliases_get: returned 1 aliases
> lookup: check "local" as NETADDR in table static: -> found
> lookup: check "domain.tld" as DOMAIN in table static: -> found
> 77205978ce2bed68 smtp failed-command address=local host=domain.tld
> command="RCPT TO: " result="524 5.2.4 Mailing list
> expansion problem"
> debug: control -> client: pipe closed
> debug: clearing p=client, fd=11, pid=0
> 77205978ce2bed68 smtp disconnected address=local host=domain.tld
> reason=disconnect
> ...
> 
> What can be wrong?
> 
> Denis
> 
> 
> 
> 
> 

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