# Postfix refuses to send messages to mailbox [SOLVED]

## SnEptUne

Hi,

For the last 4 days, my Postfix MTA suddently refuses to send messages to any mailbox.  Here's the error messages:

maillog.err

```

Nov  6 11:00:57 mail postfix/trivial-rewrite[10307]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem

Nov  6 11:00:57 mail postfix/trivial-rewrite[10308]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem

Nov  6 11:00:57 mail postfix/trivial-rewrite[10306]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem

```

maillog.warn

```
Nov  6 11:10:08 mail postfix/cleanup[11906]: warning: C85072E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/BF475307F6C: Error writing message file

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: CC8412E7174: message has been queued for 2 days

Nov  6 11:10:08 mail postfix/master[9034]: warning: process /usr/lib/postfix/trivial-rewrite pid 11902 exit status 1

Nov  6 11:10:08 mail postfix/cleanup[11907]: warning: CC8412E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/84AD82E707B: Error writing message file

Nov  6 11:10:08 mail postfix/smtpd[9249]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Nov  6 11:10:08 mail postfix/smtpd[9163]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Nov  6 11:10:08 mail postfix/smtpd[9249]: warning: problem talking to service rewrite: Success

Nov  6 11:10:08 mail postfix/smtpd[9163]: warning: problem talking to service rewrite: Connection reset by peer

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: D12262E7174: message has been queued for 1 days

Nov  6 11:10:08 mail postfix/cleanup[11905]: warning: D12262E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/56B90307344: Error writing message file

Nov  6 11:10:08 mail postfix/cleanup[11906]: warning: D37FC2E7174: virtual_alias_maps map lookup problem for root@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/EA49B307F62: Error writing message file

Nov  6 11:10:08 mail postfix/cleanup[11907]: warning: D605F2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/E0415307347: Error writing message file

Nov  6 11:10:08 mail postfix/master[9034]: warning: process /usr/lib/postfix/trivial-rewrite pid 11900 exit status 1

Nov  6 11:10:08 mail postfix/smtpd[11372]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Nov  6 11:10:08 mail postfix/smtpd[11482]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Nov  6 11:10:08 mail postfix/smtpd[11372]: warning: problem talking to service rewrite: Success

Nov  6 11:10:08 mail postfix/smtpd[11482]: warning: problem talking to service rewrite: Connection reset by peer

Nov  6 11:10:08 mail postfix/cleanup[11906]: warning: D83F02E7174: virtual_alias_maps map lookup problem for root@localhost.local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/E3D8B3080DD: Error writing message file

Nov  6 11:10:08 mail postfix/cleanup[11907]: warning: EF08A2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/E2FF920C1C6: Error writing message file

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: F16CC2E7174: message has been queued for 2 days

Nov  6 11:10:08 mail postfix/cleanup[11905]: warning: F16CC2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:08 mail postfix/pickup[9235]: warning: maildrop/95E263064C4: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: F3A3D2E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: F3A3D2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/78FD8E1A2: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 01F552E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 01F552E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/09CD62E7451: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 047A72E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 047A72E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/D7CE82E7153: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 06DD82E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 06DD82E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/4A6EC2E7159: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 0968D2E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 0968D2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/7714A1C881: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 0B8512E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 0B8512E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/4FAB72E7495: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 0DAA82E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 0DAA82E7174: virtual_alias_maps map lookup problem for root@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/248202E745C: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 178052E7174: message has been queued for 3 days

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 178052E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/5493B2E7403: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 19EDE2E7174: message has been queued for 3 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 19EDE2E7174: virtual_alias_maps map lookup problem for root@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/39EE82E7404: Error writing message file

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 1C54C2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/B0E092F83B: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 1F2F52E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 1F2F52E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/6961B2E7453: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 217BD2E7174: message has been queued for 3 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 217BD2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/98B3B2E742E: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 241202E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 241202E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/A6D072E745D: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 266DA2E7174: message has been queued for 3 days

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 266DA2E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/C0F1B2EFA0: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 28EB82E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 28EB82E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/EE30E30BE88: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 2B3422E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 2B3422E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/68057307343: Error writing message file

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 2D9B52E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/B0161307F6E: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 2FE422E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 2FE422E7174: virtual_alias_maps map lookup problem for root@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/AB36F2E7157: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 327122E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 327122E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/95E101D96C7: Error writing message file

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 34B762E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/A44B72E716F: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 371C12E7174: message has been queued for 1 days

Nov  6 11:10:09 mail postfix/cleanup[11906]: warning: 371C12E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/214E41324D: Error writing message file

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: 398E92E7174: message has been queued for 2 days

Nov  6 11:10:09 mail postfix/cleanup[11907]: warning: 398E92E7174: virtual_alias_maps map lookup problem for root@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/334C62E7457: Error writing message file

Nov  6 11:10:09 mail postfix/cleanup[11905]: warning: 3D7392E7174: virtual_alias_maps map lookup problem for amavis@local.net

Nov  6 11:10:09 mail postfix/pickup[9235]: warning: maildrop/21D7F3080E0: Error writing message file

Nov  6 11:10:09 mail postfix/trivial-rewrite[11903]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)

Nov  6 11:10:10 mail postfix/smtpd[9328]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Nov  6 11:10:10 mail postfix/smtpd[9062]: warning: premature end-of-input on private/rewrite socket while reading input attribute name

Nov  6 11:10:10 mail postfix/master[9034]: warning: process /usr/lib/postfix/trivial-rewrite pid 11903 exit status 1

Nov  6 11:10:10 mail postfix/smtpd[9328]: warning: problem talking to service rewrite: Connection reset by peer

Nov  6 11:10:10 mail postfix/smtpd[9062]: warning: problem talking to service rewrite: Success

```

