lundi 23 mars 2015

Postfix alias for root not working in SUSE


I've set up multiple servers running Postfix.


To get a general grasp of the state of the machine I usually redirect e-mail for root to my normal adress.


I recently installed SUSE and tried to do the same. Opened /etc/aliases, added a line like this root: user@mailserver.domain.com and ran newaliases. But messages are still delivered locally.


I've tried doing the same configuration using yast2. It seems to do the same thing, but it does not deliver the message to my other machine. enter image description here


While troubleshooting something else broke, so now messages are no longer delivered locally, but rather the server refuses to create them:



# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 localhost ESMTP
HELO localhost
250 localhost
MAIL FROM: user@suse-server.domain.com
250 2.1.0 Ok
RCPT TO: root
451 4.3.0 <user@suse-server.domain.com>: Temporary lookup failure
quit
221 2.0.0 Bye
Connection closed by foreign host.


I've tried nuking the installation:



# zypper rm postfix
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be REMOVED:
postfix

1 package to remove.
After the operation, 4.8 MiB will be freed.
Continue? [y/n/? shows all options] (y):
(1/1) Removing postfix-2.11.4-2.1 ........................................[done]
Additional rpm output:
warning: /etc/postfix/virtual saved as /etc/postfix/virtual.rpmsave
warning: /etc/postfix/sender_canonical saved as /etc/postfix/sender_canonical.rpmsave
warning: /etc/postfix/master.cf saved as /etc/postfix/master.cf.rpmsave
warning: /etc/postfix/main.cf saved as /etc/postfix/main.cf.rpmsave


There are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run 'zypper ps' to list these programs.
# rm -rf /etc/postfix
# rm -rf /etc/aliases


and starting over, using only yast2:



# zypper in postfix
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
postfix

1 new package to install.
Overall download size: 1007.1 KiB. Already cached: 0 B After the operation, additional 4.8 MiB will be used.
Continue? [y/n/? shows all options] (y):
Retrieving package postfix-2.11.4-2.1.x86_64 (1/1), 1007.1 KiB ( 4.8 MiB unpacked)
Retrieving: postfix-2.11.4-2.1.x86_64.rpm .......................................................................................................................[done (799.0 KiB/s)]
Checking for file conflicts: ..................................................................................................................................................[done]
(1/1) Installing: postfix-2.11.4-2.1 ..........................................................................................................................................[done]
# yast2 mail


But mail to root does not get sent to my other machine:



# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 suse-server.domain.com ESMTP
HELO localhost
250 suse-server.domain.com
MAIL FROM: user@suse-server.domain.com
250 2.1.0 Ok
RCPT TO: root
451 4.3.0 <user@suse-server.domain.com>: Temporary lookup failure
quit
221 2.0.0 Bye
Connection closed by foreign host.


wtf? (pardon my french)



# cat /etc/os-release
NAME=openSUSE
VERSION="20150319 (Tumbleweed)"
VERSION_ID="20150319"
PRETTY_NAME="openSUSE 20150319 (Tumbleweed) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:20150319"
BUG_REPORT_URL="http://ift.tt/1nXWNhu"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"


Left the machine in a broken state over night, log is filled with lines like the following:



Mar 24 06:48:28 suse-server postfix/pickup[25006]: 6B0DE6FD: uid=0 from=<root>
Mar 24 06:48:28 suse-server postfix/cleanup[25051]: warning: hash:/etc/postfix/sender_canonical is unavailable. open database /etc/postfix/sender_canonical.db: No such file or directory
Mar 24 06:48:28 suse-server postfix/cleanup[25051]: warning: hash:/etc/postfix/sender_canonical lookup error for "root@suse-server.domain.com"
Mar 24 06:48:28 suse-server postfix/cleanup[25051]: warning: 6B0DE6FD: sender_canonical_maps map lookup problem for root@suse-server.domain.com -- message not accepted, try again later
Mar 24 06:48:28 suse-server postfix/cleanup[25051]: warning: hash:/etc/postfix/canonical is unavailable. open database /etc/postfix/canonical.db: No such file or directory
Mar 24 06:48:28 suse-server postfix/cleanup[25051]: warning: hash:/etc/postfix/canonical lookup error for "root@suse-server.domain.com"
Mar 24 06:48:28 suse-server postfix/cleanup[25051]: warning: 6B0DE6FD: canonical_maps map lookup problem for root@suse-server.domain.com -- message not accepted, try again later
Mar 24 06:48:28 suse-server postfix/pickup[25006]: warning: maildrop/80E795FC: error writing 6B0DE6FD: queue file write error


Aucun commentaire:

Enregistrer un commentaire