Virtual Mboxen

System preparation

groupadd -g 65000 vmail
useradd -u 65000 -g 65000 --system -m -d /var/spool/virtual -s /sbin/nologin vmail
ls -alF /var/spool/virtual/

mkdir -p /var/spool/virtual/nethence.com/pbraun-mail/
mkdir -p /var/spool/virtual/os3.su/check-mail/
chown -R vmail:vmail /var/spool/virtual/

problem

Jun  9 09:30:10 slackmx postfix/pipe[6060]: 49h0bk0zYcz1yLF: to=<postmaster@nethence.com>, orig_to=<postmaster>, relay=vproc, delay=0.1, delays=0.04/0.02/0/0.04, dsn=2.0.0, status=sent (delivered via vproc service (procmail: Couldn't chdir to "/var/spool/virtual/nethence.com/postmaster-mail"))

Postfix setup

vi main.cf

mydestination =

virtual_mailbox_domains = nethence.com os3.su
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_transport = vproc:dummy
vproc_destination_recipient_limit = 1

vi master.cf

vproc     unix  -   n       n       -       -       pipe flags=DRXhuq user=vmail
    argv=/usr/bin/procmail -m E_SENDER=$sender E_RECIPIENT=$recipient ER_USER=$user ER_DOMAIN=$domain ER_DETAIL=$extension NEXTHOP=$nexthop /etc/procmailrc

mv /etc/postfix/virtual /etc/postfix/virtual.dist
vi /etc/postfix/virtual

check@nethence.com  placeholder
check@os3.su        placeholder

postmap /etc/postfix/virtual

Dovecot setup

Ready to go

#postfix stop
#postfix start
postfix reload

Acceptance

openssl s_client -starttls smtp -connect slackmx.nethence.com:25

ehlo std30.os3.su
mail from:<noexist@nethence.com>
rcpt to:<check@os3.su>
rcpt to:<check@nethence.com>
data
lala
.
quit

note: using nethence.com domain as MAIL FROM because example.net,com,org won’t do here

550 5.7.27 <check@example.com>: Sender address rejected: Domain example.com does not accept mail (nullMX)

Resources

w/ procmail

Procmail with Postfix and virtual mailboxes https://askubuntu.com/questions/303945/procmail-with-postfix-and-virtual-mailboxes

Non-Postfix mailbox store: separate domains, non-UNIX accounts http://www.postfix.org/VIRTUAL_README.html#in_virtual_other

other links

Subject: Re: postfix now works with your patch http://www.reedmedia.net/software/virtualmail-pop3d/mda/postfix.txt

Virtual domain tools http://www.tsfr.org/~orc/Code/post/

Virtual Mail Delivery – MTA/MDA configuration http://www.reedmedia.net/software/virtualmail-pop3d/#delivery


HOME | GUIDES | BENCHMARKS | html