LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 07-02-2012, 11:05 PM   #1
said76
Member
 
Registered: Aug 2011
Posts: 103

Rep: Reputation: Disabled
send out emails fine but can't receive incoming emails


Hi,

I have this strange problem here. I can send emails out but don't see any incoming emails when I should have received them. I tested it to my external email account as well as locally to myself. None actually works.

Here is the log file from /var/log/mail.log
postfix/postfix-script[3198]: starting the Postfix mail system
postfix/master[3199]: daemon started -- version 2.9.3, configuration /etc/postfix
postfix/smtpd[3391]: connect from localhost[127.0.0.1]
postfix/smtpd[3391]: C26FA4093F: client=localhost[127.0.0.1]
postfix/cleanup[3400]: C26FA4093F: message-id=<6c89bd325bf02b8b4e66d8d55a09a1b7@mycompanydomain.com>
postfix/qmgr[3201]: C26FA4093F: from=<mharry@mycompanydomain.com>, size=581, nrcpt=1 (queue active)
postfix/smtpd[3391]: disconnect from localhost[127.0.0.1]
postfix/smtp[3403]: C26FA4093F: to=<myself@yahoo.com.au>, relay=mta6.am0.yahoodns.net[98.136.217.202]:25, delay=2.8, delays=0.1/0.04/1.1/1.6, dsn=2.0.0, status=sent (250 ok dirdel)
postfix/qmgr[3201]: C26FA4093F: removed
postfix/smtpd[3415]: connect from nm1.bullet.mail.sp2.yahoo.com[98.139.91.71]
postfix/smtpd[3415]: 74C524093F: client=nm1.bullet.mail.sp2.yahoo.com[98.139.91.71]
postfix/cleanup[3400]: 74C524093F: message-id=<1341282748.52540.YahooMailNeo@web113419.mail.gq1.yahoo.com>
postfix/qmgr[3201]: 74C524093F: from=<myself@yahoo.com.au>, size=4063, nrcpt=1 (queue active)
postfix/virtual[3419]: 74C524093F: to=<mharry@mycompanydomain.com>, relay=virtual, delay=1, delays=0.95/0.02/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)
postfix/qmgr[3201]: 74C524093F: removed

From the log file, it seems that I should have received and read the emails from my roundcubemail.

Here is my main.cf
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = mycompanydomain.com
myhostname = mharry.mycompanydomain.com
mynetworks = 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/dovecot-sasl-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
transport_maps = mysql:/etc/postfix/mysql/mysql-virtual_transports.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql-virtual_mailboxes.cf
virtual_uid_maps = static:5000
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_overquota_bounce=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql/mysql-virtual_mailbox_limit_maps.cf
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_limit_message="The user you are trying to reach is over quota."

I was wondering if anyone might be able to tell me what went wrong here.

BTW, I run Postfix, dovecot, dovecot-SASL, MySQL and roundcube as webmail.
And I am using IMAP dovecot.

Any help would be greatly appreciated.

Thank you
 
Old 07-03-2012, 06:07 AM   #2
leslie_jones
Member
 
Registered: Sep 2011
Posts: 130

Rep: Reputation: Disabled
This line:

(delivered to maildir)

Usually means it has been delivered (written to file) *somewhere*. That *somewhere* is defined by what your sql returns thanks to virtual_mailbox_maps (/etc/postfix/mysql/mysql-virtual_mailboxes.cf). At a guess I'd say look in /home/vmail/mharry/new OR /home/vmail/mycompanydomain/mharry/new. Poke around with the ls in these areas and see what turns up.

If you can find where the mail has been delivered to, you can then cross check that both Dovecot & Roundcube are looking in the right place for it.
 
Old 07-04-2012, 02:36 AM   #3
said76
Member
 
Registered: Aug 2011
Posts: 103

Original Poster
Rep: Reputation: Disabled
Thank you Leslie for your reply.

That's what my first guess was after reading from the log file and saw that it says "delivered to Maildir" but became doubtful when not receiving any emails at all.

I already poked into /home/vmail/mycompanydomain/mharry/new and /home/vmail/mycompanydomain/mharry/cur, and found that all my "sent emails" files are in /home/vmail/mycompanydomain/mharry/new. Also what confuses me all the more is that I found /Maildir folder under /home/vmail/mycompanydomain/mharry/ and in it, there are /cur, /new and /tmp. So something must have been incorrectly configured. But I got a feeling my roundcube has not been reading from the right inbox.

Please let me know if you need my config files.

Thank you
 
Old 07-04-2012, 03:01 AM   #4
leslie_jones
Member
 
Registered: Sep 2011
Posts: 130

Rep: Reputation: Disabled
I'd forget Roundcube for a moment and get Dovecot working. You've established that Postfix is delivering correctly. If I were troubleshooting this I'd next check that I could telnet to Dovecot on 110 (pop) and log in, running basic POP commands to check to see if I could read messages. Telnet is useful as you get good error feedback.

