LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-09-2007, 03:15 PM   #1
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Rep: Reputation: 0
postfix pop3 help


I have to install sendmail on a debian sarge distribution and I've been having some serious problems. I was having so many problems, in fact, I decided that I would install postfix instead, seeing as there are a lot more references to postfix than sendmail. I have postfix installed, I have pop3 and imap installed (I installed them both as a sort of failsafe) and everything is working fine. I can telnet into port 25, "ehlo" myself (localhost) and get the right messages, get the right "mail from" and "rcpt to" but it still won't bloody send the mail. It queue's it and doesn't deliver it. I get this message:

250 Ok: queued as D2E6FADA68

I've been sending from root to root on the same damn machine and it still won't receive any mail. I've been working on this for a few weeks (on and off) and I can't get it to work.

It seems to me that the delivery agent isn't working but I have no freaking clue how to fix that. It seems to me the mail is getting sent using the mail transfer client using SMTP but it's not directing it to the right mail boxes. I'm thinking it's something to do with the right directories not being available to my mail client but I have absolutely no clue whether I'm correct in thinking that and, even if I am correct, how to fix it.

I'd really appreciate any help, I'm about to start pulling my hair out pretty quick.

btw: I used this how to and copied and pasted EVERYTHING so I don't think it's that... I may be wrong though. seriously, any help would be awesome!

Thanks in advance,
Bullet
 
Old 04-09-2007, 03:52 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I have a mail server setup and I notice one thing when testing..

user@mydomain.com which is the email address someone else would send to will not work locally on the machine for testing since it's not live, not using the live IP addresses, and has no active MX records pointing at it.. ..

user@mail.mydomain.com however works perfectly well during testing on this box, since there is no DNS entry setup for this box I have to provide the full host/domain name to get mail testing to complete..

That minor issue disappears when the box is moved to production though..



I don't know what imap program you installed but I typically use courier-imap. When using courier-imap you have to use a utility to create the user mailboxes.. the utility is called maildirmake


This is the how-to I used.. (your link is missing btw.. ) http://www.debian-administration.org/articles/364

And also make sure your hostname is set corectly or you will have other issues.. http://www.cpqlinux.com/hostname.html


And since Etch has been released you may want to reload your machine using ETCH to get all the goodness in the new version of Postfix, SA, Courier, etc..etc.. the versions in Sarge are a bit stale at this point.
 
Old 04-09-2007, 04:55 PM   #3
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hey farslayer,

I used this walk through: http://www.falkotimme.com/howtos/per..._debian_sarge/

I actually just installed courier and still can't get it to work. I'm not running a DNS because I wanted a clean install without anything getting in the way, hence why I'm not complicating things by sending mail to anyone but root. I'm using:
mail from:root@localhost.localdomain.local
rcpt to:root@localhost.localdomain.local

everything checks out, it's just the queue, it won't pass the queue for whatever reason.
 
Old 04-09-2007, 06:48 PM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I do not see any part in the HOW-TO you used, that covers creating your Maildir/ folder, using the maildirmake utility.. which would indeed leave you with a system that had nowhere to deliver the mail..

Read through the how-to I posted, find the section that explains maildirmake and follow that portion to create your user Maildir/ folders. remember those directories must be created AS THE USER that will use them. and then you need to do the same commands in the /etc/skel directory as root so all new users created from that point forward will automatically get the proper Maildir/ folders.

When you initially configured your system did it ask for a regular user that would receive all mail for root ?
if so make sure you create the Maildir/ folders in that users directory..


Once you create your mail directories if that doesn't resolve your issue come back here and post the output of postconf -n that command will return all the non-default configuration options of postfix so we can verify everything there looks right.
 
Old 04-09-2007, 08:55 PM   #5
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Original Poster
Rep: Reputation: 0
debian:/# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command = /usr/bin/maildrop
mailbox_size_limit = 0
mydestination = server2.patrickdomain.local, localhost.localdomain, localhost.localdomain, localhost
myhostname = localhost.localdomain
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
recipient_delimiter = +
relayhost =
smtp_tls_key_file = /etc/postfix/ssl/smptd.key
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom


Okay, so I did the Maildir steps @ the home directory of root and in "/etc/skel/" while in root and it still doesn't work, the above is the output of "postconf -n". I have "server2.patrickdomain.local" as one of "mydestinations" but that's only because I"m going to be using that later. I don't think that should make much of a difference. I'm thinking it's maybe something to do with the way I'm telnet-ing to the port, I posted how I've been testing below, just to make sure.

