[Dovecot] Dovecot Virtual Users with Sendmail

DormitionSkete@hotmail.com dormitionskete at hotmail.com
Tue Jan 1 23:18:33 EET 2013


Thank you, Andrzej, for helping us.  I really appreciate it.

It no longer rejects the mail that I try to send to the virtual users.  It just tries to send it for eternity.  SquirrelMail says, "Waiting for localhost".  It does not get rejected.  It does not get sent.  It does not leave anything in any log that I can find.  It does not even seem to time out.  I think I waited at least five minutes while it tried to send a message to a virtual user @localhost.

I'm not sure if I did this right.  Below are my sendmail files.  Of course, I rebuilt the .mc -> .cf file, and all of the .db files.

---

sendmail.mc

divert(-1)
#
# Copyright (c) 1983 Eric P. Allman
# Copyright (c) 1988, 1993
#	The Regents of the University of California.  All rights reserved.
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#  This is a configuration file for SunOS 5.8 (a.k.a. Solaris 8) and later
#  subsidiary machines.  It has support for local and SMTP mail.  The
#  confFALLBACK_SMARTHOST macro is enabled, which means that messages will
#  be sent to that host (which is set to mailhost.$m [$m is the local domain])
#  if MX records are unavailable.  A short-cut rule is also defined, which
#  says if the recipient host is in the local domain, send to it directly
#  instead of the smart host.
#
#  If you want to customize this further, copy it to a name appropriate
#  for your environment and do the modifications there.
#

divert(0)dnl
VERSIONID(`sendmail.mc (Sun)')
OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
define(`confFALLBACK_SMARTHOST', `mailhost$?m.$m$.')dnl

define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl

FEATURE(`mailertable')

FEATURE(`access_db')
FEATURE(`blacklist_recipients')


MAILER(`local')dnl
MAILER(`smtp')dnl

MAILER(`procmail')dnl
MAILER(`dovecot')dnl


LOCAL_CONFIG
# declare DOVECOT "magic word"
CPDOVECOT

LOCAL_NET_CONFIG
R$* < @ $* .$m. > $*	$#esmtp $@ $2.$m $: $1 < @ $2.$m. > $3


---

access -- I am wondering if this is the problem?

# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#

to:DOVECOT REJECT

# by default we allow relaying from localhost...
localhost.localdomain		RELAY
localhost			RELAY
127.0.0.1			RELAY
dsicons.net			RELAY
dormitionskete.net		RELAY
holyapostlesconvent.org		RELAY
dormitionskete.info		RELAY
174.32.127.90			RELAY
174.32.127.91			RELAY
174.32.127.92			RELAY
174.32.127.93			RELAY
174.32.127.94			RELAY


---

aliases

#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#ident	"%Z%%M%	%I%	%E% SMI"

##
#  Aliases can have any mix of upper and lower case on the left-hand side,
#	but the right-hand side should be proper case (usually lower)
#
#	>>>>>>>>>>	The program "newaliases" must be run after
#	>> NOTE >>	this file is updated for any changes to
#	>>>>>>>>>>	show through to sendmail.
##

# The following alias is required by the mail protocol, RFC 2821
# Set it to the address of a HUMAN who deals with this system's mail problems.
postmaster: root

# Alias for mailer daemon; returned messages from our MAILER-DAEMON
# should be routed to our local Postmaster.
MAILER-DAEMON: postmaster

# General redirections for pseudo accounts.
bin:		root
daemon:		root
system:		root
toor:		root
uucp:		root

# Well-known aliases.
manager:	root
dumper:		root
operator:	root

# trap decode to catch security attacks
decode:		root

# Aliases to handle mail to programs or files, eg news or vacation
nobody: /dev/null

# Sample aliases:

# Alias for distribution list, members specified here:
#staff:wnj,mosher,sam,ecc,mckusick,sklower,olson,rwh at ernie

# Alias for distribution list, members specified elsewhere:
#keyboards: :include:/usr/jfarrell/keyboards.list

# Alias for a person, so they can receive mail by several names:
#epa:eric

#######################
# Local aliases below #
#######################

dswebstore: dswebstore at DOVECOT
hacwebstore: hacwebstore at DOVECOT


---

mailertable

DOVECOT dovecot:localhost

---

virtualusertable -- empty.

---


Did I do it right?  Any ideas?




On Jan 1, 2013, at 11:26 AM, Andrzej A. Filip wrote:

> On 01/01/2013 06:40 PM, DormitionSkete at hotmail.com wrote:
>> On Jan 1, 2013, at 10:31 AM, Andrzej A. Filip wrote:
>> 
>>> On 12/31/2012 04:19 AM, DormitionSkete at hotmail.com wrote:
>>>> [...]
>>> 1) Do you use virtual users with or without domain part?
>>> [virtual-user or virtual-user at exaple.net ]
>> 
>> Without.
>> 
>> virtual-user
>> 
>> 
>>> 2) How many entries do you have in paswdb/userdb files?
>>> [<100,<1000,....]
>> <100
>> 
>> Around 10.
>> 
>> 
>>> 3) Is SMTP AUTH crucial for virtual users?
>>> 
>> No.  I'd like it, but it's not crucial.
>> 
>> We don't have it now for anyone.  The only way we access our email outside the monastery is through SquirrelMail.  I was hoping to add that with this server upgrade.  It'd be nice to open our email access up more, but we can live without it if we have to.    
> Based on the above replies I would suggest first modified version of the
> recipe below. There are many other ways but it seems to best fit your
> case with simple and stable changes to sendmail.mc/sendmail.cf.
>  http://anfi.homeunix.org/sendmail/localNalias.html
> 
> 1) In *.mc file add
> LOCAL_CONFIG
> # declare DOVECOT "magic word"
> CPDOVECOT
> 
> 2) Deliver messages to *@DOVECOT using dovecot mailer [requires
> FEATURE(`mailertable')].
> mailertable:
> DOVECOT dovecot:localhost
> 
> 3) Do not accept messages to *@DOVECOT via SMTP [requires
> FEATURE(`access_db') and FEATURE(`blacklist_recipients')] access:
> to:DOVECOT REJECT
> 
> 4) create aliases for virtualusers (one alias per one virtual user)
> aliases:
> virtualuser1: virtualuser1 at DOVECOT
> virtualuser2: virtualuser2 at DOVECOT
> 
> Comments about "narrowing" questions:
> 1) case with domain part is usually more complex
> 2) sendmail may be configured to check recipient existence in dovecot's
> userdb/paswdb files but it would use method I would not recommend for
> bigger userdb/passwd files
> 3) sendmail supports cyrus-sasl, sendmail does not support dovecot-sasl
> 



More information about the dovecot mailing list