maillog.info

```
Nov  6 11:11:08 mail postfix/smtpd[11382]: rewrite_clnt: canonicalize: test2@local.net -> test2@local.net

Nov  6 11:11:08 mail postfix/smtpd[11382]: send attr request = resolve

Nov  6 11:11:08 mail postfix/smtpd[11382]: send attr address = test2@local.net

Nov  6 11:11:08 mail postfix/smtpd[11382]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:09 mail postfix/pickup[9235]: 17F17272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 1EF39272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 2DFE5272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 30BA3272A: uid=0 from=<root>

Nov  6 11:11:09 mail postfix/pickup[9235]: 33DAA272A: uid=0 from=<root>

Nov  6 11:11:09 mail postfix/pickup[9235]: 4B325272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 4DF6D272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 50E1B272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 53871272A: uid=0 from=<root>

Nov  6 11:11:09 mail postfix/pickup[9235]: 56449272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 5902D272A: uid=0 from=<root>

Nov  6 11:11:09 mail postfix/cleanup[11904]: 5902D272A: message-id=<20041106004852.5902D272A@mail.local.net>

Nov  6 11:11:09 mail postfix/pickup[9235]: 6CDDB272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 6F45F272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 71FD7272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 74758272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 76BC0272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 79111272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 7B57F272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 7D6DD272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 7FD5D272A: uid=0 from=<root>

Nov  6 11:11:09 mail postfix/pickup[9235]: 89888272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 8BDEB272A: uid=0 from=<root>

Nov  6 11:11:09 mail postfix/pickup[9235]: 8E7CA272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 90DEC272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 937B3272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 95AC9272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 97F55272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 9A8F5272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 9CC82272A: uid=999 from=<amavis>

Nov  6 11:11:09 mail postfix/pickup[9235]: 9EDF6272A: uid=999 from=<amavis>

Nov  6 11:11:10 mail postfix/pickup[9235]: A109C309005: uid=0 from=<root>

Nov  6 11:11:10 mail postfix/smtpd[11265]: rewrite stream disconnect

Nov  6 11:11:10 mail postfix/smtpd[11265]: connect to subsystem private/rewrite

Nov  6 11:11:10 mail postfix/smtpd[11265]: send attr request = resolve

Nov  6 11:11:10 mail postfix/smtpd[11265]: send attr address = test1@local.net

Nov  6 11:11:10 mail postfix/smtpd[11265]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:10 mail postfix/smtpd[9883]: rewrite stream disconnect

Nov  6 11:11:10 mail postfix/smtpd[11382]: rewrite stream disconnect

Nov  6 11:11:10 mail postfix/smtpd[9249]: rewrite stream disconnect

Nov  6 11:11:10 mail postfix/smtpd[9163]: rewrite stream disconnect

Nov  6 11:11:10 mail postfix/smtpd[9883]: connect to subsystem private/rewrite

Nov  6 11:11:10 mail postfix/smtpd[9883]: send attr request = resolve

Nov  6 11:11:10 mail postfix/smtpd[9883]: send attr address = test1@local.net

Nov  6 11:11:10 mail postfix/smtpd[9883]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:10 mail postfix/smtpd[9249]: connect to subsystem private/rewrite

Nov  6 11:11:10 mail postfix/smtpd[9249]: send attr request = resolve

Nov  6 11:11:10 mail postfix/smtpd[9249]: send attr address = test1@local.net

Nov  6 11:11:10 mail postfix/smtpd[9249]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:10 mail postfix/smtpd[9163]: connect to subsystem private/rewrite

Nov  6 11:11:10 mail postfix/smtpd[9163]: send attr request = resolve

Nov  6 11:11:10 mail postfix/smtpd[9163]: send attr address = test1@local.net

Nov  6 11:11:10 mail postfix/smtpd[9163]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:10 mail postfix/smtpd[11382]: connect to subsystem private/rewrite

Nov  6 11:11:10 mail postfix/smtpd[11382]: send attr request = resolve

Nov  6 11:11:10 mail postfix/smtpd[11382]: send attr address = test2@local.net

Nov  6 11:11:10 mail postfix/smtpd[11382]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:10 mail postfix/smtpd[11372]: rewrite stream disconnect

Nov  6 11:11:11 mail postfix/smtpd[11372]: connect to subsystem private/rewrite

Nov  6 11:11:11 mail postfix/smtpd[11372]: send attr request = resolve

Nov  6 11:11:11 mail postfix/smtpd[11372]: send attr address = test2@local.net

Nov  6 11:11:11 mail postfix/smtpd[11372]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:11 mail postfix/smtpd[11482]: rewrite stream disconnect

Nov  6 11:11:11 mail postfix/smtpd[11482]: connect to subsystem private/rewrite

Nov  6 11:11:11 mail postfix/smtpd[11482]: send attr request = rewrite

Nov  6 11:11:11 mail postfix/smtpd[11482]: send attr rule = canonicalize

Nov  6 11:11:11 mail postfix/smtpd[11482]: send attr address = test1@local.net

Nov  6 11:11:11 mail postfix/smtpd[11482]: private/rewrite socket: wanted attribute: address

Nov  6 11:11:11 mail postfix/pickup[9235]: A4749309037: uid=999 from=<amavis>

Nov  6 11:11:11 mail postfix/smtpd[9328]: rewrite stream disconnect

Nov  6 11:11:11 mail postfix/smtpd[9328]: connect to subsystem private/rewrite

Nov  6 11:11:11 mail postfix/smtpd[9328]: send attr request = resolve

Nov  6 11:11:11 mail postfix/smtpd[9328]: send attr address = test1@local.net

Nov  6 11:11:11 mail postfix/smtpd[9328]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:11 mail postfix/smtpd[9062]: rewrite stream disconnect

Nov  6 11:11:11 mail postfix/smtpd[9062]: connect to subsystem private/rewrite

Nov  6 11:11:11 mail postfix/smtpd[9062]: send attr request = resolve

Nov  6 11:11:11 mail postfix/smtpd[9062]: send attr address = test1@local.net

Nov  6 11:11:11 mail postfix/smtpd[9062]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:12 mail postfix/pickup[9235]: A82C530911B: uid=999 from=<amavis>

Nov  6 11:11:12 mail postfix/smtpd[11265]: rewrite stream disconnect

Nov  6 11:11:12 mail postfix/smtpd[11265]: connect to subsystem private/rewrite

Nov  6 11:11:12 mail postfix/smtpd[11265]: send attr request = resolve

Nov  6 11:11:12 mail postfix/smtpd[11265]: send attr address = test1@local.net

Nov  6 11:11:12 mail postfix/smtpd[11265]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:12 mail postfix/smtpd[9883]: rewrite stream disconnect

Nov  6 11:11:12 mail postfix/smtpd[9883]: connect to subsystem private/rewrite

Nov  6 11:11:12 mail postfix/smtpd[9883]: send attr request = resolve

Nov  6 11:11:12 mail postfix/smtpd[9883]: send attr address = test1@local.net

Nov  6 11:11:12 mail postfix/smtpd[9883]: private/rewrite socket: wanted attribute: transport

Nov  6 11:11:13 mail postfix/pickup[9235]: AB0853090E2: uid=999 from=<amavis>

Nov  6 11:11:14 mail postfix/pickup[9235]: AE66A3090E2: uid=0 from=<root>

Nov  6 11:11:15 mail postfix/pickup[9235]: B284A3090E2: uid=999 from=<amavis>

Nov  6 11:11:34 mail postfix/pickup[9235]: B531B309171: uid=999 from=<amavis>

Nov  6 11:11:35 mail postfix/pickup[9235]: BDEB5309175: uid=999 from=<amavis>

Nov  6 11:11:36 mail postfix/pickup[9235]: C0A40309175: uid=999 from=<amavis>

```

