Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th April 2008, 03:56
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble with Postfix setup not working

I am attempting to be a Windows to Ubuntu convert so please excuse my ignorance.

I have installed Postfix, Courier, etc onto UBUNTU 8.04 Beta. I used Falko's "Virtual Users And Domains With Postfix, Courier And MySQL (Ubuntu 7.10)". Everything with well until I was done. It doesn't work and I am extremely frustrated. Had to make a few minor adjustments like apt-get install libdb4.6-dev instead of 4.5 and had to do a apt-get update before that.

Here is my setup and what I am trying to do:

I have 2 FQDN that I can use: example1.com and example2.com

I do not do my own DNS but setup my domains through Dotster. I generally don't use mail.example1.com but rather just use example1 as my mail server name.

I have a static IP that I think I have setup properly on the machine itself because I do have internet access.

My machine name is: Memphis. I do not have a domain setup for my machine. In the main.cf file for postfix I use myhostname=example1.com

I then setup for example1.com and example2.com in the domain table and setup several users for each domain.

Here are some of the log entries:

pop3d: chdir example1/user/: No such file or directory (Do I need to setup a directory on my drive for every user? That is what I was trying to avoid.

postfix/smtpd[12784]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <user@example1.com>: Temporary Lookup failure; from=<user@example1.com> to=<user@example1.com> proto=ESMTP helo=<ME>

I just don't even know where to start. Please help.
Reply With Quote
Sponsored Links
  #2  
Old 6th April 2008, 04:28
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Additional info

when I quit out of my telnet localhost 25 session after getting the Temporary Lookup failure, I get the following error:

virtual_alias_maps map lookup problem for postmaster@4conns.com

Thing is I don't have a postmaster account and not sure why it tries to use one.
Reply With Quote
  #3  
Old 6th April 2008, 07:17
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting closer

OK I actually have some of this working.

I had the wrong field in one of my mysql statements which was giving me the error. Not sure how that happened because I was copying and pasting from the tutorial. Oh well.

Now I can send email from telnet. I sent a test message to my gmail account and received it fine. When I replied to the email that also worked. I have Outlook setup with POP3 and it receives fine but when I attempt to send and email using Outlook it gives me an immediate response back saying message could not be delivered

550 5.1.1 <user@example1.com> User unknown; rejecting

Any ideas?

I also changed my hosts file and my interfaces file.

interfaces was missing auto eth0

and I added my static IP into the hosts file

xx.xx.xx.xx mail mail.example1.com
Reply With Quote
  #4  
Old 6th April 2008, 20:03
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Quote:
Originally Posted by wmkconn
OK I actually have some of this working.

I had the wrong field in one of my mysql statements which was giving me the error. Not sure how that happened because I was copying and pasting from the tutorial. Oh well.

Now I can send email from telnet. I sent a test message to my gmail account and received it fine. When I replied to the email that also worked. I have Outlook setup with POP3 and it receives fine but when I attempt to send and email using Outlook it gives me an immediate response back saying message could not be delivered

550 5.1.1 <user@example1.com> User unknown; rejecting

Any ideas?

I also changed my hosts file and my interfaces file.

interfaces was missing auto eth0

and I added my static IP into the hosts file

xx.xx.xx.xx mail mail.example1.com
Any errors in your mail log? What's in /etc/postfix/main.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 6th April 2008, 22:30
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update

Current situation:

-Can send from linux machine using telnet localhost 25 without issue.

-Cannot send from another machine (i.e. Windows machine with Outlook) even with SMTP authentication enabled. Logs indicate :

Code:
Apr  6 14:07:40 memphis postfix/smtpd[16882]: connect from unknown[75.145.223.25]
Apr  6 14:07:40 memphis postfix/smtpd[16882]: warning: SASL authentication failure: cannot connect to saslauthd server: Permission denied
Apr  6 14:07:40 memphis postfix/smtpd[16882]: warning: unknown[75.145.223.25]: SASL LOGIN authentication failed: generic failure
Apr  6 14:07:40 memphis postfix/smtpd[16882]: lost connection after AUTH from unknown[75.145.223.25]

-ClamAV is showing an error everytime saying clamav.ctl can't be found. Doesn't appear to be stopping anything however. Here is the error from the logs:

Code:
Apr  6 13:59:44 memphis amavis[11472]: (11472-04) (!)ClamAV-clamd: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory, retrying (2)
Apr  6 13:59:50 memphis amavis[11472]: (11472-04) (!)run_av (ClamAV-clamd, built-in i/f): Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 86) line 310.
Apr  6 13:59:50 memphis amavis[11472]: (11472-04) (!!)ClamAV-clamd av-scanner FAILED: CODE(0x8154570) Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory) at (eval 86) line 310. at (eval 86) line 511.
Apr  6 13:59:50 memphis amavis[11472]: (11472-04) (!!)WARN: all primary virus scanners failed, considering backups

