HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Cannot receive emails : DSN: User Unknown (http://www.howtoforge.com/forums/showthread.php?t=6666)

shiidii 5th September 2006 14:33

Cannot receive emails : DSN: User Unknown
 
Hi, I'm running an Ubuntu Dapper Drake server with ispconfig installed.

I have been trying to overcome this problem for quite a while and I feel that I'm nearly there.
I have setup email accounts on my server through ISPCONFIG and I can log into them with Outlook Express. However whenever I try to send an email to the account I get bounced back with unknown user
here is the mail log sent with www-data:

Code:

Sep  5 21:33:02 mailserver sm-mta[32024]: k85BX1Nr032023: to=<www-data@mailserver.mydomain.com>, delay=00:00:01, xdelay=00:00:00, mailer=local, pri=32639, dsn=2.0.0, stat=Sent
Sep  5 21:35:26 mailserver sendmail[32130]: k85BZQ74032130: from=www-data, size=260, class=0, nrcpts=1, msgid=<200609051135.k85BZQ74032130@mailserver.mydomain.com>, relay=www-data@localhost
Sep  5 21:35:26 mailserver sm-mta[32131]: k85BZQHP032131: <sales@mydomain.com>... User unknown
Sep  5 21:35:26 mailserver sendmail[32130]: k85BZQ74032130: to="Test - Sales@aaapaints User" <sales@mydomain.com>, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30260, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Sep  5 21:35:26 mailserver sm-mta[32131]: k85BZQHP032131: from=<www-data@mailserver.mydomain.com>, size=260, class=0, nrcpts=0, proto=ESMTP, daemon=MSP-v4, relay=localhost [127.0.0.1]
Sep  5 21:35:26 mailserver sendmail[32130]: k85BZQ74032130: k85BZQ75032130: DSN: User unknown

This is the Postfix Main.cf in full

Code:

myhostname = mailserver.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mailserver.mydomain.com, localhost.example.com, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = no
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
smtp_tls_note_starttls_offer = yes
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

# modify the existing smtpd_recipient_restrictions
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000, permit
# modify the existing smtpd_sender_restrictions
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
# then add these
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =

content_filter = amavis:[127.0.0.1]:10024
#receieve_override_options = no_address_mappings

virtual_maps = hash:/etc/postfix/virtusertable

mydestination =

# not sure of the difference of the next two
# but they are needed for local aliasing
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
# this specifies where the virtual mailbox folders will be located
virtual_mailbox_base = /var/spool/mail/virtual
# this is for the mailbox location for each user
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
# and their user id
virtual_uid_maps = mysql:/etc/postfix/mysql_uid.cf
# and group id
virtual_gid_maps = mysql:/etc/postfix/mysql_gid.cf
# and this is for aliases
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
# and this is for domain lookups
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
# this is how to connect to the domains (all virtual, but the option is there)
# not used yet
# transport_maps = mysql:/etc/postfix/mysql_transport.cf

masquerade_domains = aaa-paints.mydomain.com !aaa-paints.mydomain.com
masquerade_exceptions = root

# Requirements for the HELO statement
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
# Requirements for the sender details
smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
# Requirements for the connecting server smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client relays.ordb.org, reject_rbl_client blackholes.easynet.nl, reject_rbl_client dnsbl.njabl.org
# Requirement for the recipient address smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, permit

# require proper helo at connections
smtpd_helo_required = yes
# waste spammers time before rejecting them
smtpd_delay_reject = yes
disable_vrfy_command = yes

I'm sure there's something wrong in here.

Here is the ouput of "ls -la /root/ispconfig"

Code:

total 112
drwxr-xr-x  9 root root  4096 2006-09-05 21:20 .
drwxr-xr-x 11 root root  4096 2006-09-05 22:13 ..
-rwxr-xr-x  1 root root 45996 2006-07-06 12:26 cronolog
-rwxr-xr-x  1 root root  9673 2006-07-06 12:26 cronosplit
drwxr-xr-x 12 root root  4096 2006-07-06 12:09 httpd
drwxr-xr-x 12 root root  4096 2006-07-06 12:26 isp
-rw-r--r--  1 root root    9 2006-09-05 21:20 .old_path_httpd_root
drwxr-xr-x  6 root root  4096 2006-07-06 11:59 openssl
drwxr-xr-x  6 root root  4096 2006-07-18 01:56 php
drwxr-xr-x  4 root root  4096 2006-07-06 12:26 scripts
drwxr-xr-x  4 root root  4096 2006-07-06 12:26 standard_cgis
drwxr-xr-x  2 root root  4096 2006-07-06 12:26 sv
-rwx------  1 root root  9389 2006-07-06 12:26 uninstall

I do have a codomain for my website with an empty host, which often is the problem for a lot of people. Also my virtusertable and local-host-names files are configured correctly
Maildir is enabled in ISPCONFIG

Code:

###################################
#
# ISPConfig local-host-names Configuration File
#        Version 1.0
#
###################################
localhost
mailserver.mydomain.com
localhost.mailserver.mydomain.com
localhost.mydomain.com
www.mydomain.com
mydomain.com
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####

Code:

###################################
#
# ISPConfig virtusertable Configuration File
#        Version 1.0
#
###################################
sales@www.mydomain.com    web1_sales
web1_sales@www.mydomain.com    web1_sales
sales@mailserver.mydomain.com    web1_sales
web1_sales@mailserver.mydomain.com    web1_sales
sales@mydomain.com    web1_sales
web1_sales@mydomain.com    web1_sales
user@www.mydomain.com    web1_user
web1_user@www.mydomain.com    web1_user
user@mailserver.mydomain.com    web1_user
web1_user@mailserver.mydomain.com    web1_user
user@mydomain.com    web1_user
web1_user@mydomain.com    web1_user
user2@www.mydomain.com    web1_user2
web1_user2@www.mydomain.com    web1_user2
user2@mailserver.mydomain.com    web1_user2
web1_user2@mailserver.mydomain.com    web1_user2
user2@mydomain.com    web1_user2
web1_user2@mydomain.com    web1_user2
#### MAKE MANUAL ENTRIES BELOW THIS LINE! ####

I just can't seem to pin point where this is going wrong. The only problem is the incoming emails. I can log into the user accounts and send emails fine with outlook.
Thanks heaps for any help you have. :)