debian:/# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 localhost.localdomain ESMTP Postfix (Debian/GNU)
helo localhost.localdomain.local
250 localhost.localdomain
mail from:root@localhost.localdomain.local
250 Ok
rcpt to:root@localhost.localdomain.local
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: This is a test mail

this is a test message you will not see a response from this command.
.
250 Ok: queued as 1CDE9ADD94
quit
221 Bye
Connection closed by foreign host.
debian:/# mail
No mail for root
debian:/#



this is really getting quite annoying, thanks alot for your help farslayer, I really appreciate. Now, if I could only get this damn thing to work I could push this massive vein back into my head and go to sleep :P I would lean more towards it being the way I'm telnet-ing if it didn't queue every message I send. I don't understand why IMAP won't deliver. Is there a program I have to maybe install on debian so I can actually pull the messages off the server? I'm kinda running out of idea's.

Thanks again for the help,
Bullet

Last edited by <=bullet=>; 04-09-2007 at 08:58 PM.
 
Old 04-09-2007, 09:39 PM   #6
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Original Poster
Rep: Reputation: 0
I figure I may as well throw up my logs too, maybe this will be of some help. I don't see anything wrong with the mail.log but I could be missing something. It may be something to do with "([localhost.localdomain.local]: Name or service not known)". It doesn't make much sense that it would send it, tell me the client and host are okay, and then reject it and print the error in the log...


debian:/var/log# tail mail.log
Apr 9 19:39:45 localhost postfix/smtpd[4929]: 1CDE9ADD94: client=localhost.localdomain[127.0.0.1]
Apr 9 19:40:24 localhost postfix/cleanup[4932]: 1CDE9ADD94: message-id=<20070410013935.1CDE9ADD94@localhost.localdomain>
Apr 9 19:40:24 localhost postfix/qmgr[4901]: 1CDE9ADD94: from=<root@localhost.localdomain.local>, size=502, nrcpt=1 (queue active)
Apr 9 19:40:25 localhost postfix/smtp[4933]: 1CDE9ADD94: to=<root@localhost.localdomain.local>, relay=none, delay=50, status=bounced ([localhost.localdomain.local]: Name or service not known)
Apr 9 19:40:25 localhost postfix/cleanup[4932]: 0A84FADD96: message-id=<20070410014025.0A84FADD96@localhost.localdomain>
Apr 9 19:40:25 localhost postfix/qmgr[4901]: 0A84FADD96: from=<>, size=2324, nrcpt=1 (queue active)
Apr 9 19:40:25 localhost postfix/qmgr[4901]: 1CDE9ADD94: removed
Apr 9 19:40:25 localhost postfix/smtp[4933]: 0A84FADD96: to=<root@localhost.localdomain.local>, relay=none, delay=0, status=bounced ([localhost.localdomain.local]: Name or service not known)
Apr 9 19:40:25 localhost postfix/qmgr[4901]: 0A84FADD96: removed
Apr 9 19:40:27 localhost postfix/smtpd[4929]: disconnect from localhost.localdomain[127.0.0.1]

The mail.err file doesn't contain anything and neither does any of the other log files for mail... hope this helps.
 
Old 04-09-2007, 09:47 PM   #7
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Okay, so I tried something different, I tried to send it to "root@server2.patrickdomain.local" and it appears to have accepted that but it sent it to the "maildrop" and I don't know what that means. Here's the log file after I ran the telnet port 25 command using root@server2.patrickdomain.local instead of localdomain.local

debian:/var/log# tail mail.log
Apr 9 20:28:56 localhost postfix/smtp[5020]: D57C3ADD95: to=<root@localdomain.local>, relay=none, delay=0, status=bounced ([localdomain.local]: Name or service not known)
Apr 9 20:28:56 localhost postfix/qmgr[4901]: D57C3ADD95: removed
Apr 9 20:28:57 localhost postfix/smtpd[5016]: disconnect from localhost.localdomain[127.0.0.1]
Apr 9 20:29:58 localhost postfix/smtpd[5016]: connect from localhost.localdomain[127.0.0.1]
Apr 9 20:30:19 localhost postfix/smtpd[5016]: CC330ADBAA: client=localhost.localdomain[127.0.0.1]
Apr 9 20:30:31 localhost postfix/cleanup[5019]: CC330ADBAA: message-id=<20070410023009.CC330ADBAA@localhost.localdomain>
Apr 9 20:30:31 localhost postfix/qmgr[4901]: CC330ADBAA: from=<root@server2.patrickdomain.local>, size=418, nrcpt=1 (queue active)
Apr 9 20:30:31 localhost postfix/local[5032]: CC330ADBAA: to=<user1@server2.patrickdomain.local>, orig_to=<root@server2.patrickdomain.local>, relay=local, delay=22, status=sent (delivered to command: /usr/bin/maildrop)
Apr 9 20:30:31 localhost postfix/qmgr[4901]: CC330ADBAA: removed
Apr 9 20:30:34 localhost postfix/smtpd[5016]: disconnect from localhost.localdomain[127.0.0.1]