I haven't alter any postfix files as far as I can remember.  What is wrong with my mail server?

----------

## SnEptUne

Anyone?

----------

## dsegel

Have you changed any config files (sp. alias mappings) recently?

Try running postmap /etc/postfix/virtual.

----------

## SnEptUne

I haven't changed any of the postfix configuration files (including alias and other maps) recently.  Except the debug options and a few others since it isn't working now.

Here's my output

```
# postmap mysql:/etc/postfix/mysql_virtual_alias_maps.cf

postmap: fatal: unsupported map type: mysql

#postmap -q 'postfix' mysql:/etc/postfix/mysql_virtual_alias_maps.cf

postmap: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)

```

Apparently, it cannot connect to the mysql server.  However, I could log into mysql fine from the console.

```

# mysql -u postfix_user -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 7 to server version: 4.0.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> connect postfix_db;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Connection id:    9

Current database: postfix_db

mysql> select goto from alias;

+---------------------+

| goto                |

+---------------------+

| test7@local.net     |

| test6@local.net     |

| test5@local.net     |

| test4@local.net     |

| test3@local.net     |

| test2@local.net     |

| test1@local.net     |

+---------------------+

20 rows in set (0.00 sec)

mysql> \q

Bye

```

Here's my mysql_virtual_alias_maps.cf

```
user            = postfix_user

password        = some_password

dbname          = postfix_db

table           = alias

select_field    = goto

where_field     = address

hosts           = 127.0.0.1

```

----------

## SnEptUne

I changed the hosts fields of the various /etc/postfix/mysql_*.cf from 127.0.0.1 to locahost, and postmap no longer display any errors.  However, after I restarted postfix, the errors still persist.

mail.warn

```
Nov  8 11:09:21 mail postfix/pickup[25299]: warning: maildrop/D5B9914C9D: Error writing message file

Nov  8 11:09:22 mail postfix/pickup[25299]: warning: C77C21D8A68: message has been queued for 3 days

Nov  8 11:09:22 mail postfix/cleanup[25617]: warning: C77C21D8A68: virtual_alias_maps map lookup problem for root@local.net

Nov  8 11:09:22 mail postfix/pickup[25299]: warning: maildrop/248202E745C: Error writing message file

Nov  8 11:09:23 mail postfix/pickup[25299]: warning: D167F1D8A68: message has been queued for 5 days

Nov  8 11:09:23 mail postfix/cleanup[25614]: warning: D167F1D8A68: virtual_alias_maps map lookup problem for amavis@local.net

Nov  8 11:09:23 mail postfix/pickup[25299]: warning: maildrop/5493B2E7403: Error writing message file

Nov  8 11:09:24 mail postfix/pickup[25299]: warning: D39011D8A68: message has been queued for 5 days

Nov  8 11:09:24 mail postfix/cleanup[25601]: warning: D39011D8A68: virtual_alias_maps map lookup problem for root@local.net

Nov  8 11:09:24 mail postfix/pickup[25299]: warning: maildrop/39EE82E7404: Error writing message file

Nov  8 11:09:25 mail postfix/pickup[25299]: warning: D5FCD1D8A68: message has been queued for 2 days

Nov  8 11:09:25 mail postfix/cleanup[25617]: warning: D5FCD1D8A68: virtual_alias_maps map lookup problem for amavis@local.net

```

mail.info

