PDA

View Full Version : /etc/aliases deliver locally local domain users


Davide
24th July 2006, 05:19
Hi

I'm getting strange behaviour when I try to put any virtual domain address in /etc/aliases:

# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: david auriasistemas net

I'm obviously trying to forward all mailer-daemon@*, postmaster@* ... to the virtual account david auriasistemas net.

There is a local user "david", and all mail goes to /home/david/Maildir instead of /var/www/webX
This is the log of a message sent from root console to postmaster garabana com, another virtual domain:

Jul 24 03:41:47 eneri postfix/pickup[8995]: B3E9EBB3: uid=0 from=<root>
Jul 24 03:41:47 eneri postfix/cleanup[9265]: B3E9EBB3: message-id=<20060724014147.B3E9EBB3@eneri>
Jul 24 03:41:47 eneri postfix/qmgr[8996]: B3E9EBB3: from=<root eneri auriasistemas net>, size=311, nrcpt=1 (queue active)
Jul 24 03:41:47 eneri postfix/local[9267]: B3E9EBB3: to=<david auriasistemas net>, orig_to=<postmaster garabana com>, relay=local, delay=0, status=sent (delivered to maildir)
Jul 24 03:41:47 eneri postfix/qmgr[8996]: B3E9EBB3: removed

If I put any (I mean ANY, doesn't matter what is the virtual domain) other non-existent accout (f-ex. john auriasistemas net) in /etc/aliases, I get similar messages, ending with:

relay=local, delay=0, status=bounced (unknown user: "john")

If I put any other external address (for example a yahoo! account), all mail is forwarded OK

If I send mail directly to any virtual domain account, from external server, or locally with "mailx", all mail is delivered correctly

doesn't postfix understand virtual domains in /etc/aliases?
Is there any problem with my configuration?

Thanks in advance

Davide
24th July 2006, 13:17
Relevant conf files (they seem OK):

###################################
#
# ISPConfig local-host-names Configuration File
# Version 1.0
#
###################################
localhost
eneri.auriasistemas.net
localhost.eneri.auriasistemas.net
localhost.auriasistemas.net
www.auriasistemas.net
www.enredo.net
www.garabana.com
auriasistemas.net
enredo.net
garabana.com
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####







************************************************** *******************

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

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

myhostname = eneri
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = eneri.auriasistemas.net, localhost.auriasistemas.net, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = /etc/postfix/local-host-names


************************************************** *******************

###################################
#
# ISPConfig virtusertable Configuration File
# Version 1.0
#
###################################
daniel@www.spauriasistemas.net web4_daniel
web4_daniel@www.spauriasistemas.net web4_daniel
david@www.spenredo.net web3_david
web3_david@www.spenredo.net web3_david
david@spenredo.net web3_david
web3_david@spenredo.net web3_david
david@ web3_david
web3_david@ web3_david
david@www.spauriasistemas.net web4_david
web4_david@www.spauriasistemas.net web4_david
david@www.spgarabana.com web5_david
web5_david@www.spgarabana.com web5_david
david@spgarabana.com web5_david
web5_david@spgarabana.com web5_david
shakazulu@www.spenredo.net web3_shakazulu
web3_shakazulu@www.spenredo.net web3_shakazulu
shakazulu@spenredo.net web3_shakazulu
web3_shakazulu@spenredo.net web3_shakazulu
shakazulu@ web3_shakazulu
web3_shakazulu@ web3_shakazulu
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####


Intentionally added "sp" before domains

This problem is getting me mad! ;)

todvard
24th July 2006, 13:44
Hi, i can not see david auriasistemas net email address in your virtusertable file, are you sure it is exist?

Davide
24th July 2006, 15:23
It is there. I suppose I accidentaly deleted it obfuscating e-mails

I post it again

###################################
#
# ISPConfig virtusertable Configuration File
# Version 1.0
#
###################################
daniel@www.spauriasistemas.net web4_daniel
web4_daniel@www.spauriasistemas.net web4_daniel
daniel@spauriasistemas.net web4_daniel
web4_daniel@spauriasistemas.net web4_daniel
david@www.spenredo.net web3_david
web3_david@www.spenredo.net web3_david
david@spenredo.net web3_david
web3_david@spenredo.net web3_david
david@ web3_david
web3_david@ web3_david
david@www.spauriasistemas.net web4_david
web4_david@www.spauriasistemas.net web4_david
david@spauriasistemas.net web4_david
web4_david@spauriasistemas.net web4_david
david@www.spgarabana.com web5_david
web5_david@www.spgarabana.com web5_david
david@spgarabana.com web5_david
web5_david@spgarabana.com web5_david
shakazulu@www.spenredo.net web3_shakazulu
web3_shakazulu@www.spenredo.net web3_shakazulu
shakazulu@spenredo.net web3_shakazulu
web3_shakazulu@spenredo.net web3_shakazulu
shakazulu@ web3_shakazulu
web3_shakazulu@ web3_shakazulu
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####

BTW, it doesn't matter which virtual user I put in /etc/aliases. Postfix allways tries to deliver locally. If there isn't local user matching virtual user, mail is lost.

The postfix log after sending a message directly from root console to virtualuser:

