I am trying to develop a script which can be used to send emails from my home computer. I don't need to receive any mails just send it.
Right now I am sending emails from my home computer which is on my home LAN (Standard ISP Modem->Router Configuration) using the following command:
Code:
#!/bin/bash
echo "Sending mail through mail..."
echo "Sending Test Email" | mail -s "Hello" testing@test.com
echo "Mail sent"
The mail gets send perfectly fine to any email account (yahoo, hotmail, etc). Here I am using
sendmail as the MTA and everything works fine without configuring anything.
However, by default if one tries to install the mailx package (bsd-mailx),
Exim4 gets installed as the default MTA instead of sendmail.
Code:
debian-workstation:~# apt-get install mailx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
bsd-mailx exim4 exim4-base exim4-config exim4-daemon-light liblockfile1
psmisc
Suggested packages:
mail-reader eximon4 exim4-doc-html exim4-doc-info gnutls-bin openssl
libmail-spf-query-perl swaks
The following NEW packages will be installed:
bsd-mailx exim4 exim4-base exim4-config exim4-daemon-light liblockfile1
mailx psmisc
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 2035kB of archives.
After this operation, 4690kB of additional disk space will be used.
Do you want to continue [Y/n]?
However if use my above script to send emails using exim4 as the MTA the mail does not get sent.
I have tried configuring exim4 using the command:
Code:
dpkg-reconfigure exim4-config
but I get lost in the confusing questions that it asks regarding SMTP, smarthost, configuration
I would like to know how can I send emails using exim4 since it is the default one.
As far as I understand exim4 and sendmail are both MTA and they conflict (naturally) with each other if you try to install any one of them.