```

Nov  8 11:09:21 mail postfix/pickup[25299]: C503E1D8A68: uid=999 from=<amavis>

Nov  8 11:09:22 mail postfix/pickup[25299]: C77C21D8A68: uid=0 from=<root>

Nov  8 11:09:23 mail postfix/pickup[25299]: D167F1D8A68: uid=999 from=<amavis>

Nov  8 11:09:24 mail postfix/pickup[25299]: D39011D8A68: uid=0 from=<root>

Nov  8 11:09:25 mail postfix/pickup[25299]: D5FCD1D8A68: uid=999 from=<amavis>

Nov  8 11:09:26 mail postfix/pickup[25299]: D89DE1D8A68: uid=999 from=<amavis>

Nov  8 11:09:27 mail postfix/pickup[25299]: DAC601D8A68: uid=999 from=<amavis>

Nov  8 11:09:28 mail postfix/pickup[25299]: DD2D01D8A68: uid=999 from=<amavis>

Nov  8 11:09:29 mail postfix/pickup[25299]: DF5581D8A68: uid=999 from=<amavis>

Nov  8 11:09:30 mail postfix/pickup[25299]: E18101D8A68: uid=999 from=<amavis>

Nov  8 11:09:31 mail postfix/pickup[25299]: E43101D8A68: uid=999 from=<amavis>

Nov  8 11:09:32 mail postfix/pickup[25299]: E6C6C1D8A68: uid=999 from=<amavis>

Nov  8 11:09:33 mail postfix/pickup[25299]: E8F341D8A68: uid=0 from=<root>

Nov  8 11:09:34 mail postfix/pickup[25299]: EB5A61D8A68: uid=999 from=<amavis>

Nov  8 11:09:35 mail postfix/pickup[25299]: ED85D1D8A68: uid=999 from=<amavis>

Nov  8 11:09:36 mail postfix/pickup[25299]: EFF7A1D8A68: uid=999 from=<amavis>

Nov  8 11:09:37 mail postfix/pickup[25299]: F2CEB1D8A68: uid=0 from=<root>

Nov  8 11:09:39 mail postfix/pickup[25299]: 028761D8A68: uid=999 from=<amavis>

Nov  8 11:10:19 mail postfix/pickup[25299]: 03C791D8A68: uid=999 from=<amavis>

Nov  8 11:10:20 mail postfix/pickup[25299]: 091B31D8A68: uid=999 from=<amavis>

Nov  8 11:10:21 mail postfix/pickup[25299]: 423121D8A68: uid=999 from=<amavis>

Nov  8 11:10:22 mail postfix/pickup[25299]: 450891D8A68: uid=999 from=<amavis>

Nov  8 11:10:23 mail postfix/pickup[25299]: 477031D8A68: uid=999 from=<amavis>

Nov  8 11:10:24 mail postfix/pickup[25299]: 499831D8A68: uid=0 from=<root>

Nov  8 11:10:25 mail postfix/pickup[25299]: 4C0311D8A68: uid=0 from=<root>

Nov  8 11:10:26 mail postfix/pickup[25299]: 637511D8A68: uid=999 from=<amavis>

Nov  8 11:10:27 mail postfix/pickup[25299]: 65D0F1D8A68: uid=999 from=<amavis>

Nov  8 11:10:28 mail postfix/pickup[25299]: 6837D1D8A68: uid=999 from=<amavis>

Nov  8 11:10:29 mail postfix/pickup[25299]: 6A9FE1D8A68: uid=0 from=<root>

Nov  8 11:10:30 mail postfix/pickup[25299]: 6D43B1D8A68: uid=999 from=<amavis>

Nov  8 11:10:31 mail postfix/pickup[25299]: 6F7031D8A68: uid=0 from=<root>

Nov  8 11:10:31 mail postfix/cleanup[25601]: 6F7031D8A68: message-id=<20041106004852.6F7031D8A68@m

ail.unimax.hk>

Nov  8 11:10:57 mail postfix/pickup[25299]: 225351D8A68: uid=999 from=<amavis>

Nov  8 11:10:58 mail postfix/pickup[25299]: 2472C1D8A68: uid=0 from=<root>

Nov  8 11:10:59 mail postfix/pickup[25299]: 281511D8A68: uid=999 from=<amavis>

Nov  8 11:11:19 mail postfix/pickup[25299]: 2A1341D8A68: uid=999 from=<amavis>

Nov  8 11:11:20 mail postfix/pickup[25299]: 2CB4D1D8A68: uid=999 from=<amavis>

Nov  8 11:11:21 mail postfix/pickup[25299]: 2ED461D8A68: uid=999 from=<amavis>

Nov  8 11:11:22 mail postfix/pickup[25299]: 3104E1D8A68: uid=999 from=<amavis>

Nov  8 11:11:23 mail postfix/pickup[25299]: 336461D8A68: uid=999 from=<amavis>

Nov  8 11:11:24 mail postfix/pickup[25299]: 35CB51D8A68: uid=0 from=<root>

Nov  8 11:11:25 mail postfix/pickup[25299]: 387571D8A68: uid=0 from=<root>

Nov  8 11:11:26 mail postfix/pickup[25299]: 4FA261D8A68: uid=999 from=<amavis>

Nov  8 11:11:27 mail postfix/pickup[25299]: 5240C1D8A68: uid=999 from=<amavis>

Nov  8 11:11:28 mail postfix/pickup[25299]: 54A631D8A68: uid=999 from=<amavis>

Nov  8 11:11:29 mail postfix/pickup[25299]: 568F51D8A68: uid=0 from=<root>

Nov  8 11:11:30 mail postfix/pickup[25299]: 58F761D8A68: uid=999 from=<amavis>

Nov  8 11:11:31 mail postfix/pickup[25299]: 5B5D91D8A68: uid=0 from=<root>

Nov  8 11:11:31 mail postfix/cleanup[25614]: 5B5D91D8A68: message-id=<20041106004852.5B5D91D8A68@m

ail.unimax.hk>

Nov  8 11:11:32 mail postfix/pickup[25299]: 7059B1D8A68: uid=999 from=<amavis>

Nov  8 11:11:33 mail postfix/pickup[25299]: 727C21D8A68: uid=999 from=<amavis>

Nov  8 11:11:34 mail postfix/pickup[25299]: 74E521D8A68: uid=999 from=<amavis>

Nov  8 11:11:35 mail postfix/pickup[25299]: 770BE1D8A68: uid=999 from=<amavis>

Nov  8 11:11:36 mail postfix/pickup[25299]: 78FB91D8A68: uid=999 from=<amavis>

Nov  8 11:11:37 mail postfix/pickup[25299]: 7B22B1D8A68: uid=999 from=<amavis>

Nov  8 11:11:38 mail postfix/pickup[25299]: 7D4F51D8A68: uid=999 from=<amavis>

Nov  8 11:11:39 mail postfix/pickup[25299]: 7F7121D8A68: uid=999 from=<amavis>

Nov  8 11:11:40 mail postfix/pickup[25299]: 819C11D8A68: uid=999 from=<amavis>

Nov  8 11:11:41 mail postfix/pickup[25299]: 83C331D8A68: uid=999 from=<amavis>

Nov  8 11:11:42 mail postfix/pickup[25299]: 85B331D8A68: uid=0 from=<root>

...

```

