Installing software to enable local mail from the system


❯ mail -s "test" michel
To: michel
Subject: test

testing
^D

(Preliminary) Envelope contains:
To: michel
Subject: test
Send this message [yes/no, empty: recompose]? yes
❯ mail
mail: /var/spool/mail/michel: No such entry, file or directory
mail version v14.9.23. Type ?' for help (Currently no active mailbox) No more mail. mail: There are messages in the error ring, manageable via errors' command
? errors
1/1 /var/spool/mail/michel: No such entry, file or directory
2/1 There are messages in the error ring, manageable via `errors' command
?


Above is my attempt to test local emails on my fairly fresh install of Garuda. Obviously it fails on this new install of Garuda KDE Dragonified. This is my first attempt at moving to an arch distro and I am impressed, although, I took me a couple of days to set things up the way I needed. The only thing left to do is to implement this mailing issue.

I only need to be able to receive the messages from anacron. In fact I do not need to send messages or receive messages other than from my system. I have looked everywhere, I think, but I am a brand new user of arch, and I cannot find a what ought to be a relatively simple solution to this.

Any help or pointer about how to set this up, would be greatly appreciated.

Thanks

Hi there, welcome.
Maybe check if the Arch wiki can help here:
https://wiki.archlinux.org/title/Cron#Example_with_esmtp
Or just search elsewhere in that article or in the Wiki.

1 Like

Hello filo,

First of all, thank you for your time and help.

I did look at the link you gave before, but not in as much detail as I needed to! :slight_smile:

Looking at it again, I decided to use opnsmtpd as it was apparently the simplest solution that was very easy to config for local mail only. The instruction I found were very explicit.

Having installed opnsmtpd and setup the config file as follow:

table aliases file:/etc/smtpd/aliases

# To accept external mail, replace with: listen on all
#
listen on localhost

action "local" maildir alias <aliases>
action "relay" relay

# Uncomment the following to accept external mail for domain "example.org"
#
# match from any for domain "example.org" action "local"
match for local action "local"
match from local for any action "relay"

I enabled and started smtp using systemctl and it gave me an error:

Jan 10 12:50:29 eagle systemd[1]: Starting OpenSMTPD...
Jan 10 12:50:29 eagle smtpd[265371]: info: OpenSMTPD 6.8.0p2 starting
Jan 10 12:50:29 eagle systemd[1]: Started OpenSMTPD.
Jan 10 12:50:29 eagle smtpd[265376]: pony express: listen: Address already in use
Jan 10 12:50:29 eagle smtpd[265372]: smtpd: process pony socket closed
Jan 10 12:50:29 eagle systemd[1]: smtpd.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 12:50:29 eagle systemd[1]: smtpd.service: Failed with result 'exit-code'.

I have absolutely no idea about what pony express is and I cannot find info readily about it either! Again, it may be due to my lack of experience with arch.

I could not find it using octopi and could not find it through a google search first pages.

So I am at a loss about what to do next.

Having spent about 20 hours to convert my workstation to Garuda, it is the last thing I need to do to complete the task.

Thanks again for your time and help.

Sorry, I’m not expert at all on this stuff, anyway, as far as I can see, if you want:

You should comment these two lines

action "relay" relay
match from local for any action "relay"

and get something like the Arch wiki suggests:

listen on localhost
action "local" maildir alias <aliases>
match for local action "local"

Anyway, I’m not really sure this is the root cause of the service problem :frowning:
Maybe you could give a look at the troubleshooting section in the opensmtpd Arch Wiki, e.g. checking the journal.

I see pony.c is one of the files provided by the opensmtpd package.
I have no idea of what it does, but I guess it should stay there…

1 Like

Thanks again, filo.

I did exactly what you suggested in the smtpd.conf file and it made no difference.

I did look at the journalctl but it gives absolutely no more info.

Jan 10 17:35:49 eagle sudo[100502]: pam_systemd_home(sudo:account): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
Jan 10 17:35:49 eagle audit[100502]: USER_ACCT pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="michel" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/2 res=success'
Jan 10 17:35:49 eagle audit[100502]: CRED_REFR pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/2 res=success'
Jan 10 17:35:49 eagle sudo[100502]:   michel : TTY=pts/2 ; PWD=/home/michel ; USER=root ; COMMAND=/usr/bin/systemctl start smtpd
Jan 10 17:35:49 eagle kernel: audit: type=1101 audit(1641807349.106:201): pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="michel" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/p>
Jan 10 17:35:49 eagle kernel: audit: type=1110 audit(1641807349.106:202): pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? term>
Jan 10 17:35:49 eagle sudo[100502]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Jan 10 17:35:49 eagle audit[100502]: USER_START pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:session_open grantors=pam_systemd_home,pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/2 re>
Jan 10 17:35:49 eagle kernel: audit: type=1105 audit(1641807349.108:203): pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:session_open grantors=pam_systemd_home,pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? add>
Jan 10 17:35:49 eagle systemd[1]: Starting OpenSMTPD...
Jan 10 17:35:49 eagle smtpd[100505]: info: OpenSMTPD 6.8.0p2 starting
Jan 10 17:35:49 eagle systemd[1]: Started OpenSMTPD.
Jan 10 17:35:49 eagle audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=smtpd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jan 10 17:35:49 eagle kernel: audit: type=1130 audit(1641807349.118:204): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=smtpd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jan 10 17:35:49 eagle sudo[100502]: pam_unix(sudo:session): session closed for user root
Jan 10 17:35:49 eagle audit[100502]: USER_END pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:session_close grantors=pam_systemd_home,pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/2 res>
Jan 10 17:35:49 eagle audit[100502]: CRED_DISP pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/2 res=success'
Jan 10 17:35:49 eagle kernel: audit: type=1106 audit(1641807349.119:205): pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:session_close grantors=pam_systemd_home,pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? ad>
Jan 10 17:35:49 eagle kernel: audit: type=1104 audit(1641807349.119:206): pid=100502 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_env,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? term>
Jan 10 17:35:49 eagle smtpd[100510]: pony express: listen: Address already in use
Jan 10 17:35:49 eagle smtpd[100506]: smtpd: process pony socket closed
Jan 10 17:35:49 eagle systemd[1]: smtpd.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 17:35:49 eagle systemd[1]: smtpd.service: Failed with result 'exit-code'.
Jan 10 17:35:49 eagle audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=smtpd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jan 10 17:35:49 eagle kernel: audit: type=1131 audit(1641807349.125:207): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=smtpd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

Second search hit I found:

https://www.mail-archive.com/[email protected]/msg04749.html

Sounds like your issue^^^

Another one just after:

https://forums.gentoo.org/viewtopic-t-1117708-start-0.html

Edit:

Have you tried running:

systemctl restart opensmtpd

If that works you might want to add a start up delay such as sleep 3 in the systemd unit file. You could possibly be encountering a race condition if a restart of the service starts things working properly.

2 Likes

I think that is not the issue.

In the first link there are two listen directives in the conf file a generic one ("on all") and a more specific ones (a specific domain). I have only one ("listen on localhost").

The second link, I also checked, and whilst I have two entries (ip4) in the hosts file for the workstation, they are for 127.0.0.1 and 127.0.1.1. Also the first is for localhost, the second for a fully qualified hostname.

I will try to give a shot with an alternative to opensmtpd next, I think.

But I really do not get why it is so arduous. After all it is a very basic requirement, I would have thought. Never had any issues with previous distros although they were not arch based.

Thanks again for trying to help! :slight_smile:

I don't see much arch-related in this issue.
The Gentoo forum post linked to this OpenSMTPD - Issue - 1075 which is still open, although commented as solved in this Debian bug, which is not actually solved, but forwarded to this other till open OpenSMTPD - Issue - 1106.
Almost a circular reference. TL:DR - nobody seems to care much, but not really arch-related :frowning:

1 Like

Please respond to questions put to you.

2 Likes

OK, I thought it may have been my lack of experience with arch rather a problem specifically with arch.

That being said, I know some distros I used have local email installed as default which seems to be fairly basic requirement to m y use case at least.

But as I said, I will try some other way rather than opensmtpd and see if I have more success.

Hello tbg,

Thanks fro your suggestion, but unfortunately by the time I saw it I already had uninstalled opensmtpd.

Regardless I tried successive starting a number of times. I never tried restarting as the status was always showing it as not running.

Thanks again for your attention to this matter.

What distro specifically? I’d like to take a look at how they do it.

1 Like

Hello Zod,

Maybe I have not been expressing myself correctly. Sorry about that.

What I meant is that default installation of MTA/SMTP works out of the box on some distros. I am not a distro hopper. But this is the first time I have such an iissue with local mail setup. I am not sure what is the cause.

In the last ten years I have been using debian and derivatives (crunchbang and then BunsenLabs). Every so often, time permitting, I spin another distro on a VM to have a look at it, which is how I came across Garuda. Based on that experience, having looked a bit deeper at it on a VM and looking at availability of relevant software to my use case, I decided to give Garuda a try. I do re-install my workstation from scratch every 9 to 12 months (It had been 15 months this time). I do expect some pain, for a couple of months or so, as I am not familiar at all with arch or KDE (I have been using OpenBox and awesomeWM for the last ten years at least).

My next and last try will be to install Postfix, which I was trying to avoid because of its resources requirements and usage .

If this goes as expected I am ready for my next couple of months of pain, otherwise I will probably go back to what I know.

I think I finally got this issue solved.

I noticed that I had KMail installed and kmail has its own smtp which would explain the conflict.

So, I will now try to configure kmail and cron so that they work together as I expect.

Thanks very much for all help that I received. This is a very good forum and I am looking forward to enjoy Garuda after my initial "pain" period due to my inexperience with arch and kde.

Hopefully next time I will be able to install from the barebones edition with the experience I will have gained.

Thanks again to all that were forthcoming with help or helpful advice.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.