Postfix alias database unavailable

Postfix: How (and why) set up /etc/aliases.db?

I have postfix set up and a local user myuser .

An email to myuser@mydomain.com is arriving without problems, so the basic postfix setup is fine.

I have then set up virtual alias:

I also created the database with postmap /path_to_virtual_aliases

When I send an email to mylongname@mydomain.com , I get this error:

Why does it try to look up myuser, when it is already a native user?

And if it really has to look it up, will the problem be fixed by setting up /etc/aliases? And if yes, how to do so?

1 Answer 1

I think you are mixing up two forms of aliasing which are used at different stages of delivery.

  • virtual_alias_maps are a feature of postfix which let it completely re-route an email. They are used at a stage before postfix has decided what to do with an email and thus can be used to re-route specific email to a completely different email server.
  • alias_maps are a feature of posftix’s local delivery which allow one local mail box to be aliased as another local mail box. They are used at a stage after postfix has decided to deliver the email locally and so cannot be used to re-route to another server. See here:

DESCRIPTION: The aliases(5) table provides a system-wide mechanism to redirect mail for local recipients. The redirections are processed by the Postfix local(8) delivery agent.

Why does it try to look up myuser, when it is already a native user?

This is applied to all local users and can be very useful where you are receiving mail that isn’t covered by virtual_alias_domains. For example redirecting email for many system services into one mail box.

And if it really has to look it up, will the problem be fixed by setting up /etc/aliases? And if yes, how to do so?

Источник

Postfix aliases db: No such file or directory

I am trying to use a postfix on a local Ubuntu 12.04 with ZoneMinder . I installed from Ubuntu Desktop the Postfix package and its dependency.

Now if I try to send email with following command it works good:

Then if an alarm from ZoneMinder sends an email I get the following

and on if i run postqueue -q i get queued emails with (alias database unavailable)

I tried to set pownership to postfix as suggested in other post with the following

and restarted postfix, but din’t help.

The main.cf has the following

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no

What should I check?

2 Answers 2

This is because you have

The hash: means, that you must have a database file containing the hashes, as described in Postfix lookup table types:

An indexed file type based on hashing. This is available only on systems with support for Berkeley DB databases. Public database files are created with the postmap(1) or postalias(1) command, and private databases are maintained by Postfix daemons. The database name as used in «hash:table» is the database file name without the «.db» suffix.

Therefore, as described in the documentation of alias_maps:

If you change the alias database, run postalias /etc/aliases (or wherever your system stores the mail alias file), or simply run newaliases to build the necessary DBM or DB file.

This will build the /etc/aliases.db file from information in /etc/aliases .

Naturally you must run either of these commands also during initial setup.

Источник

Postfix alias database unavailable

I got it solved before, but I dont know what happend cause I have some errors again.
Here is the last thread where I got it solved http://ubuntuforums.org/showthread.php?t=2073767

And here are the error log from mail.log

.no>, relay=local, delay=354991, delays=354990/0.41/0/0.12, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: 5A22E13FAB7: to= , relay=local, delay=411697, delays=411696/0.41/0/0.12, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29981]: 792D713FA9C: to= , relay=local, delay=127475, delays=127474/0.41/0/0.12, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29966]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29966]: warning: hash:/etc/postfix/aliases: lookup of ‘root’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29968]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29968]: warning: hash:/etc/postfix/aliases: lookup of ‘www-data’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29972]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29972]: warning: hash:/etc/postfix/aliases: lookup of ‘www-data’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29965]: 77E061407EA: to= , relay=local, delay=390693, delays=390692/0.48/0/0.1, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29970]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29970]: warning: hash:/etc/postfix/aliases: lookup of ‘root’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29968]: 5A48513FDD8: to= , relay=local, delay=420097, delays=420096/0.54/0/0.12, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29966]: 0230414344F: to= , relay=local, delay=106512, delays=106511/0.54/0/0.12, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29972]: 9E11E13FDD9: to= , relay=local, delay=415896, delays=415896/0.54/0/0.12, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: warning: hash:/etc/postfix/aliases: lookup of ‘root’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29965]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29965]: warning: hash:/etc/postfix/aliases: lookup of ‘www-data’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29966]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29966]: warning: hash:/etc/postfix/aliases: lookup of ‘www-data’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29970]: D8A0F143532: to= , relay=local, delay=241317, delays=241317/0.59/0/0.11, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29981]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29981]: warning: hash:/etc/postfix/aliases: lookup of ‘root’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29966]: 4945D140826: to= , relay=local, delay=430298, delays=430297/0.65/0/0.11, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29965]: 9B1E213F9CF: to= , relay=local, delay=411697, delays=411696/0.65/0/0.11, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: F1A61140A92: to= , relay=local, delay=302788, delays=302787/0.65/0/0.11, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29968]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29968]: warning: hash:/etc/postfix/aliases: lookup of ‘root’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29981]: 6639F1431C1: to= , relay=local, delay=43769, delays=43768/0.7/0/0.11, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: warning: hash:/etc/postfix/aliases is unavailable. open database /etc/postfix/aliases.db: No such file or directory
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: warning: hash:/etc/postfix/aliases: lookup of ‘root’ failed
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29968]: CC82A143528: to= , relay=local, delay=279517, delays=279516/0.77/0/0.1, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 21:36:17 roger-G31T-M7 postfix/local[29973]: 8A0831407E3: to= , orig_to= , relay=local, delay=391627, delays=391626/0.81/0/0.08, dsn=4.3.0, status=deferred (alias database unavailable)
Apr 2 22:08:24 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31285, secured
Apr 2 22:08:24 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=44/697
Apr 2 22:08:24 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31287, secured
Apr 2 22:08:24 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=475/1948
Apr 2 22:08:24 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31289, secured
Apr 2 22:08:25 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:08:27 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31293, secured
Apr 2 22:08:27 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:08:52 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31307, secured
Apr 2 22:08:52 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:08:56 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31309, secured
Apr 2 22:08:56 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:08:58 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31313, secured
Apr 2 22:08:58 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:08:58 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31315, secured
Apr 2 22:08:59 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:09:11 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31389, secured
Apr 2 22:09:11 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=753/468
Apr 2 22:09:11 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=31391, secured
Apr 2 22:09:11 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=296/212683
Apr 2 22:09:36 roger-G31T-M7 postfix/postfix-script[31637]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:09:36 roger-G31T-M7 postfix/postfix-script[31658]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:09:46 roger-G31T-M7 postfix/postfix-script[31700]: stopping the Postfix mail system
Apr 2 22:09:46 roger-G31T-M7 postfix/master[1211]: terminating on signal 15
Apr 2 22:09:46 roger-G31T-M7 postfix/postfix-script[31769]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:09:46 roger-G31T-M7 postfix/postfix-script[31790]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:09:46 roger-G31T-M7 postfix/postqueue[31809]: warning: Mail system is down — accessing queue directly
Apr 2 22:09:47 roger-G31T-M7 postfix/postfix-script[31879]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:09:47 roger-G31T-M7 postfix/postfix-script[31900]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:09:47 roger-G31T-M7 postfix/postfix-script[31918]: starting the Postfix mail system
Apr 2 22:09:47 roger-G31T-M7 postfix/master[31919]: daemon started — version 2.9.3, configuration /etc/postfix
Apr 2 22:09:48 roger-G31T-M7 postfix/postfix-script[31988]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:09:48 roger-G31T-M7 postfix/postfix-script[32009]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:09:54 roger-G31T-M7 postfix/postfix-script[32113]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:09:54 roger-G31T-M7 postfix/postfix-script[32134]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:09:57 roger-G31T-M7 postfix/postfix-script[32239]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:09:57 roger-G31T-M7 postfix/postfix-script[32260]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:18:25 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=32590, secured
Apr 2 22:18:25 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=85/686
Apr 2 22:28:25 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=592, secured
Apr 2 22:28:25 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=85/686
Apr 2 22:36:27 roger-G31T-M7 postfix/postfix-script[941]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:36:27 roger-G31T-M7 postfix/postfix-script[967]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:36:31 roger-G31T-M7 postfix/postfix-script[1086]: warning: not owned by postfix: /var/lib/postfix/./verify_cache
Apr 2 22:36:31 roger-G31T-M7 postfix/postfix-script[1107]: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
Apr 2 22:38:25 roger-G31T-M7 dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=1262, secured
Apr 2 22:38:25 roger-G31T-M7 dovecot: imap(roger): Disconnected: Logged out bytes=85/686

and the postfix main.cf file

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA’s job.
append_dot_mydomain = no

# Uncomment the next line to generate «delayed mail» warnings
#delay_warning_time = 4h

Источник

Adblock
detector