Jump to content
Froxlor Forum
  • 0

Dovecot and recieving mails for root


jogr

Question

Hi out there,

 

I am in trouble using dovecot. There are (not yet) any users added by froxlor, so the testing mail adresses are /etc/mail/aliases

 

A redirection such as

webmaster: some@non-server.tld

 

works fine, but I am not able to recieve mails for root (such as generated by cronjobs)

 

root@myserver ~ # postconf -n

alias_database = hash:/etc/mail/aliases

alias_maps = $alias_database

append_dot_mydomain = no

biff = no

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

default_destination_concurrency_limit = 20

inet_interfaces = all

local_destination_concurrency_limit = 2

local_transport = local

mailbox_command = /usr/libexec/dovecot/deliver

mailbox_size_limit = 0

message_size_limit = 104857600

mydestination = $myhostname, $mydomain, localhost.$myhostname, localhost.$mydomain, localhost

mydomain = myserver.de

myhostname = myserver.de

mynetworks = 127.0.0.0/8

sendmail_path = /usr/sbin/sendmail

smtp_use_tls = yes

smtpd_banner = $myhostname ESMTP $mail_name (Gentoo/GNU)

smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_client

smtpd_helo_required = yes

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unauth_pipelining, reject_non_fqdn_recipient

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = $myhostname

smtpd_sasl_path = private/auth

smtpd_sasl_security_options = noanonymous

smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_hostname, reject_unknown_recipient_domain, reject_unknown_sender_domain

smtpd_tls_CAfile = /etc/ssl/server/www_myserver_de.ca-bundle # Just an example for CACert.org

smtpd_tls_auth_only = no

smtpd_tls_cert_file = /etc/ssl/server/www_myserver_de.crt

smtpd_tls_key_file = /etc/ssl/server/myserver_de.key

smtpd_tls_session_cache_timeout = 3600s

tls_random_source = dev:/dev/urandom

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf

virtual_gid_maps = static:9997

virtual_mailbox_base = /var/customers/mail

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf

virtual_mailbox_limit = 0

virtual_mailbox_limit_inbox = yes

virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf

virtual_maildir_limit_message = Sorry, this user has overdrawn their diskspace quota. Please try again later.

virtual_overquota_bounce = yes

virtual_transport = virtual

virtual_uid_maps = static:9997

root@myserver ~ # dovecot -n

# 1.2.11: /etc/dovecot/dovecot.conf

# OS: Linux 2.6.34-gentoo-r6 x86_64 Gentoo Base System release 1.12.13

protocols: imap pop3 imaps pop3s

ssl_ca_file: /etc/ssl/server/www_myserver_de.ca-bundle

ssl_cert_file: /etc/ssl/server/www_myserver_de.crt

ssl_key_file: /etc/ssl/server/myserver_de.key

ssl_cipher_list: ALL:!LOW:!SSLv2

disable_plaintext_auth: no

login_dir: /var/run/dovecot/login

login_executable(default): /usr/libexec/dovecot/imap-login

login_executable(imap): /usr/libexec/dovecot/imap-login

login_executable(pop3): /usr/libexec/dovecot/pop3-login

mail_access_groups: vmail

mail_executable(default): /usr/libexec/dovecot/imap

mail_executable(imap): /usr/libexec/dovecot/imap

mail_executable(pop3): /usr/libexec/dovecot/pop3

mail_plugins(default): quota imap_quota

mail_plugins(imap): quota imap_quota

mail_plugins(pop3): quota

mail_plugin_dir(default): /usr/lib64/dovecot/imap

mail_plugin_dir(imap): /usr/lib64/dovecot/imap

mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3

pop3_uidl_format(default): %08Xu%08Xv

pop3_uidl_format(imap): %08Xu%08Xv

pop3_uidl_format(pop3): UID%u-%v

lda:

postmaster_address: admin@myserver.de

auth_socket_path: /var/run/dovecot/auth-master

mail_plugins: quota

sendmail_path: /usr/sbin/sendmail

auth default:

mechanisms: plain login

user: vmail

passdb:

driver: sql

args: /etc/dovecot/dovecot-sql.conf

userdb:

driver: prefetch

userdb:

driver: sql

args: /etc/dovecot/dovecot-sql.conf

socket:

type: listen

client:

path: /var/spool/postfix/private/auth

mode: 432

user: postfix

group: postfix

master:

path: /var/run/dovecot/auth-master

mode: 432

user: vmail

group: vmail

plugin:

quota: maildir:User Quota

root@myserver ~ # less /var/log/mail.log

Sep 25 18:08:10 myserver postfix/qmgr[330]: B56762A82F8: from=<some.one@googlemail.com>, size=2145, nrcpt=1 (queue active)

Sep 25 18:08:10 myserver postfix/qmgr[330]: A68FB2A82F9: from=<some.one@googlemail.com>, size=2130, nrcpt=1 (queue active)