It also looks like it's sending it to user1, which would be because my alias is set: user1 = root -- or something of the sorts. I checked user1 for mail and still nothing. And it seems like the reason I can't find it in the queue would be because it "sends" it, then "deletes" it because it figures it doesn't need to be in the queue anymore because it was "sent".

I'm seriously going crazy, this is like chasing the white rabbit through the rabbit hole. If I run in to a chesire cat and the queen of chess, I'm going drinking with the mad hatter.

Last edited by <=bullet=>; 04-09-2007 at 09:50 PM.
 
Old 04-10-2007, 08:23 AM   #8
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Yes it appears to have been delivered..

Where did you look for the message ?

/home/user1/Maildir/cur

Quote:
user1@mail:~/Maildir/cur$ ls
1168458413.M108405P14262V0000000000006808I002F8023_0.mail.mydomain.com,S=1311:2,ST
1168458556.M162744P14275V0000000000006808I002F8039_0.mail.mydomain.com,S=1307:2,
1168458741.M251157P14285V0000000000006808I002F804D_0.mail.mydomain.com,S=1309:2,
1168458821.M676458P14288V0000000000006808I002F804F_0.mail.mydomain.com,S=1321:2,
1169842469.M710150P23192V0000000000006808I002F8031_0.mail.mydomain.com,S=1426:2,S
1169842525.M63360P23199V0000000000006808I002F804B_0.mail.mydomain.com,S=1437:2,
1169842599.M256194P23208V0000000000006808I002F8050_0.mail.mydomain.com,S=1442:2,
I wonder... since your how-to seemed to skip some vital steps such as creating the Maildir folders.. did it include configuring Courier to look in the Maildir when retrieving mail ?

Is /etc/courier/maildroprc set to deliver to the appropriate location ?
Quote:
# The default path
DEFAULT = "$HOME/Maildir"
How about /etc/courier/pop3d and /etc/courier/imapd
Quote:
##NAME: MAILDIRPATH:0
#
# MAILDIRPATH - directory name of the maildir directory.
#
MAILDIRPATH=Maildir
If pop3 and imap aren't looking in the right location for your mail, then there will be nothing when you check it..

What Mail client are you using to check for mail ? Thunderbird ?
 
Old 04-10-2007, 03:43 PM   #9
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hey,

So I checked the above and it seems that everything is fine. The file path's are right in both folders but there's nothing in ~/Maildir/cur. I'm still not receiving mail though...

As for mail client, I'm not using anything. I'm just checking the mail by typing "mail"... shouldn't that work? I'll give thunder bird a shot, maybe I'm just not pulling anything of the server.

Thanks again for the help, any other idea's?

Bullet
 
Old 04-10-2007, 03:51 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try commenting out the line "mailbox_command = maildrop" since you apparently don't want to use maildrop anyway
 
Old 04-10-2007, 05:51 PM   #11
<=bullet=>
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hey guys,

So I ended up getting it working. I think it was working to a point before and I just was unsure how to check it. I created a new user and am now able to send messages from user1 to user2. I then started up a xp machine and I'm able to get messages from outlook and send messages from outlook. Everything looks to be running fine now. After a few mild strokes, 2 weeks, and a massive headache I finally have postfix/imap installed and functioning and all I had to do was follow three separate tutorials and sell my soul to the devil. I didn't need it anyways...


thanks for the help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Postfix and POP3 amdathlonboy Linux - Networking 1 06-05-2004 09:38 AM
Postfix and POP3 on MDK 9.2 walter Linux - Software 1 05-07-2004 03:48 PM
HELP ME, pop3 postfix sopiaz57 Linux - Software 0 03-08-2004 12:30 AM
postfix, smtp and pop3 artman62 Linux - Software 10 01-28-2003 04:12 AM
setting up pop3 with postfix brendan911 Linux - Software 0 08-02-2002 11:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration