Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Apr 03, 2005 12:39 am 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
Me, a great newbie, need help with Postfix.

I'm running Debian and I've installed postfix and postfix-mysql to do some alias work. I've created the corresponding tables and put the virtual-... lines in my main.cf file. I've used in good part the following howto: http://high5.net/howto/.

Now, the postfix server is running and my firewall is open to SMTP. When I do the following:

Code:
telnet mymailserver.domain.org 25
Trying xx.xx.xx.xx...
Connected to mymailserver.domain.org.
Escape character is '^]'.
220 mymailserver.domain.org ESMTP Postfix (Debian/GNU)
helo mydomain.com
250 mymailserver.domain.org
mail from: <>
250 Ok
rcpt to: <whatever@domain.org>

And it stops here: no confirmation, no error message, no timeout (yet). Same thing if I put an address in the 'mail from' field. It works when I specify no email address, it tells me to write a valid email address if I input a wrong one but if the address is valid, it seems like it tries to compare it to something and it freezes there.

I guess it's something stupid I'm missing as I'm a mail server newbie but my searches in Google haven't returned anything helpful yet.

Does it ring a bell for anyone out there?

Thanks! :)


Top
   
 Post subject: And mail...
PostPosted: Sun Apr 03, 2005 1:10 am 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
Also, the 'mail' program does not send mail, whatever the address is, locally or externally.


Top
   
 Post subject:
PostPosted: Sun Apr 03, 2005 6:02 am 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
If there is nothing useful in the mail error log, try turning on verbose logging - add the parameter -v to the line in master.cf that invokes the smtp service of type inet and then restart postfix.

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Sun Apr 03, 2005 6:12 am 
Offline
Senior Member

Joined: Thu Nov 25, 2004 10:05 am
Posts: 52
As previous poster said, check your /var/log/mail.log and I'd also look at /var/log/mysql/ I suspect the DB lookup is failing for some reason. There are numerous possibilities, judging by the guide you followed, my first guess (this is what caught me out) would be that postfix is running chrooted (which it generally does), so it can't access MySQL via the file socket - you'll probably need to contact it via the network socket.

This means first checking mysql is set up to listen on a network socket, (beware of the security issues with this) and then editing the 4 mysql...cf files you created so hostname is a hostname associated with your IP address in /etc/hosts and not localhost.


Top
   
 Post subject: Log
PostPosted: Sun Apr 03, 2005 10:55 am 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
In my mail.err I now have:

Code:
fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem


Numerous times. Also, in mail.log:

Code:
 postfix/trivial-rewrite[2845]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 postfix/trivial-rewrite[2845]: fatal: mysql:/etc/posfix/mysql_virtual_alias_maps.cf(0,100): table lookup problem


Top
   
 Post subject: Ok, and an alternative?
PostPosted: Sun Apr 03, 2005 10:57 am 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
Seems you two are right. But what's best? Not to run the daemon chrooted or to open the socket in the firewall?


Top
   
 Post subject: Lookup failure
PostPosted: Sun Apr 03, 2005 11:17 am 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
Ok, I've made the trivial-rewrite not run chrooted and now I can go a little further.

Code:
Trying xx.xx.xx.xx...
Connected to mymailserver.domain.org.
Escape character is '^]'.
220 mymailserver.domain.org ESMTP Postfix (Debian/GNU)
helo test.com
250 mymailserver.domain.org
mail from: <test@test.com>
250 Ok
rcpt to: <you@otherdomain.com>
554 <you@otherdomain.com>: Relay access denied
rcpt to: <me@mymailserver.domain.org>
451 <me@mymailserver.domain.org>: Temporary lookup failure


I'm still working on it but if you have any ideas, they're welcome!
Why the 451 error?


Top
   
 Post subject: Chrooted
PostPosted: Sun Apr 03, 2005 12:07 pm 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
Now I've made run not-chrooted the

smtp
pickup
cleanup
rewrite

And it seems I can send mail. Great!

- Now, is there any security risks associated with unchrooting the previous service?

- Also, it seems to reject mail from unknown domain. Is it a little bit to restrictive? I know it is good not to relay mail to unknown domain but from unknown domain, what if the domain is new?

Thank you for your help! :P


Top
   
PostPosted: Tue Apr 05, 2005 7:03 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
I didn't want to setup a 127.0.0.1 socket for mysql (although that's a fairly reasonable solution, and I didn't want to run postfix outside a chroot(), and eventually this popped into my head:

mkdir /var/spool/postfix/var/run/mysqld
mount -o bind /var/run/mysqld /var/spool/postfix/var/run/mysqld

Bind mounts allow you to make a directory tree show up somewhere else. Nifty, eh? If you go this route, don't forget to add a entry in
/etc/fstab, so it last over a reboot:

/var/run/mysqld /var/spool/postfix/var/run/mysqld auto bind 0 0


(the above paths are for Debian, don't know what RH et. al. do with mysql socket paths.)

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
 Post subject: Wow!
PostPosted: Wed Apr 06, 2005 8:48 am 
Offline
Senior Newbie

Joined: Tue Feb 22, 2005 12:17 am
Posts: 17
Location: Montreal, QC
Very nifty!
Works great with Debian, thanks!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group