Argh!!
This always happens to me... staring at things for a couple of hours, send
email, do some more staring and figuring it out.
Anyway here is the working config.
###
filter filter-pause pause
filter filter-regex regex
filter all chain filter-pause filter-regex
pki mx1 certificate "/etc/ssl/mx1.crt"
pki mx1 key "/etc/ssl/private/mx1.key"
listen on lo0
listen on egress port 25 filter all tls pki mx1
table aliases file:/etc/mail/aliases
table virtuals file:/etc/mail/virtuals
table domains file:/etc/mail/domains
accept from local for local alias deliver to mbox
accept from any for domain virtual deliver to maildir
"/var/vmail/%{rcpt}/"
accept from local for any relay
###
# /var/mail/domains
virtualdomain1.tld
virtualdomain2.tld
# /var/mail/virtuals
i...@virtualdomain1.tldvmail
i...@virtualdomain2.tldvmail
Thanks Gilles & Co for a kick ass, albeit confusing at times :)), smtp server!
With all the filtering in place it's time to move away from Postfix!
Mischa
> On 02 Jul 2016, at 13:39, Mischa wrote:
>
> Hi All,
>
> I have been wrecking my brain to figure out how to get OpenSMTPD setup with
> virtual domain hosting to achieve the following:
>
> i...@virtualdomain1.tld -> /var/vmail/i...@virtualdomain1.tld/ (Maildir)
> i...@virtualdomain2.tld -> /var/vmail/i...@virtualdomain2.tld/ (Maildir)
> etc...
>
> /var/vmail is owned by vmail:vmail (1001:1001).
>
> My smtpd.conf is:
> ###
> filter filter-pause pause
> filter filter-regex regex
> filter all chain filter-pause filter-regex
>
> pki mx1 certificate "/etc/ssl/mx1.crt"
> pki mx1 key "/etc/ssl/private/mx1.key"
>
> listen on lo0
> listen on egress port 25 filter all tls pki mx1
>
> table aliases file:/etc/mail/valiases
> table domains file:/etc/mail/domains
> table userinfo file:/etc/mail/userinfo
>
> accept from any for domain virtual userbase
> deliver to maildir
> accept from local for any relay
> ###
>
> As far as I can find from reading the docs and code is that the tables only
> match on the left side of the email address.
> Which means in the above example there is a collision when the left side of
> the email address is the same.
>
> The only way I have been able to get mail delivered, opposed to a "550
> Invalid recipient" is with:
>
> # /var/mail/domains
> virtualdomain1.tld
>
> # /var/mail/valiases
> i...@virtualdomain1.tldinfo
> -or-
> infoinfo
>
> # /var/mail/userinfo
> info1001:1001:/var/mail/virtual/i...@virtualdomain1.tld
>
> Which in my mind means that the domain doesn't come into play at all, except
> of course for accepting for the domain in the table.
> Any other way, for example the below, results in a "550 Invalid recipient".
>
> # /var/mail/domains
> virtualdomain1.tld
>
> # /var/mail/valiases
> i...@virtualdomain1.tldi...@virtualdomain1.tld
>
> # /var/mail/userinfo
> i...@virtualdomain1.tld1001:1001:/var/mail/virtual/i...@virtualdomain1.tld
>
> The end goal is to move the files to either sqlite or MariaDB.
> Am I missing the bloody obvious or is it not possible, to have overlapping
> left hand side of the email addresses, without remapping in the aliases table?
>
> Thanx!!
>
> Mischa
>
>
> --
> You received this mail because you are subscribed to misc@opensmtpd.org
> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
>
--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org