Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internal Mail will not work (Postfix) 1

Status
Not open for further replies.

BrianAtWork

Programmer
Apr 12, 2004
148
US
I have a problem with the setup of my email system on my linux box. I am running Mandrake 9.1 with postfix. I am able to send emails out to external email addresses - such as hotmail, etc. The reply address I see is user@hostname. Obviously I cannot reply to this email address since I am running the linux box out of my home and I do not have a registered domain. The problem is I am not able to receive emails on my linux box - I'm not even too worried about external email - that would be just a perk. But at the command line when I type in mail user and try to send a user an email, it does not give an error message, but the user never gets the email... It looks like postfix works to send mail (internal or external) but not to receive. I'm wondering if it has anything to do with SMTP, but I cannot figure it out. I've searched all over the web and newsgroups, but all the questions deal with being able to send emails, not receive...
Does anyone know where a good place for me to start would be? Do I need to set up some kind of a mail server to be able to send mail back and forth to local users?

Any help would be greatly appreciated!

Thanks!

Brian
 

What is your local deliver agent set to (postconf | grep mailbox_transport)?

Do you have any errors in your mail log?

 
I ran the postconf | grep mailbox_transport and the response I got is mailbox_transport =
So I am assuming something is not setup correctly =)
I hunted around and found mailbox_transport in the main.cf file under my postfix directory. It is set to cyrus, but it is commented out... Not sure what to do there...

I was trying some other things and was able to telnet into localhost port 25 and send mail, so I guess I have a SMTP server setup...

Any more ideas?

Thanks for the quick reply, too! This is a great start - here's a star!

Brian
 
Oops - sorry - forgot the rest of your reply. I'm not sure where to find my mail log. I've searched around in my postfix dir and /var/spool/postfix dir and cannot find any logs..
 
/var/log/maillog on a RH/Fedora machine. Look in /etc/syslogd.conf to see how mail logging is configured if that isn't it.

I don't know if there is a default compiled into postfix for mailbox_transport delivery. Mine was set to "local:$myhostname" (which is a postfix builtin service) before I changed it, you don't want my setting and you don't want cyrus, so try local:your.host.name

Find your logs, those will help immensely.
 
Ah - thanks for the location of the logs. I tested like this:
Code:
su mysql
mail bhannah
Subject: T
T
CC:
And it went to the command prompt.
I looked in the logs and found this:
Code:
Oct  5 14:12:21 blinux postfix/pickup[31763]: 0BA8D4CD4E: uid=502 from=<mysql>
Oct  5 14:12:21 blinux postfix/cleanup[1459]: 0BA8D4CD4E: message-id=<20041005181220.0BA8D4CD4E@virtual.blinux.lan>
Oct  5 14:12:21 blinux postfix/nqmgr[32293]: 0BA8D4CD4E: from=<mysql@virtual.blinux.lan>, size=301, nrcpt=1 (queue active)
Oct  5 14:12:21 blinux postfix/local[1461]: 0BA8D4CD4E: to=<bhannah@virtual.blinux.lan>, orig_to=<bhannah>, relay=local, delay=1, status=sent ("|/usr/bin/procmail -Y -a $DOMAIN")
This log is from the info log file - the errors and warnings logs are blank.

It looks like it got sent?
 
It looks like something is piping it to procmail, which is an entirely different set of problems.

Do you have a .forward in bhannah's home directory? It looks like it has procmail in it, but procmail may be set up wrong. Get rid of the .forward file if it exists and send another test mail.

 
I couldn't find any .forward files in any directory (none of the users on my system can receive mail...)
I did find this line in my main.cf file under the procmail dir:
Code:
mailbox_command = /usr/bin/procmail -Y -a $DOMAIN

Should this be something different? This is how it was installed originally...
 
You might want to comment that out of the file and reload postfix. When debugging a problem, always eliminate variables whenever you can.
 
I really appreciate all of your help! Thank you so much!
I commented out that line, and now it is saying
status=sent (mailbox)
in the log file... It looks like it thinks it is sending it somewhere, but I can't find it...
Maybe I am approaching this wrong... I am sending mail like this:
mail username
When I check the mail, I just type in:
mail

Is there a different way to check mail? Or is my configuration just off..
 
ns1(~)$ postconf queue_directory
queue_directory = /var/spool/postfix

will tell you where to look. If you have a spool file in your name, then it's just a matter of telling /bin/mail where to find it.
 
Wow! You know exactly where to look - I checked out the /var/spool/mail directory and found a file in it for each userid - that are full of the test emails that I have been sending. In my main.cf file for postfix, the spool directory is set to /var/spool/postfix though, so I'm not sure why the mail is going there...? And also, I assumed /bin/mail would already be pointing to the /var/spool/mail dir, but then why does it say I have no mail? I copied the files from /var/spool/mail to var/spool/postfix and that didn't do the trick either...
I tried running mailconf, but it wouldn't let me run it - it is linked to postconf...
How can I tell /bin/mail where to look for the spool files? I looked everywhere for config files but couldn't find any...

(Again - thank you so much for your help - if I could give you more stars, I would!)
 
Ooops, wrong setting:
Code:
foxtrot(~)$ postconf mail_spool_directory
mail_spool_directory = /var/mail
That's why they're going to he right place.

Code:
foxtrot(~)$ strings /bin/mail | grep ^/
/lib/ld-linux.so.2
/lib/ld-linux.so.2
/bin/more
/bin/csh
/usr/lib/mail.help
/usr/lib/mail.tildehelp
/tmp
/usr/bin/ex
/bin/vi
/var/mail
/etc/mail.rc
/usr/sbin/sendmail
/tmp/
foxtrot(~)$ ls -l /var/mail
lrwxrwxrwx  1 root root 10 Sep 18 08:26 /var/mail -> spool/mail/
Looks like my /bin/mail looks in /var/mail by default, mine is a link to /var/spool/mail
 
Okay -with all of your great help I was able to find out where the problem was. In my /etc/profile, there should be a line that says
Code:
MAIL="/var/spool/mail/$USER"
But in my /etc/profile it said:
Code:
MAIL="/var/spool/mail/USER"
and so when I try to check my mail, it always looks at "USER"'s account - and there isn't even a "USER" on my box!
I'm not even sure how it got that way - I just installed Mandrake on the box a couple of weeks ago, and I don't remember going into that file, but - by adding the $ to USER, the internal mail works fine! I just tested receiving external mail, and that works great too!
Thank you so much for helping me - all of your tips led me to the right place!

Have a great day!

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top