smtpd aliases

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

smtpd aliases

William Orr-2
Hello, all!

I'm having some problems with aliases in smtpd, in that they're not
properly resolving. I have a bunch of incoming mails stuck in the queue
that dovecot (my MDA) refuses to deliver. The logs don't point to any
problem reading or opening the aliases file.

Here is my smtpd.conf:
#   $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $

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

av = "amavis"
originating = "originating"
dn = "worrbase.com"
av_foreign = "lmtp://localhost:10024"
av_origin = "lmtp://localhost:10026"
dovecot = "lmtp://localhost:10110"

table aliases db:/etc/mail/aliases.db

# listen on smtp, submission and the amavis port
# should be able to use tls almost all the time
listen on fxp0 port smtp tls certificate mail
listen on fxp0 port submission tls-require certificate mail auth \
     tag $originating
listen on lo port 10025 tag $av

# coming in from amavis
accept tagged $av for domain $dn relay via $dovecot
accept tagged $av for any relay

# coming in from the outside
accept from any for domain $dn alias <aliases> relay via $av_foreign

# coming in from local
accept for any alias <aliases> relay via $av_origin

# coming in from authed clients
accept tagged $originating for any alias <aliases> relay via $av_origin

The aliases file (this is concatenated with the default /etc/mail/aliases):
root:           will
admin:          will
webmaster:      will
sysadmin:       will
worr:           will
backups:        will
cron:           will
clamav:         will
hostmaster:     will
virusalert:     will
dmarc-rua:      [hidden email], postmaster
dmarc-ruf:      [hidden email], postmaster

I've run newaliases after modifying the aliases db, and I've tried
sending mails to the aliases listed in the default aliases file.

Mail to actual users works great.

Here's some of the logfile:
Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Connecting to
lmtp://127.0.0.1:10110 (localhost) on session 000000c8ec12b3d9...
Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Connected on session
000000c8ec12b3d9
Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Connect from 127.0.0.1
Jun 16 18:49:29 ponyexpress smtpd[26195]: relay: TempFail for
9336e65b41a220af: from=<>, to=<[hidden email]>, relay=127.0.0.1
(localhost), delay=13h26m41s, stat=451 4.3.0 <[hidden email]> Invalid
user settings. Refer to server log for more information.
Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Error: user root:
Invalid settings in userdb: userdb returned 0 as uid
Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Disconnect from
127.0.0.1: Client quit (in reset)
Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Closing session
000000c8ec12b3d9: 0 message sent.
Jun 16 18:49:31 ponyexpress smtpd[26195]: smtp-out: Connecting to
lmtp://127.0.0.1:10110 (localhost) on session 000000cb899c72fd...
Jun 16 18:49:31 ponyexpress smtpd[26195]: smtp-out: Connected on session
000000cb899c72fd
Jun 16 18:49:31 ponyexpress dovecot: lmtp(14309): Connect from 127.0.0.1
Jun 16 18:49:31 ponyexpress smtpd[26195]: relay: TempFail for
cec99e69ffab9bdf: from=<>, to=<[hidden email]>, relay=127.0.0.1
(localhost), delay=13h26m40s, stat=451 4.3.0 <[hidden email]> Invalid
user settings. Refer to server log for more information.

Reply | Threaded
Open this post in threaded view
|

Re: smtpd aliases

Gilles Chehade-7
On Sun, Jun 16, 2013 at 04:44:02PM -0700, William Orr wrote:
> Hello, all!
>

Hello,


> I'm having some problems with aliases in smtpd, in that they're not
> properly resolving. I have a bunch of incoming mails stuck in the
> queue that dovecot (my MDA) refuses to deliver. The logs don't point
> to any problem reading or opening the aliases file.
>
> Here is my smtpd.conf:
> #   $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $
>
> # This is the smtpd server system-wide configuration file.
> # See smtpd.conf(5) for more information.
>
> av = "amavis"
> originating = "originating"
> dn = "worrbase.com"
> av_foreign = "lmtp://localhost:10024"
> av_origin = "lmtp://localhost:10026"
> dovecot = "lmtp://localhost:10110"
>
> table aliases db:/etc/mail/aliases.db
>
> # listen on smtp, submission and the amavis port
> # should be able to use tls almost all the time
> listen on fxp0 port smtp tls certificate mail
> listen on fxp0 port submission tls-require certificate mail auth \
>     tag $originating
> listen on lo port 10025 tag $av
>
> # coming in from amavis
> accept tagged $av for domain $dn relay via $dovecot
> accept tagged $av for any relay
>
> # coming in from the outside
> accept from any for domain $dn alias <aliases> relay via $av_foreign
>
> # coming in from local
> accept for any alias <aliases> relay via $av_origin
>
> # coming in from authed clients
> accept tagged $originating for any alias <aliases> relay via $av_origin
>

Ok, there's a parse.y bug here that I'll be looking into.
You shouldn't be able to use "alias" in a relay rule, it is discarded.
What you want is to use local lmtp delivery, not lmtp relaying.

--
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

Reply | Threaded
Open this post in threaded view
|

Re: smtpd aliases

William Orr-2
Is that available in OpenBSD 5.3? I saw that in the -current manpage
when I was originally configuring smtpd, but lmtp delivery wasn't in the
manpage in 5.3.

> Gilles Chehade <mailto:[hidden email]>
> June 18, 2013 1:00 AM
> On Sun, Jun 16, 2013 at 04:44:02PM -0700, William Orr wrote:
>> Hello, all!
>>
>
> Hello,
>
>
>> I'm having some problems with aliases in smtpd, in that they're not
>> properly resolving. I have a bunch of incoming mails stuck in the
>> queue that dovecot (my MDA) refuses to deliver. The logs don't point
>> to any problem reading or opening the aliases file.
>>
>> Here is my smtpd.conf:
>> #   $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $
>>
>> # This is the smtpd server system-wide configuration file.
>> # See smtpd.conf(5) for more information.
>>
>> av = "amavis"
>> originating = "originating"
>> dn = "worrbase.com"
>> av_foreign = "lmtp://localhost:10024"
>> av_origin = "lmtp://localhost:10026"
>> dovecot = "lmtp://localhost:10110"
>>
>> table aliases db:/etc/mail/aliases.db
>>
>> # listen on smtp, submission and the amavis port
>> # should be able to use tls almost all the time
>> listen on fxp0 port smtp tls certificate mail
>> listen on fxp0 port submission tls-require certificate mail auth \
>>      tag $originating
>> listen on lo port 10025 tag $av
>>
>> # coming in from amavis
>> accept tagged $av for domain $dn relay via $dovecot
>> accept tagged $av for any relay
>>
>> # coming in from the outside
>> accept from any for domain $dn alias<aliases>  relay via $av_foreign
>>
>> # coming in from local
>> accept for any alias<aliases>  relay via $av_origin
>>
>> # coming in from authed clients
>> accept tagged $originating for any alias<aliases>  relay via $av_origin
>>
>
> Ok, there's a parse.y bug here that I'll be looking into.
> You shouldn't be able to use "alias" in a relay rule, it is discarded.
> What you want is to use local lmtp delivery, not lmtp relaying.
>
> William Orr <mailto:[hidden email]>
> June 16, 2013 4:44 PM
> Hello, all!
>
> I'm having some problems with aliases in smtpd, in that they're not
> properly resolving. I have a bunch of incoming mails stuck in the
> queue that dovecot (my MDA) refuses to deliver. The logs don't point
> to any problem reading or opening the aliases file.
>
> Here is my smtpd.conf:
> #   $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $
>
> # This is the smtpd server system-wide configuration file.
> # See smtpd.conf(5) for more information.
>
> av = "amavis"
> originating = "originating"
> dn = "worrbase.com"
> av_foreign = "lmtp://localhost:10024"
> av_origin = "lmtp://localhost:10026"
> dovecot = "lmtp://localhost:10110"
>
> table aliases db:/etc/mail/aliases.db
>
> # listen on smtp, submission and the amavis port
> # should be able to use tls almost all the time
> listen on fxp0 port smtp tls certificate mail
> listen on fxp0 port submission tls-require certificate mail auth \
>     tag $originating
> listen on lo port 10025 tag $av
>
> # coming in from amavis
> accept tagged $av for domain $dn relay via $dovecot
> accept tagged $av for any relay
>
> # coming in from the outside
> accept from any for domain $dn alias <aliases> relay via $av_foreign
>
> # coming in from local
> accept for any alias <aliases> relay via $av_origin
>
> # coming in from authed clients
> accept tagged $originating for any alias <aliases> relay via $av_origin
>
> The aliases file (this is concatenated with the default
> /etc/mail/aliases):
> root:           will
> admin:          will
> webmaster:      will
> sysadmin:       will
> worr:           will
> backups:        will
> cron:           will
> clamav:         will
> hostmaster:     will
> virusalert:     will
> dmarc-rua:      [hidden email], postmaster
> dmarc-ruf:      [hidden email], postmaster
>
> I've run newaliases after modifying the aliases db, and I've tried
> sending mails to the aliases listed in the default aliases file.
>
> Mail to actual users works great.
>
> Here's some of the logfile:
> Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Connecting to
> lmtp://127.0.0.1:10110 (localhost) on session 000000c8ec12b3d9...
> Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Connected on
> session 000000c8ec12b3d9
> Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Connect from 127.0.0.1
> Jun 16 18:49:29 ponyexpress smtpd[26195]: relay: TempFail for
> 9336e65b41a220af: from=<>, to=<[hidden email]>, relay=127.0.0.1
> (localhost), delay=13h26m41s, stat=451 4.3.0 <[hidden email]>
> Invalid user settings. Refer to server log for more information.
> Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Error: user root:
> Invalid settings in userdb: userdb returned 0 as uid
> Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Disconnect from
> 127.0.0.1: Client quit (in reset)
> Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Closing session
> 000000c8ec12b3d9: 0 message sent.
> Jun 16 18:49:31 ponyexpress smtpd[26195]: smtp-out: Connecting to
> lmtp://127.0.0.1:10110 (localhost) on session 000000cb899c72fd...
> Jun 16 18:49:31 ponyexpress smtpd[26195]: smtp-out: Connected on
> session 000000cb899c72fd
> Jun 16 18:49:31 ponyexpress dovecot: lmtp(14309): Connect from 127.0.0.1
> Jun 16 18:49:31 ponyexpress smtpd[26195]: relay: TempFail for
> cec99e69ffab9bdf: from=<>, to=<[hidden email]>, relay=127.0.0.1
> (localhost), delay=13h26m40s, stat=451 4.3.0 <[hidden email]>
> Invalid user settings. Refer to server log for more information.

Reply | Threaded
Open this post in threaded view
|

Re: smtpd aliases

Gilles Chehade-7
On Tue, Jun 18, 2013 at 09:10:25AM -0700, William Orr wrote:
> Is that available in OpenBSD 5.3? I saw that in the -current manpage
> when I was originally configuring smtpd, but lmtp delivery wasn't in
> the manpage in 5.3.
>

Nope, not part of OpenBSD 5.3

But you can fetch a 5.3.3 stable tarball from opensmtpd.org and it will
run on top of OpenBSD 5.3

--
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

Reply | Threaded
Open this post in threaded view
|

Re: smtpd aliases

William Orr-2
Thanks Gilles, first for the help and second for the fantastic software.

One last question - is there a way I can resend the mail stuck in the
queue? I've tried smtpctl schedule all, but it doesn't seem to resolve
the aliases, since it already passed through amavis.

> Gilles Chehade <mailto:[hidden email]>
> June 18, 2013 9:14 AM
>
> Nope, not part of OpenBSD 5.3
>
> But you can fetch a 5.3.3 stable tarball from opensmtpd.org and it will
> run on top of OpenBSD 5.3
>
> William Orr <mailto:[hidden email]>
> June 18, 2013 9:10 AM
> Is that available in OpenBSD 5.3? I saw that in the -current manpage
> when I was originally configuring smtpd, but lmtp delivery wasn't in
> the manpage in 5.3.
>
> Gilles Chehade <mailto:[hidden email]>
> June 18, 2013 1:00 AM
> On Sun, Jun 16, 2013 at 04:44:02PM -0700, William Orr wrote:
>> Hello, all!
>>
>
> Hello,
>
>
>> I'm having some problems with aliases in smtpd, in that they're not
>> properly resolving. I have a bunch of incoming mails stuck in the
>> queue that dovecot (my MDA) refuses to deliver. The logs don't point
>> to any problem reading or opening the aliases file.
>>
>> Here is my smtpd.conf:
>> #   $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $
>>
>> # This is the smtpd server system-wide configuration file.
>> # See smtpd.conf(5) for more information.
>>
>> av = "amavis"
>> originating = "originating"
>> dn = "worrbase.com"
>> av_foreign = "lmtp://localhost:10024"
>> av_origin = "lmtp://localhost:10026"
>> dovecot = "lmtp://localhost:10110"
>>
>> table aliases db:/etc/mail/aliases.db
>>
>> # listen on smtp, submission and the amavis port
>> # should be able to use tls almost all the time
>> listen on fxp0 port smtp tls certificate mail
>> listen on fxp0 port submission tls-require certificate mail auth \
>>      tag $originating
>> listen on lo port 10025 tag $av
>>
>> # coming in from amavis
>> accept tagged $av for domain $dn relay via $dovecot
>> accept tagged $av for any relay
>>
>> # coming in from the outside
>> accept from any for domain $dn alias<aliases>  relay via $av_foreign
>>
>> # coming in from local
>> accept for any alias<aliases>  relay via $av_origin
>>
>> # coming in from authed clients
>> accept tagged $originating for any alias<aliases>  relay via $av_origin
>>
>
> Ok, there's a parse.y bug here that I'll be looking into.
> You shouldn't be able to use "alias" in a relay rule, it is discarded.
> What you want is to use local lmtp delivery, not lmtp relaying.
>
> William Orr <mailto:[hidden email]>
> June 16, 2013 4:44 PM
> Hello, all!
>
> I'm having some problems with aliases in smtpd, in that they're not
> properly resolving. I have a bunch of incoming mails stuck in the
> queue that dovecot (my MDA) refuses to deliver. The logs don't point
> to any problem reading or opening the aliases file.
>
> Here is my smtpd.conf:
> #   $OpenBSD: smtpd.conf,v 1.6 2013/01/26 09:38:25 gilles Exp $
>
> # This is the smtpd server system-wide configuration file.
> # See smtpd.conf(5) for more information.
>
> av = "amavis"
> originating = "originating"
> dn = "worrbase.com"
> av_foreign = "lmtp://localhost:10024"
> av_origin = "lmtp://localhost:10026"
> dovecot = "lmtp://localhost:10110"
>
> table aliases db:/etc/mail/aliases.db
>
> # listen on smtp, submission and the amavis port
> # should be able to use tls almost all the time
> listen on fxp0 port smtp tls certificate mail
> listen on fxp0 port submission tls-require certificate mail auth \
>     tag $originating
> listen on lo port 10025 tag $av
>
> # coming in from amavis
> accept tagged $av for domain $dn relay via $dovecot
> accept tagged $av for any relay
>
> # coming in from the outside
> accept from any for domain $dn alias <aliases> relay via $av_foreign
>
> # coming in from local
> accept for any alias <aliases> relay via $av_origin
>
> # coming in from authed clients
> accept tagged $originating for any alias <aliases> relay via $av_origin
>
> The aliases file (this is concatenated with the default
> /etc/mail/aliases):
> root:           will
> admin:          will
> webmaster:      will
> sysadmin:       will
> worr:           will
> backups:        will
> cron:           will
> clamav:         will
> hostmaster:     will
> virusalert:     will
> dmarc-rua:      [hidden email], postmaster
> dmarc-ruf:      [hidden email], postmaster
>
> I've run newaliases after modifying the aliases db, and I've tried
> sending mails to the aliases listed in the default aliases file.
>
> Mail to actual users works great.
>
> Here's some of the logfile:
> Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Connecting to
> lmtp://127.0.0.1:10110 (localhost) on session 000000c8ec12b3d9...
> Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Connected on
> session 000000c8ec12b3d9
> Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Connect from 127.0.0.1
> Jun 16 18:49:29 ponyexpress smtpd[26195]: relay: TempFail for
> 9336e65b41a220af: from=<>, to=<[hidden email]>, relay=127.0.0.1
> (localhost), delay=13h26m41s, stat=451 4.3.0 <[hidden email]>
> Invalid user settings. Refer to server log for more information.
> Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Error: user root:
> Invalid settings in userdb: userdb returned 0 as uid
> Jun 16 18:49:29 ponyexpress dovecot: lmtp(14309): Disconnect from
> 127.0.0.1: Client quit (in reset)
> Jun 16 18:49:29 ponyexpress smtpd[26195]: smtp-out: Closing session
> 000000c8ec12b3d9: 0 message sent.
> Jun 16 18:49:31 ponyexpress smtpd[26195]: smtp-out: Connecting to
> lmtp://127.0.0.1:10110 (localhost) on session 000000cb899c72fd...
> Jun 16 18:49:31 ponyexpress smtpd[26195]: smtp-out: Connected on
> session 000000cb899c72fd
> Jun 16 18:49:31 ponyexpress dovecot: lmtp(14309): Connect from 127.0.0.1
> Jun 16 18:49:31 ponyexpress smtpd[26195]: relay: TempFail for
> cec99e69ffab9bdf: from=<>, to=<[hidden email]>, relay=127.0.0.1
> (localhost), delay=13h26m40s, stat=451 4.3.0 <[hidden email]>
> Invalid user settings. Refer to server log for more information.