torusturtle 5th September 2006 17:05

in /etc/postfix/main.cf

change
myhostname = mailserver.mydomain.com
to your real hostname

and

mydestination = mailserver.mydomain.com, localhost.example.com, localhost
to
mydestination = /etc/postfix/local-host-names

shiidii 7th September 2006 06:21

Thanks for replying :) . I made the changes, restarted postfix and tested, but I still get the same errors.

By the way mailserver.mydomain.com is the real server name, outgoing emails were being blocked if my server name wasn't the same name as what was on the MX Record.

It's puzzling because the mailboxes exist.. and I can login to them no problem.

Here is an error in the mail log that I'm getting that I assume isn't linked to the problem.. but might be

Code:

Sep  7 04:00:01 mailserver cleanup: clean up process starting: policyd v1.55
Sep  7 04:00:01 mailserver cleanup: connecting to mysql database: localhost
Sep  7 04:00:01 mailserver cleanup: mysql_real_connect(): Access denied for user 'postfix'@'localhost' (using password: YES)
Sep  7 04:00:01 mailserver cleanup: NOT connected..
Sep  7 04:00:01 mailserver cleanup: expiring validated records older than 30 days (1154973601)
Sep  7 04:00:01 mailserver cleanup: DEBUG: fd: 0 query=0, db_deletequery(): DELETE QUICK FROM triplet WHERE _datelast < 1154973601 LIMIT 100000
Sep  7 04:00:01 mailserver cleanup: db_deletequery()/mysql_query(): MySQL server has gone away -> DELETE QUICK FROM triplet WHERE _datelast < 1154973601 LIMIT 100000
Sep  7 13:16:08 mailserver courierpop3login: Connection, ip=[::ffff:203.51.183.135]
Sep  7 13:16:08 mailserver courierpop3login: LOGIN: DEBUG: ip=[::ffff:203.51.183.135], command=AUTH
Sep  7 13:16:08 mailserver courierpop3login: LOGIN: DEBUG: ip=[::ffff:203.51.183.135], command=CAPA
Sep  7 13:16:11 mailserver courierpop3login: LOGIN: DEBUG: ip=[::ffff:203.51.183.135], command=USER
Sep  7 13:16:11 mailserver courierpop3login: LOGIN: DEBUG: ip=[::ffff:203.51.183.135], command=PASS
Sep  7 13:16:11 mailserver courierpop3login: LOGIN: DEBUG: ip=[::ffff:203.51.183.135], username=web1_sales
Sep  7 13:16:11 mailserver courierpop3login: LOGIN: DEBUG: ip=[::ffff:203.51.183.135], password=*******
Sep  7 13:16:11 mailserver courierpop3login: authdaemon: starting client module
Sep  7 13:16:11 mailserver courierpop3login: authdaemon: ACCEPT, username web1_sales
Sep  7 13:16:11 mailserver courierpop3login: LOGIN, user=web1_sales, ip=[::ffff:203.51.183.135]
Sep  7 13:16:11 mailserver courierpop3login: LOGOUT, user=web1_sales, ip=[::ffff:203.51.183.135], top=0, retr=0, time=0