Jul 24 14:34:27 eneri postfix/pickup[3118]: BC086A11: uid=0 from=<root>
Jul 24 14:34:27 eneri postfix/cleanup[3357]: BC086A11: message-id=<20060724123427.BC086A11@eneri>
Jul 24 14:34:27 eneri postfix/qmgr[3119]: BC086A11: from=<root eneri spauriasistemas net>, size=287, nrcpt=1 (queue active)
Jul 24 14:34:27 eneri postfix/pickup[3118]: D2B08B42: uid=10018 from=<web4_david>
Jul 24 14:34:27 eneri postfix/cleanup[3357]: D2B08B42: message-id=<20060724123427.D2B08B42@eneri>
Jul 24 14:34:27 eneri postfix/qmgr[3119]: D2B08B42: from=<web4_david eneri spauriasistemas net>, size=359, nrcpt=1 (queue active)
Jul 24 14:34:27 eneri postfix/local[3359]: BC086A11: to=<web4_david eneri spauriasistemas net>, orig_to=<david spauriasistemas net>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
Jul 24 14:34:27 eneri postfix/qmgr[3119]: BC086A11: removed
Jul 24 14:34:27 eneri postfix/local[3377]: D2B08B42: to=<admispconfig@localhost>, relay=local, delay=0, status=sent (delivered to command: /usr/bin/procmail -f-)
Jul 24 14:34:27 eneri postfix/qmgr[3119]: D2B08B42: removed



************************************************** ***********************

And postfix log after changing /etc/aliases to redirect mail to "shakazulu spenredo net"

Jul 24 14:42:54 eneri postfix/pickup[3607]: 506F1A11: uid=0 from=<root>
Jul 24 14:42:54 eneri postfix/cleanup[3614]: 506F1A11: message-id=<20060724124254.506F1A11@eneri>
Jul 24 14:42:54 eneri postfix/qmgr[3608]: 506F1A11: from=<root eneri spauriasistemas net>, size=292, nrcpt=1 (queue active)
Jul 24 14:42:54 eneri postfix/local[3616]: 506F1A11: to=<shakazulu spenredo net>, orig_to=<postmaster spauriasistemas net>, relay=local, delay=0, status=bounced (unknown user: "shakazulu")
Jul 24 14:42:54 eneri postfix/cleanup[3614]: 64BDDB42: message-id=<20060724124254.64BDDB42@eneri>
Jul 24 14:42:54 eneri postfix/qmgr[3608]: 64BDDB42: from=<>, size=1959, nrcpt=1 (queue active)
Jul 24 14:42:54 eneri postfix/qmgr[3608]: 506F1A11: removed
Jul 24 14:42:54 eneri postfix/local[3616]: 64BDDB42: to=<shakazulu spenredo net>, orig_to=<root eneri spauriasistemas net>, relay=local, delay=0, status=bounced (unknown user: "shakazulu")
Jul 24 14:42:54 eneri postfix/qmgr[3608]: 64BDDB42: removed


Thank you

todvard
24th July 2006, 16:14
Try to add this to main.cf:
virtual_maps = hash:/etc/postfix/virtusertable,hash:/etc/aliases
then reload postfix and let's see whats gonna happen.

Davide
24th July 2006, 17:12
It solved my problem, thank you very much!

It was my fault or is an ISPconfig bug?

Should I open a bug?

falko
25th July 2006, 14:19
It was my fault or is an ISPconfig bug?

It's working on thousands of other installations, so it is not a bug. :)

bruma
21st September 2006, 01:41
Try to add this to main.cf:
virtual_maps = hash:/etc/postfix/virtusertable,hash:/etc/aliases
then reload postfix and let's see whats gonna happen.

FYI, this setting (in bold) solved almost the same problem.

I have this in /etc/aliases
root: web1_bruma
but mail for root mysteriously end up in account web1_spam, which is configured with CatchAll rule. Without CatchAll rule then mail was delivered to right account web1_bruma.
So conclusion could be that with CatchAll turned on, postfix ignores /etc/aliases!?
Is this a bug?

till
21st September 2006, 12:47
Please have a look here:

http://www.howtoforge.com/faq/9_33_en.html

bruma
21st September 2006, 13:38
Yes I already checked that, variable $mydomain is empty.

till
22nd September 2006, 11:50
$mydomain shall not be empty, plese set $mydomain to a technical domain that is not used for receiving emails in ISPConfig. e.g. server1.yourdomain.com and make sure that server1.yourdomain.com resolves to your server IP in DNS.

bruma
26th September 2006, 21:29
$mydomain shall not be empty, plese set $mydomain to a technical domain that is not used for receiving emails in ISPConfig. e.g. server1.yourdomain.com and make sure that server1.yourdomain.com resolves to your server IP in DNS.

So, this technical domain should not be hosted as ispconfig domain? Could this be intranet domain used in LAN?

till
27th September 2006, 10:43
The technical domain must be a official domain.

bruma
27th September 2006, 22:17
Hmm, now I'm confused. For example, I'm hosting 3 domains, one of them should be used as so called technical domain and on this technical domain I should not have mail accounts? Email account are allowed only on other two domains.

Is this technical domain first domain that is used in perfect setup HowTo's (server1.example.com)?

falko
28th September 2006, 21:52
Hmm, now I'm confused. For example, I'm hosting 3 domains, one of them should be used as so called technical domain and on this technical domain I should not have mail accounts?Yes, that would be optimal.
Is this technical domain first domain that is used in perfect setup HowTo's (server1.example.com)?Yes. On my servers I also use a domain that I don't use for web sites and emails.

bruma
28th September 2006, 23:04
Till, Falko thanks for clearing that out.