Below is my main.cf file:

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


append_dot_mydomain = no


readme_directory = /usr/share/doc/postfix

smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


myhostname = 4conns.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_map$
content_filter = amavis:[127.0.0.1]:10024
MASTER.CF file

Code:
smtp      inet  n       -       -       -       -       smtpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache

-
Reply With Quote
  #6  
Old 7th April 2008, 03:37
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is this a good fix

I got it to work by doing the following:

chmod 777 /var/spool/postfix/var/run/saslauthd

1. Why did I have to do that?
2. Is it safe?
Reply With Quote
  #7  
Old 7th April 2008, 07:29
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with 777 chmod fix

This fix works fine until you restart your computer. I would imagine it would do the same by simply restarting saslauthd.

I have looked through /etc/init.d/saslauthd to find where it changes permissions back but can't find any chmod command listed. What else should I look for?

Is there another way around this permission problem?
Reply With Quote
  #8  
Old 7th April 2008, 18:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Did you configure saslauthd exactly as shown in chapter 6 on http://www.howtoforge.com/virtual-us...ubuntu-7.10-p3 ?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 7th April 2008, 23:06
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Configuration is to HOW-To Instructions

I have verified that everything is correct. I have included files below:

/etc/default/saslauthd

Code:
START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
/etc/pam.d/smtp

Code:
auth    required   pam_mysql.so user=mail_admin passwd=xxx host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
account sufficient pam_mysql.so user=mail_admin passwd=xxx host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
/etc/postfix/sasl/smtpd.conf

Code:
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: mail_admin
sql_passwd: xxx
sql_database: mail
sql_select: select password from users where email = '%u'
ls -la on /var/spool/postfix/var/run/saslauthd
Code:
drwxrwxrwx 2 root sasl   4096 2008-04-06 23:24 .
drwxr-xr-x 3 root root   4096 2008-04-05 13:57 ..
-rw------- 1 root root      0 2008-04-06 23:24 cache.flock
-rw------- 1 root root 945152 2008-04-06 23:26 cache.mmap
srwxrwxrwx 1 root root      0 2008-04-06 23:24 mux
-rw------- 1 root root      0 2008-04-06 23:24 mux.accept
-rw------- 1 root root      5 2008-04-06 23:24 saslauthd.pid
The contents of the saslauthd.pid is 5738.

Here is ls -la on /var/spool/postfix/var/run/ after chmod 777
Code:
drwxr-xr-x 3 root root 4096 2008-04-05 13:57 .
drwxr-xr-x 3 root root 4096 2008-04-05 13:57 ..
drwxrwxrwx 2 root sasl 4096 2008-04-06 23:24 saslauthd
Keith
Reply With Quote
  #10  
Old 7th April 2008, 23:29
wmkconn wmkconn is offline
Junior Member
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default Add't info

here is the ls -la of /var/spool/postfix/var/run/ after a reboot.

Code:
drwxr-xr-x 3 root root 4096 2008-04-05 13:57 .
drwxr-xr-x 3 root root 4096 2008-04-05 13:57 ..
drwx--x--- 2 root sasl 4096 2008-04-07 15:09 saslauthd
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail System Error - Returned Mail tristanlee85 General 16 16th March 2008 10:40
Postfix: Generic mapping not working DanielB Server Operation 0 29th January 2008 00:41
Postfix: connection refused error tosin Server Operation 1 30th October 2007 18:30
Postfix / smptd not working geetha Server Operation 4 30th May 2007 17:31
postfix setup ok but extension needed hotchilli Server Operation 3 2nd July 2006 19:08


All times are GMT +2. The time now is 19:43.


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