The server attempts to 'clean up' and connect to mysql, but can't get through. I'm using the right password and Postfix is a mysql user with all the priveleges.
As you can see, I can log into my accounts that I made with ispconfig

Is this possibly related to why I'm getting "User Unkown" ??

till 7th September 2006 10:45

Did you follow one of the perfect setup guides?

Your postfix tries to connect to mysql, why? ISPConfig does not support postfix with mysql virtual users.

shiidii 8th September 2006 01:16

I did follow one of the perfect setups,

But I was stupid and thought that I needed to setup my mail server seperately to ispconfig. So I went through this:

http://flurdy.com/docs/postfix/index.html

It was a mistake, and I retraced, but obviously there's still some more things I need to Undo. Thanks for clarifying this, I shall keep trying to "Undo" what I've done.

till 8th September 2006 11:13

Please try to redo the postfix configuration steps from the perfect setup, this might be enough to reconfigure your postfix for ISPConfig.

shiidii 15th September 2006 04:54

Hi, thanks for replying!

I reconfigured Posftix as much as the Perfect Setup suggests. So now a fresh set of errors have shown up, I have gone over every postfix CF file for a solution but nothing has helped.

Code:

mailserver.mydomain.com: Timed out [Last data sent: [Did not connect]]
DNS report shows that the mail server has timed out. I checked and the smtp port is not blocked by the firewall.

These are the errors I'm getting in my mail log
When I try to send an email internally, I get this error

Code:

Sep 15 10:40:01 mailserver postfix/pickup[28963]: 2A2F9312992: uid=125 from=<smmsp>
Sep 15 10:40:01 mailserver postfix/cleanup[31067]: 2A2F9312992: message-id=<20060915004001.2A2F9312992@mailserver.mydomain.com>
Sep 15 10:40:01 mailserver postfix/qmgr[23332]: 2A2F9312992: from=<smmsp@OLDNAME.mydomain.com>, size=670, nrcpt=1 (queue active)
Sep 15 10:40:01 mailserver postfix/smtp[31069]: 2A2F9312992: to=<root@OLDNAME.mydomain.com>, orig_to=<root>, relay=none, delay=0, status=bounced (Host or domain name not found. Name service error for name=OLDNAME.mydomain.com type=AAAA: Host not found)
Sep 15 10:40:01 mailserver postfix/cleanup[31067]: 38BF8312993: message-id=<20060915004001.38BF8312993@mailserver.mydomain.com>
Sep 15 10:40:01 mailserver postfix/qmgr[23332]: 38BF8312993: from=<>, size=2695, nrcpt=1 (queue active)
Sep 15 10:40:01 mailserver postfix/qmgr[23332]: 2A2F9312992: removed
Sep 15 10:40:01 mailserver postfix/smtp[31069]: 38BF8312993: to=<smmsp@OLDNAME.mydomain.com>, relay=none, delay=0, status=bounced (Host or domain name not found. Name service error for name=OLDNAME.mydomain.com type=AAAA: Host not found)
Sep 15 10:40:01 mailserver postfix/qmgr[23332]: 38BF8312993: removed

Here's the situation. I renamed my server to Mailserver and I've changed all references from 'OLDNAME' to mailserver. Yet it's still somehow trying to find 'OLDNAME'. I can't find any CF or MC file that refers to 'OLDNAME'


And this error also comes up:

Code:

Sep 15 10:40:08 mailserver postfix/smtpd[31074]: fatal: open database /etc/aliases.db: No such file or directory
Sep 15 10:40:09 mailserver postfix/master[23328]: warning: process /usr/lib/postfix/smtpd pid 31074 exit status 1
Sep 15 10:40:09 mailserver postfix/master[23328]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
Sep 15 10:41:09 mailserver postfix/smtpd[31113]: fatal: open database /etc/aliases.db: No such file or directory
Sep 15 10:41:10 mailserver postfix/master[23328]: warning: process /usr/lib/postfix/smtpd pid 31113 exit status 1
Sep 15 10:41:10 mailserver postfix/master[23328]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

