tag:blogger.com,1999:blog-269688189640615970.post2755448311009345121..comments2022-03-27T09:17:01.536+05:30Comments on IndiMail: Using Docker Engine to Run IndiMail / IndiMail-MTAcprogrammerhttp://www.blogger.com/profile/08835060559515671947noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-269688189640615970.post-91417756228732275282022-03-04T09:00:58.864+05:302022-03-04T09:00:58.864+05:30You can use imap / imaps / pop3 / pop3s to check m...You can use imap / imaps / pop3 / pop3s to check mails receivedcprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-13090400326880033072022-03-03T14:25:47.198+05:302022-03-03T14:25:47.198+05:30OK made it! Thank you so much man you saved me rea...OK made it! Thank you so much man you saved me really! <br />Just a less important follow-up question: do you also have an idea how to check the msg/mail received?Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-17018326909280878612022-02-28T23:17:24.894+05:302022-02-28T23:17:24.894+05:30and also don't forget to add an entry in /etc/...and also don't forget to add an entry in /etc/indimail/tcp/tcp.qmtp of 172.17.0.1 the IP address of the docker host. If you change tcp.qmtp, you have to re-generate the cdb file by using the command<br /><br /># qmailctl cdbcprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-53571926349314635462022-02-28T23:14:46.637+05:302022-02-28T23:14:46.637+05:30Yes. Correct. As long as the IP 172.17.0.1 is reac...Yes. Correct. As long as the IP 172.17.0.1 is reachable from the docker container.cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-57534006100593531462022-02-28T22:59:44.769+05:302022-02-28T22:59:44.769+05:30Thank you for the reply but that's not what I ...Thank you for the reply but that's not what I need actually.<br />For me capturing pkt is fine, but generating pkts is the problem. If I have another indimail host(e.g. with IP 172.17.0.1), in my qmtproutes file I shall add an entry like indimail.org:172.17.0.1:209 in order to send mails, correct?Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-66508507795654941012022-02-28T22:38:06.344+05:302022-02-28T22:38:06.344+05:30This also works. You don't require the stack o...This also works. You don't require the stack overflow solution<br /><br />on the container install tcpdump using apt-get, yum, dnf<br /><br />and run<br />tcpdump -vvv -i any tcp port 209<br />cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-37907881816277631132022-02-28T22:33:31.332+05:302022-02-28T22:33:31.332+05:30I tried the stack overflow. This is what i did
On...I tried the stack overflow. This is what i did<br /><br />On terminal 1<br /># docker run -d -h indimail.org --privileged --name svscan a02e6014a67b<br /># docker run -it --rm --net container:svscan nicolaka/netshoot tcpdump -vvv -i any 'tcp port 209'<br /><br />Now on another terminal<br /># docker exec -ti svscan bash<br /><br />Now you are connected to the container. Run the command<br /># telnet 0 209<br /><br />Now on terminal 1 you should see<br />docker run -it --rm --net container:svscan nicolaka/netshoot tcpdump -vvv -i any 'tcp port 209'<br />tcpdump: data link type LINUX_SLL2<br />tcpdump: listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes<br />17:00:10.143242 lo In IP (tos 0x10, ttl 64, id 36699, offset 0, flags [DF], proto TCP (6), length 60)<br /> localhost.41668 > localhost.209: Flags [S], cksum 0xfe30 (incorrect -> 0xf8f9), seq 3590271574, win 65495, options [mss 65495,sackOK,TS val 1436964214 ecr 0,nop,wscale 7], length 0<br />17:00:10.143265 lo In IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)<br /> localhost.209 > localhost.41668: Flags [S.], cksum 0xfe30 (incorrect -> 0x35d3), seq 4120126064, ack 3590271575, win 65483, options [mss 65495,sackOK,TS val 1436964214 ecr 1436964214,nop,wscale 7], length 0<br />17:00:10.143289 lo In IP (tos 0x10, ttl 64, id 36700, offset 0, flags [DF], proto TCP (6), length 52)<br /> localhost.41668 > localhost.209: Flags [.], cksum 0xfe28 (incorrect -> 0x5c8f), seq 1, ack 1, win 512, options [nop,nop,TS val 1436964214 ecr 1436964214], length 0<br />17:00:10.144615 lo In IP (tos 0x0, ttl 64, id 28374, offset 0, flags [DF], proto TCP (6), length 52)<br /> localhost.209 > localhost.41668: Flags [F.], cksum 0xfe28 (incorrect -> 0x5c8c), seq 1, ack 1, win 512, options [nop,nop,TS val 1436964216 ecr 1436964214], length 0<br />17:00:10.144709 lo In IP (tos 0x10, ttl 64, id 36701, offset 0, flags [DF], proto TCP (6), length 52)<br /> localhost.41668 > localhost.209: Flags [F.], cksum 0xfe28 (incorrect -> 0x5c89), seq 1, ack 2, win 512, options [nop,nop,TS val 1436964216 ecr 1436964216], length 0<br />17:00:10.144748 lo In IP (tos 0x0, ttl 64, id 28375, offset 0, flags [DF], proto TCP (6), length 52)<br /> localhost.209 > localhost.41668: Flags [.], cksum 0xfe28 (incorrect -> 0x5c89), seq 2, ack 2, win 512, options [nop,nop,TS val 1436964216 ecr 1436964216], length 0<br />^C<br />6 packets captured<br />12 packets received by filter<br />0 packets dropped by kernel<br /><br />cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-23802125482526384912022-02-28T21:43:25.940+05:302022-02-28T21:43:25.940+05:30Ok. You are using docker and not podman. I don'...Ok. You are using docker and not podman. I don't have much idea of how networking works in containers. But this is what I found<br /><br />https://stackoverflow.com/questions/39362730/how-to-capture-packets-for-single-docker-containercprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-88286258280280797002022-02-28T21:37:50.079+05:302022-02-28T21:37:50.079+05:301. I'm running docker image for ubuntu focal;
...1. I'm running docker image for ubuntu focal;<br />2. I use this one to start the container:<br />docker run -d -h indimail.org --privileged a02e6014a67b /sbin/initAnonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-37619289466343791122022-02-28T21:02:51.486+05:302022-02-28T21:02:51.486+05:301. Are you running podman or docker?
2. What is th...1. Are you running podman or docker?<br />2. What is the exact docker or podman comand you have used to start the container?cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-89092166674530364552022-02-28T20:07:54.863+05:302022-02-28T20:07:54.863+05:30Perfect that works!
indimail.org:(root) /etc/indi...Perfect that works!<br /><br />indimail.org:(root) /etc/indimail/control >echo test|qmail-remote indimail.org root@indimail.org "" 44 root@indimail.org<br />rRemote host said: ok 1646052430 qp 1275<br />K127.0.0.1 accepted message - Protocol QMTP<br /><br />So in order to send mail to another host(preferably to another indimail host supporting qmtp like this one) how should I set up the environment? Any idea?<br /><br />Ps: my purpose is to be able to capture qmtp traffic with tcpdump/wireshark. Since sending mail to the server itself doesn't generate traffic passing eth interface, that's why I'm thinking to create another docker image of indimail and make them send mails. If you have other better ideas pls let me know. Thank you!Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-8111229489497532472022-02-28T18:03:48.437+05:302022-02-28T18:03:48.437+05:30also the qmtproutes file should be
indimail.org:1...also the qmtproutes file should be<br /><br />indimail.org:127.0.0.1:209cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-34702488909625043892022-02-28T18:02:54.646+05:302022-02-28T18:02:54.646+05:30You are getting error because you are trying qmtp ...You are getting error because you are trying qmtp with a SMTP server. QMTP protocol is served by qmail-qmtpd on port 209. By default the docker installation has QMTP disabled. But you can enable it. You have to run the below command only once<br /><br />1. rm /service/qmail-qmtpd.209/down - This will allow qmail-qmtpd to be started on every reboot<br />2. svc -u /service/qmail-qmtpd.209 - This is required only first time after deleting the above file<br /><br />Now if you try sending the mail, it will still fail because of access list.<br />So you have to edit the file /etc/indimail/tcp/tcp.qmtp and add the line in the first line of the file<br />127.:allow<br /><br />After you add the above line, you have to rebuild the cdb by executing the command<br /><br /># qmailctl cdb<br /><br />First do the above, then we will talk about the rest.<br />cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-73724343066770147112022-02-28T15:02:39.317+05:302022-02-28T15:02:39.317+05:30Thank you again for the solution here! Appreciate ...Thank you again for the solution here! Appreciate it really a lot!<br /><br />Then if I may I have 2 more questions regarding solving my problems for meeting my expectation:<br />1. As I mentioned I need to be able to send mails via QMTP.Creating a qmtproutes file with <br /><br />indimail.org:127.0.0.1:25<br /><br />doesn't allow a qmtp communication since running <br />echo test|qmail-remote indimail.org root@indimail.org "" 44 root@indimail.org<br />I got the error msg "Zrecipient did not talk proper QMTP (#4.3.0)"<br /><br />2. An extension of question 1: my final purpose would be sending a qmtp mail to another server. I was thinking to create 2 the above docker images in 2 virtual machines. So in this case do you know how can I set up the environment (the domains and the routes etc)<br /><br />Thank you!Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-4776147307792838162022-02-26T06:31:10.018+05:302022-02-26T06:31:10.018+05:30Just do the following
echo "something.indima...Just do the following<br /><br />echo "something.indimail.org" > /etc/indimail/control/helohost<br /><br />That will solve your issue of using indimail.org on 127.0.0.1<br /><br /><br />indimail.org:(root) / >echo test|qmail-remote indimail.org root@indimail.org "" 44 root@indimail.org<br />DConnected to 127.0.0.1 but sender was rejected.<br />Remote host said: 503 Polite people say hello first (#5.5.4)<br />indimail.org:(root) / >echo apollo.indimail.org > /etc/indimail/control/helohost<br />indimail.org:(root) / >echo test|qmail-remote indimail.org root@indimail.org "" 44 root@indimail.org<br />rFrom: RCPT: K127.0.0.1 accepted message - Protocol SMTP.<br />Remote host said: 250 ok 1645837203 qp 1026cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-79986728736432978372022-02-25T21:46:08.612+05:302022-02-25T21:46:08.612+05:30Here it is:
indimail.org:(root) / >hostname
in...Here it is:<br /><b> indimail.org:(root) / >hostname<br />indimail.org<br />indimail.org:(root) / >uname -a<br />Linux indimail.org 5.14.8 #1 SMP Mon Sep 27 11:39:33 CEST 2021 x86_64 x86_64 x86_64 GNU/Linux<br />indimail.org:(root) / >ls -l /service/qmail-smtpd.25/variables/BADHELO*<br />-rw-r--r-- 1 root root 0 Sep 12 14:11 /service/qmail-smtpd.25/variables/BADHELOCHECK </b>Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-87419052181874243632022-02-25T21:32:24.070+05:302022-02-25T21:32:24.070+05:30Also check the smtp log /var/log/svc/smtpd.25/curr...Also check the smtp log /var/log/svc/smtpd.25/current<br /><br />ls -l /service/qmail-smtpd.25/variables/BADHELO*cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-23290837846289931232022-02-25T21:25:42.197+05:302022-02-25T21:25:42.197+05:30You can run the command
uname -n
or
hostname
The...You can run the command <br />uname -n<br />or<br />hostname<br /><br />The hostname depends on the podman or the docker command you used. What is the exact command you used to start the image?cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-30372533466048930042022-02-25T21:10:22.519+05:302022-02-25T21:10:22.519+05:30I haven't set any hostname. What I've done...I haven't set any hostname. What I've done is install this docker image, and then created a smtproutes file as you indicated before. I think the default host name is exactly indimail.org in this image isn't it? <br />Anyway what I'm trying to do is to send a mail from this docker image in SMTP/QMTP, and that brings us to my initial question: what is the procedure I shall follow in order to that based on this docker image? Do I need firstly to create a host different from indimail, and then what? Any idea?<br /><br />Thank you!Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-35867006561587164242022-02-25T20:25:05.741+05:302022-02-25T20:25:05.741+05:30"DConnected to 127.0.0.1 but sender was rejec..."DConnected to 127.0.0.1 but sender was rejected. Remote host said: 503 Polite people say hello first (#5.5.4)"."<br /><br />This is an error from qmail-stmpd. What is the hostname that you have set?<br />cprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-15184882820391949292022-02-25T14:37:23.270+05:302022-02-25T14:37:23.270+05:30Hello! Again thanks for the guide.
And again I fa...Hello! Again thanks for the guide.<br /><br />And again I failed to send mail from root@indimail.org to root@indimail.org with the error msg "DConnected to 127.0.0.1 but sender was rejected. Remote host said: 503 Polite people say hello first (#5.5.4)". <br /><br />So basically in order to send mails I need set routes in smtproutes/qmtproutes, in the format of "indimail.org:127.0.0.1:25" in smtproutes and "indimail.org:127.0.0.1:209" in qmtproutes, correct? And precisely how can I set them if I want to send mail to myself(root@indimail.org) or to gmail?<br /><br />Thank you!Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-47601341736727987682022-02-25T00:10:27.826+05:302022-02-25T00:10:27.826+05:30That is because indimail.org is my domain and the ...That is because indimail.org is my domain and the mx record will be used. But you can create an artificial route in /etc/indimail/control/smtproutes<br /><br />indimail.org:127.0.0.1:25<br /><br />If you have this, qmail-remote will connect to 127.0.0.1 for indimail.orgcprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-14538394126421109962022-02-24T20:48:35.685+05:302022-02-24T20:48:35.685+05:30OK thank you again for the reply.
And again a pro...OK thank you again for the reply.<br /><br />And again a problem is I can't even send msg to myself with comand <br /><b> /usr/sbin/qmail-remote indimail.org root@indimail.org "" 55 root@indimail.org < /tmp/mail.txt </b><br />cuz the error "ZSorry, I wasn't able to establish a SMTP connection for indimail.org to...". <br />I assume it was because I don't have any MX records do I? I don't quite understand this post https://cr.yp.to/im/mxps.html. Do you how could I have the records, or saying how can I at least send msg to myself?<br /><br />Thank you!Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-45011962034973219352022-02-24T18:31:35.510+05:302022-02-24T18:31:35.510+05:30indimail has almost everyting of qmail modified. L...indimail has almost everyting of qmail modified. Let us say your message file is /tmp/mail.txt. Let us say the file size of /tmp/mail.txt is 55 butes. To use qmail-remote<br /><br />/usr/sbin/qmail-remote gmail.com root@yourdomain "" 55 user@gmail.com < /tmp/mail.txt<br /><br />The syntax for qmail-remote is<br />qmail-remote domain sender QQEH size recipient<br /><br />Where QQEH is a string of extra headers to be inserted in the email. It can be an empty stringcprogrammerhttps://www.blogger.com/profile/08835060559515671947noreply@blogger.comtag:blogger.com,1999:blog-269688189640615970.post-88032404367138049982022-02-24T17:27:45.509+05:302022-02-24T17:27:45.509+05:30Hi @cprogrammer thank you for the kind reply!
How...Hi @cprogrammer thank you for the kind reply!<br /><br />However I still have difficulties understanding everthing. For example the synopsis for sending mail with qmail-remote is <b> qmail-remote host sender recip </b> right? If I want to send a mail/msg from this docker container to user@gmail.com, the command I use is <br /><b> qmail-remote gmail.com root@indimail.org user@gmail.com </b><br />And I got this error msg: DI (qmail-remote) was invoked improperly. (#5.3.5)<br /><br />Do you have any idea about this? Thank you!Anonymoushttps://www.blogger.com/profile/02199970348195779645noreply@blogger.com