Sep 25 18:08:10 myserver postfix/qmgr[330]: 57F072A82F6: from=<some.one@googlemail.com>, size=2135, nrcpt=1 (queue active)

Sep 25 18:08:10 myserver postfix/qmgr[330]: 582D92A8020: from=<portage@localhost>, size=609, nrcpt=1 (queue active)

Sep 25 18:08:10 myserver dovecot: deliver(root): chdir(/root) failed: Permission denied

Sep 25 18:08:10 myserver dovecot: deliver(root): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/root

Sep 25 18:08:10 myserver dovecot: deliver(root): Fatal: Namespace initialization failed

Sep 25 18:08:10 myserver dovecot: deliver(root): chdir(/root) failed: Permission denied

Sep 25 18:08:10 myserver dovecot: deliver(root): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/root

Sep 25 18:08:10 myserver dovecot: deliver(root): Fatal: Namespace initialization failed

Sep 25 18:08:10 myserver postfix/local[867]: 1BC682A8090: to=<root@myserver.de>, relay=local, delay=13252, delays=13252/0.01/0/0.03, dsn=4.3.0, status=deferred (temporary failure)

Sep 25 18:08:10 myserver dovecot: deliver(root): chdir(/root) failed: Permission denied

Sep 25 18:08:10 myserver dovecot: deliver(root): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/root

Sep 25 18:08:10 myserver dovecot: deliver(root): Fatal: Namespace initialization failed

Sep 25 18:08:10 myserver postfix/local[868]: B56762A82F8: to=<root@myserver.de>, relay=local, delay=1072, delays=1071/0.01/0/0.05, dsn=4.3.0, status=deferred (temporary failure)

Sep 25 18:08:10 myserver postfix/local[867]: A68FB2A82F9: to=<root@myserver.de>, relay=local, delay=400, delays=400/0.03/0/0.04, dsn=4.3.0, status=deferred (temporary failure)

Sep 25 18:08:10 myserver dovecot: deliver(root): chdir(/root) failed: Permission denied

Sep 25 18:08:10 myserver dovecot: deliver(root): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/root

Sep 25 18:08:10 myserver dovecot: deliver(root): Fatal: Namespace initialization failed

Sep 25 18:08:10 myserver dovecot: deliver(root): chdir(/root) failed: Permission denied

Sep 25 18:08:10 myserver dovecot: deliver(root): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/root

Sep 25 18:08:10 myserver dovecot: deliver(root): Fatal: Namespace initialization failed

Sep 25 18:08:10 myserver postfix/local[868]: 57F072A82F6: to=<root@myserver.de>, relay=local, delay=13007, delays=13007/0.08/0/0, dsn=4.3.0, status=deferred (temporary failure)

Sep 25 18:08:10 myserver postfix/local[867]: 582D92A8020: to=<root@myserver.de>, orig_to=<root>, relay=local, delay=16998, delays=16998/0.08/0/0.02, dsn=4.3.0, status=deferred (temporary failure)

 

root@myserver~ # dovecot --build-options

Build options: ioloop=epoll notify=inotify ipv6 openssl

Mail storages: maildir mbox raw shared

SQL drivers: mysql

Passdb: checkpassword pam passwd passwd-file shadow sql

Userdb: nss passwd passwd-file prefetch sql static

Link to post
Share on other sites

6 answers to this question

Recommended Posts

root@myserver ~ # cat /etc/mail/aliases

# Basic system aliases -- these MUST be present.

MAILER-DAEMON: postmaster

postmaster: root

root: some.one@googlemail.com, \root

 

But there will be no mails for root on the root account on the server nor will there be mails at the google account.

Link to post
Share on other sites

I did both. Run "newaliasses" and restart postfix. I also tried to set mail_location, but this changed nothing. Actually I removed \root from

 

root: some.one@googlemail.com, \root

and tried to resend the mails by postsuper -r.

Without \root, the mails were sent to the given google mail adress, but I would like to hold these mails also on the server.

Link to post
Share on other sites

so it did work but you have a new problem: you want to keep the mails too, that's something else.

 

I never needed to keep the mails onto the server, so, sorry, don't know - thought you just have problems getting the root-mails (which seemed to be the problem in your post from 11:25 AM)

Link to post
Share on other sites

I have local delivery working, and delivery to usernames@hostname working.

 

ie user1@froxlor.example.com, which is a real shell in /etc/passwd, delivers to ~/Maildir.

 

Hopefully this helps.

 

/etc/postconf/main.cf

mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-dovecot-postfix.conf -n -m "${EXTENSION}"
local_transport = local:$myhostname

 

/etc/dovecot/conf.d/01-dovecot-postfix.conf

# Some general options
mail_location = maildir:~/Maildir
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@

protocol lda {
       postmaster_address = postmaster
       mail_plugins = sieve
       quota_full_tempfail = yes
       deliver_log_format = msgid=%m: %$
       rejection_reason = Your message to <%t> was automatically rejected:%n%r
}

plugin {
       sieve=~/.dovecot.sieve
       sieve_dir=~/sieve
}

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...