It's attempting to open Aliases.db, which it shouldn't, it should be accessing just Aliases. There are NO mysql references anywhere in the Postfix CF files, so I don't know why it's still trying to access it.

It also tries about 15 different SMTP pid's, all with "Bad command at startup"... this I'm not sure what it means.

shiidii 15th September 2006 04:57

BTW, this is my current Main.cf

Code:

#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

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mailserver.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mailserver.mydomain.com, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = 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
smtp_tls_note_starttls_offer = yes
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

masquerade_domains = mailserver.mydomain.com !mailserver.mydomain.com
masquerade_exceptions = root


falko 16th September 2006 23:17

What's the output of
Code:

ls -la /etc
? Try to run
Code:

newaliases
and restart Postfix and see if that changes anything.

Also make sure your ISP doesn't block port 25.

shiidii 18th September 2006 02:12

Hi Falko,
Port 25 IS blocked from incoming connections by my ISP, he informs me that it is for security reasons and to not be blacklisted. I can send mail from port 25 though.

Edit: He just unblocked Port 25 for me, I'll let you know how this benefits this problem

I ran Newaliases and sent an email to myself, but got the same output
Quote:

Sep 18 09:40:01 mailserver postfix/pickup[15822]: BCAD7312995: uid=125 from=<smmsp>
Sep 18 09:40:01 mailserver postfix/cleanup[15941]: BCAD7312995: message-id=<20060917234001.BCAD7312995@mailserver.mydomain .com>
Sep 18 09:40:01 mailserver postfix/qmgr[15823]: BCAD7312995: from=<smmsp@OLDSERVERNAME.mydomain.com>, size=670, nrcpt=1 (queue active)
Sep 18 09:40:01 mailserver postfix/smtp[15943]: BCAD7312995: to=<root@OLDSERVERNAME.mydomain.com>, orig_to=<root>, relay=none, delay=0, status=bounced (Host or domain name not found. Name service error for name=OLDSERVERNAME.mydomain.com type=AAAA: Host not found)
Sep 18 09:40:01 mailserver postfix/cleanup[15941]: D07C4312996: message-id=<20060917234001.D07C4312996@mailserver.mydomain .com>
Sep 18 09:40:01 mailserver postfix/qmgr[15823]: D07C4312996: from=<>, size=2695, nrcpt=1 (queue active)
Sep 18 09:40:01 mailserver postfix/qmgr[15823]: BCAD7312995: removed
Sep 18 09:40:01 mailserver postfix/smtp[15943]: D07C4312996: to=<smmsp@OLDSERVERNAME.mydomain.com>, relay=none, delay=0, status=bounced (Host or domain name not found. Name service error for name=OLDSERVERNAME.mydomain.com type=AAAA: Host not found)
Sep 18 09:40:01 mailserver postfix/qmgr[15823]: D07C4312996: removed
Sep 18 09:40:16 mailserver postfix/pickup[15822]: 64D9C312995: uid=33 from=<www-data>
Sep 18 09:40:16 mailserver postfix/cleanup[15941]: 64D9C312995: message-id=<20060917234016.64D9C312995@mailserver.mydomain .com>
Sep 18 09:40:16 mailserver postfix/qmgr[15823]: 64D9C312995: from=<www-data@OLDSERVERNAME.mydomain.com>, size=502, nrcpt=1 (queue active)
Sep 18 09:40:16 mailserver postfix/smtp[15943]: 64D9C312995: to=<sales@mydomain.com>, relay=none, delay=0, status=bounced (mail for mydomain.com loops back to myself)
Sep 18 09:40:16 mailserver postfix/cleanup[15941]: 6E445312996: message-id=<20060917234016.6E445312996@mailserver.mydomain .com>
Sep 18 09:40:16 mailserver postfix/qmgr[15823]: 6E445312996: from=<>, size=2309, nrcpt=1 (queue active)
Sep 18 09:40:16 mailserver postfix/qmgr[15823]: 64D9C312995: removed
Sep 18 09:40:16 mailserver postfix/smtp[15943]: 6E445312996: to=<www-data@OLDSERVERNAME.mydomain.com>, relay=none, delay=0, status=bounced (Host or domain name not found. Name service error for name=OLDSERVERNAME.mydomain.com type=AAAA: Host not found)
Sep 18 09:40:16 mailserver postfix/qmgr[15823]: 6E445312996: removed
The "Loops back to myself" error I'm familiar with. I'm assuming this has nothing to do with the ultimate problem and I will fix this later if that is the case.

Here is the output to 'ls -la /etc'
Link

Thanks for your help


All times are GMT +2. The time now is 01:22.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.