I suspect the issue is Dovecot is looking in the wrong place. The older 'how to' articles were great, but Dovecot's config has changed slightly (you may have some clues in the logs), and this broke stuff - particularly the home directory of Virtual Mail users.

My notes from the last mail server I put together with Dovecot reads:
Quote:
Relative home directory paths are giving errors now. They were never supported, but earlier they just didn't usually cause problems. If you were using e.g. mail_location = maildir:/var/mail/%h, just change it to mail_location = maildir:%h and add /var/mail/ prefix to home dirs.
SO OUR FIX IS:
edit dovecot.conf change
mail_location = maildir:/path/to/mail/%h/
TO
mail_location = maildir:%h

edit dovecot-sql.conf
user_query = SELECT virtual_mailbox AS home, virtual_uid AS uid, virtual_gid AS gid FROM users where email = '%u';
TO
user_query = SELECT concat('/path/to/mail', virtual_mailbox) AS home, virtual_uid AS uid, virtual_gid AS gid FROM users where email = '%u';
Obviously these are system specific and if this is your problem you'll need to alter them to suit your setup. Before that, though, I'd check for any clues in the logs. Can you talk to Dovecot by Telnet OK and log in?

Last edited by leslie_jones; 07-04-2012 at 03:02 AM.
 
Old 07-04-2012, 08:12 PM   #5
said76
Member
 
Registered: Aug 2011
Posts: 103

Original Poster
Rep: Reputation: Disabled
Thank you for your reply, Leslie.

Can you talk to Dovecot by Telnet OK and log in?
Yes, I can by telnet.

Leslie, prior to telnet, I actually did a test by sending a dummy email from my Yahoo email address, however, as you could tell, both the exists and recent show 0 number of emails (when it's suppose to have received an email from my Yahoo). So I got a feeling that dovecot is not looking in the right place (which I agree with you).

$ telnet mycompanydomain.com 143
Connected to mycompanydomain.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot IMAP4 Server ready.
a login mharry mharrypassword
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE SEARCH=FUZZY] Logged in
b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1341200706] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
* OK [NOMODSEQ] No permanent modsequences
b OK [READ-WRITE] Select completed.

At this point, I'll read through your notes see if I can adjust it to suit my system requirements.

Will post back the result. Thank you very much
 
Old 07-05-2012, 02:04 AM   #6
leslie_jones
Member
 
Registered: Sep 2011
Posts: 130

Rep: Reputation: Disabled
I suspect that it's just looking in the wrong place for the mailbox - or does not have the correct permissions. This will all be set in dovecot.conf around these lines:

Quote:
mail_location = maildir:%h
mail_uid = 5000
mail_gid = 5000
In my case this bit: mail_location = maildir:%h

Is set & populated from MYSQL by the query in dovecot-sql.conf

user_query = SELECT concat('/path/to/mail', virtual_mailbox) AS home, virtual_uid AS uid, virtual_gid AS gid FROM users where email = '%u';

Whilst this won't match you set up, it should send you the right way (I hope).
 
Old 07-05-2012, 02:30 AM   #7
said76
Member
 
Registered: Aug 2011
Posts: 103

Original Poster
Rep: Reputation: Disabled
Hi Leslie,

I finally found all the incoming emails and they have been sitting at /home/vmail/mycompanydomain/mharry/new folder.

So I followed your advice to cross check that both Dovecot & Roundcube are looking in the right place for it.

In dovecot.conf, I have changed
FROM
mail_location = maildir:/home/vmail/%d/%n/Maildir
TO
mail_location = maildir:/home/vmail/%d/%n

And I can view all my incoming emails from roundcube mail now

But I am still curious what makes roundcube mail to look into /home/vmail/%d/%n/Maildir. What did I do wrong in the first place?

Thank you so much
 
Old 07-05-2012, 02:37 AM   #8
leslie_jones
Member
 
Registered: Sep 2011
Posts: 130

Rep: Reputation: Disabled
I'm not familiar with Roundcube, but a quick look at its page and it looks like it talks IMAP to Dovecot - so fix that, you fix Roundcube. But... I may be wrong! Glad you have it working, that's a great start to the day :-)
 
  


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
postfix can send but cannot receive emails rmihai Linux - Server 9 05-02-2009 10:12 AM
can receive emails but cannot send it? rhxk Linux - General 6 03-06-2007 05:24 PM
Postfix doesn't receive incoming emails El Mago Linux - Software 8 08-04-2006 11:57 AM
Can send but not receive any emails with Qmail. anorman Linux - Software 1 12-11-2003 03:51 PM
Can't send or Receive Emails amohime Linux - Networking 4 04-11-2003 03:42 AM


All times are GMT -5. The time now is 08:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration