[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

Qmail not delivering messages in Maildir

i installed qmail+courier-imap_courier-authlib and the default delivery was Mailbox. Then i configure outlook. I am able to send mails but not able to receive mails in outlook. while i can see the  mails through Mailbox. i thought Mailbox was not supported by courier.

Hence i have changed the default delivery to Maildir & now messages getting stuck in queue, not deliver in Maildir.

Pl help.
0
chandar_bhandari
Asked:
chandar_bhandari
  • 9
  • 7
2 Solutions
 
arnoldCommented:
The delivery is handled by qmail. Courier-imap is an interface to the data so check whether it is configured to access the data where qmail deposits it.

What is your qmail setup? Where are the users defined? Did you create the Maildir for each user in their $HOME directory
Maildir has to exist in the user's Home directory. What is the error that is in the qmail-send log file?

Depending where the users are defined, you could run a script that will create those folders.

Something like this may work.

cat list_of_users | while read $a; do
home=$(grep $a | /etc/passwd | awk -F: ' { print $6 } ')
maildirmake "$home"
chown -Rh $a:group $home/Maildir
done
0
 
chandar_bhandariAuthor Commented:
Thanks for your reply...
i used the below command to create Maildir :-
/var/qmail/bin/maildirmake $HOME/Maildir
echo "./Maildir/" > ~/.qmail
/var/qmail/bin/maildirmake /etc/skel/Maildir
cd /etc/skel/
echo "./Maildir/" > ~/.qmail
echo "export MAIL=~/Maildir" >> /etc/profile

how can i configure Courier-imap to access mail where qmail deposit.

i am not able to understand  how to run the commands given by you.

cat list_of_users | while read $a; do
home=$(grep $a | /etc/passwd | awk -F: ' { print $6 } ')
maildirmake "$home"
chown -Rh $a:group $home/Maildir
done

0
 
arnoldCommented:
You have to configure the qmail rc file to deliver to Maildir not what you seem to be doing.

Which method did you follow to setup qmail on your system?
lifewithqmail.org is a good resource.

Are the users local or do you use virtualmailbox setup?

Could you discribe your setup?

This is a command line sript where you have to create a file list_of_users with the list of users.

Note the script is for /etc/passwd based users.

Please post the output from the qmail-send log so that I can see what the error is that leads to the delivery failure.  The issue might very well be permissions the Maildir must be 0700 (read/write/execute user only).
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
chandar_bhandariAuthor Commented:
Output o rc file
#!/bin/sh
# /var/qmail/rc : qmail startup script
# Using control/defaultdelivery (in our case will be ./Maildir/) as default message delivery.
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start "`cat /var/qmail/control/defaultdelivery`"

2)  I have installed qmail by the help of lifewithqmail (http://www.lifewithqmail.org/lwq.html#installation)  except courier-imap & courier-authlib (installed by RPM).
3) users are local.

4) permissions of Maildir
    drwx------ 6 user user 4096 Oct 20 15:00 Maildir

5) Smtp log

@400000004e9e7483136ad534 tcpserver: fatal: unable to figure out port number for smtp
@400000004e9e74831f571fec tcpserver: fatal: unable to figure out port number for smtp
@400000004e9e7484239c2854 tcpserver: fatal: unable to figure out port number for smtp
@400000004e9e74852a91b674 tcpserver: fatal: unable to figure out port number for smtp
@400000004e9e748634bbcb44 tcpserver: fatal: unable to figure out port number for smtp
@400000004e9e748739dea4d4 tcpserver: status: 0/20
0
 
arnoldCommented:
This is the wrong log.
This is an error because your run for qmail-smtpd is wrong. I.e. you might be using a variable that does not get set to any value.
What are the contents of our /var/qmail/control/deefaultdelivery?

Or are your issue is external email sending versus email delivery.

post the contents of the run file for qmail-smtpd and contents of any external files that are used in the file.
0
 
chandar_bhandariAuthor Commented:
Iam only talking about local delivery.

Content of  /var/qmail/control/defaultdelivery
./Maildir

Contents of the run file
#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`

if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
    echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
    echo /var/qmail/supervise/qmail-smtpd/run
    exit 1
fi

if [ ! -f /var/qmail/control/rcpthosts ]; then
    echo "No /var/qmail/control/rcpthosts!"
    echo "Refusing to start SMTP listener because it'll create an open relay"
    exit 1