----------

## zeroclip

Might be a stupid question but is postfix compiled with mysql support? ie. USE="mysql" emerge postfix

 *Quote:*   

> 
> 
> # postmap mysql:/etc/postfix/mysql_virtual_alias_maps.cf
> 
> postmap: fatal: unsupported map type: mysql 
> ...

 

----------

## SnEptUne

Of course it is complied with mysql support.  It works flawless months ago.  I haven't changed any setup on postfix.  The log indicates that it can't connect to mysql on localhost now.  Maybe I will add 127.0.0.1 instead of localhost?

----------

## SnEptUne

Apparently, it is a problem of mysql and postfix.  I can't connect to mysql with 127.0.0.1 as host either and postfix refused to work with localhost as the hosts.

When hosts is set to 127.0.0.1:

```
mysql -u postfix_user -h 127.0.0.1 -P 3306 -p

ERROR 2003: Can't connect to MySQL server on '127.0.0.1' (111)

```

When hosts is set to localhost:

```

mail.warn:

postfix/cleanup[21502]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

```

Is there something wrong with my postfix setup?  Why can't mysql connect to host 127.0.0.1?

----------

## Rav70

Maybe a stupid question but is mysqld running? Try

```

ps ax|grep mysql

```

Regards,

Rav

----------

## liber!

Maybe you can try to connect to the unix socket of mysql directly, instead of the ip or hostname.

Nathan,

----------

## smutt

Make sure mysqld is set to allow connections from network.  I think it's something like USE_NETWORK=1 or something.  Have you run etc-update lately???

----------

## liber!

 *smutt wrote:*   

> Make sure mysqld is set to allow connections from network.  I think it's something like USE_NETWORK=1 or something.  Have you run etc-update lately???

 

You don't have too, if you use my solution.

----------

## SnEptUne

It is indeed an mysql problem.  I had skip-networking enabled in my.cnf.  But this is strange because 127.0.0.1 is the same as localhost.  Anyway, postfix can now deliver mail to the mailbox.  Thanks for the help.

----------

## kashani

skip networking means, "Don't bind to an IP address." That's why it wasn't running on 127.0.0.1 which is even if only a local address still an IP address.

kashani

----------