Reply | Threaded
Open this post in threaded view
|

Re: smtpd aliases

Gilles Chehade-7
On Tue, Jun 18, 2013 at 12:33:51PM -0700, William Orr wrote:
> Thanks Gilles, first for the help and second for the fantastic software.
>
> One last question - is there a way I can resend the mail stuck in
> the queue? I've tried smtpctl schedule all, but it doesn't seem to
> resolve the aliases, since it already passed through amavis.
>

There's a way but it's going to require you to edit the individual
envelopes either manually or through a script

--
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

Reply | Threaded
Open this post in threaded view
|

Re: smtpd aliases

Denis
In reply to this post by William Orr-2
Hi William,

I would suggest trying these things first:

- have you checked smtpd main page to Modify the current mailwrapper(8)
  settings?
- stop smtpd and run it in foreground "smtpd -d -v", so all the info will go
  to stderr
- try to exclude "dovecot" and check that smtpd can deliver messages to local
  user's "mbox" first.

This should give you enough info to find the root cause of your error, if not
- I would be interested to see the output of above.

I am using OpenSMTPD for almost a 6 months now, it rocks - nice powerful and
simple program!

Thank you and good luck with your mail setup,

--
Sincerely yours,
Denis
=====
The Bible for command line people.
http://www.read-and-think.org/kjv.html
=====