fi

exec /usr/local/bin/softlimit -m 2000000 \
    /usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
D" \
        -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1



0
 
arnoldCommented:
change smtp to 25.
can you externally connect to your mail server after that change?

/usr/sbin/lsof -i:25

do you have iptables enabled, did you add a rule to allow incoming port 25 traffic?
/sbin/iptables -L
0
 
chandar_bhandariAuthor Commented:
change smtp to 25????

pl check the below command's log

cat /var/log/maillog | grep xyz.com
Oct 20 11:19:55 mailServer pop3d: LOGIN FAILED, user=a@xyz.com, ip=[::ffff:192.168.0.170]
Oct 20 11:45:44 mailServer pop3d: LOGIN FAILED, user=a@xyz.com, ip=[::ffff:192.168.0.170]
Oct 20 11:45:55 mailServer pop3d: LOGIN FAILED, user=a@xyz.com, ip=[::ffff:192.168.0.170]
Oct 20 11:47:21 mailServer pop3d: LOGIN FAILED, user=a@xyz.com, ip=[::ffff:192.168.0.170]

iptable is disabled.
0
 
arnoldCommented:
You are mixing log files.
Please provide information on questions asked.
Your SMTP log says that it can not determine port for SMTP which means/meant one thing.
The log does not reflect incoming connections.
You now posting a log entry from pop3d which is a mechanism to retrieve email stored on the system.
can you
"Items in quotes should not be typed into the session."
telnet mailserver 25
helo computername
"You should get a 2xx response"
mail from: <youremailaddress>
"You should get a 2xx response"
rcpt to: <youremailaddres>
"You should get a 2xx response"
data
"You should get a 3xx response where you will type the message which contains the header section and body of message separated by an empty line"
To: <youremailaddress>
From: <youremailaddress>
Subject: test

This is a test message
.
"Here you should receive a 2xx response that your message was accepted if you get anything else, please provide the complete session information"
quit
"You should get a 2xx response and connection close"
0
 
chandar_bhandariAuthor Commented:
yes i can telnet qmail...

[root@mailServer]# telnet 192.168.0.205 25
Trying 192.168.0.205...
Connected to mailserver (192.168.0.205).
Escape character is '^]'.
220 xyz.com ESMTP
mail from: a@xzy.com
250 ok
rcpt to : a@xyz.com
250 ok
data
354 go ahead
this is a test message
.
250 ok 1319189967 qp 4883
quit
221 xyz.com
Connection closed by foreign host.
0
 
arnoldCommented:
now look at the SMTP log

Where are you expecting the emails to come from?
Did you make changes to the MX DNS record for the domain?
Do you have a rule on the external firewall to allow port 25 requests to reach this server?
0
 
chandar_bhandariAuthor Commented:
As i told you, iam only talking about local mails. i can send and receive mails locally but after
changes in defaultdelivery setting Mailbox to Maildir, iam not able to send and receive mails.

and firewall is disable.

0
 
arnoldCommented:
What you telling me is insufficient for me to know what is going on on your system.

The default delivery change only affects how messages are delivered to the mailboxes.  The log entry you posted suggest that there are no incoming emails.

To know what is going on, I need to see the log entries related to the delivery process which is in /var/log/qmail not qmail-smtpd not qmail-pop3d.

I need to see what the error is which will tell you why the message is not being delivered.

./Maildir/ is what you have in the defautdelivery file after the change you restarted qmail-send and made sure it actually restarted??
http://lifewithqmail.org/lwq.html#start-qmail

0
 
chandar_bhandariAuthor Commented:
/var/log/qmail/current

@400000004ea25ccf23eb59c4 status: local 2/10 remote 0/20
@400000004ea25ccf242e3adc delivery 6: deferral: Unable_to_open_./Maildir:_is_a_directory._(#4.2.1)/
@400000004ea25ccf2570f024 status: local 1/10 remote 0/20
@400000004ea25cd01f24484c delivery 7: deferral: Unable_to_open_./Maildir:_is_a_directory._(#4.2.1)/
0
 
chandar_bhandariAuthor Commented:
i got the solution.i changed the defaultdelivery entry form ./Maildir to ./Maildir/

thanks for your support.
0
 
chandar_bhandariAuthor Commented:
Thanks a lot...
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now