Community

[SOLVED] Cannot send mails using local sendmail

Hi,

I’ve noticed another strange problem - I am unable to send messages from scripts using /opt/axigen/bin/sendmail.

When I send a message, it’ shows this error:
Jul 30 16:29:58 explorer sendmail-2206: Transaction aborted: cannot create a new mail in queue ‘/var/opt/axigen/queue’ (No such file or directory)
Jul 30 16:31:37 explorer sendmail-2408: Transaction aborted: cannot create a new mail in queue ‘/var/opt/axigen/queue’ (No such file or directory)
Jul 30 16:32:06 explorer sendmail-906: Transaction aborted: cannot create a new mail in queue ‘/var/opt/axigen/queue’ (No such file or directory)

But it is not true. /var/opt/axigen/queue exists:

ls -lah /var/opt/axigen/queue
drwxr-x— 1 axigen axigen 286 srp 10 2016 .
drwxr-xr-x 1 axigen axigen 754 čec 30 11:26 …
drwxr-x— 1 axigen axigen 0 čec 30 16:29 locals
-rw-r----- 1 axigen axigen 38 srp 10 2016 .mql_auth
drwxr-x— 1 axigen axigen 0 čec 30 15:56 0A
drwxr-x— 1 axigen axigen 0 čec 30 12:12 0B
drwxr-x— 1 axigen axigen 0 čec 30 11:56 0C
drwxr-x— 1 axigen axigen 0 čec 30 12:08 0D
drwxr-x— 1 axigen axigen 0 čec 29 09:40 0E
drwxr-x— 1 axigen axigen 0 čec 30 10:43 0F
drwxr-x— 1 axigen axigen 0 čec 29 07:39 00
drwxr-x— 1 axigen axigen 0 čec 30 13:38 01
drwxr-x— 1 axigen axigen 0 čec 30 11:04 02
drwxr-x— 1 axigen axigen 0 čec 30 12:09 03
drwxr-x— 1 axigen axigen 0 čec 30 12:08 04
drwxr-x— 1 axigen axigen 26 čec 30 16:29 05
drwxr-x— 1 axigen axigen 0 čec 30 16:21 06
drwxr-x— 1 axigen axigen 0 čec 30 15:22 07
drwxr-x— 1 axigen axigen 0 čec 30 11:56 08
drwxr-x— 1 axigen axigen 0 čec 30 12:11 09
drwxr-x— 1 axigen axigen 0 čec 30 14:10 1A
drwxr-x— 1 axigen axigen 0 čec 30 15:22 1B
drwxr-x— 1 axigen axigen 0 čec 30 15:55 1C
drwxr-x— 1 axigen axigen 0 čec 29 09:40 1D
drwxr-x— 1 axigen axigen 0 čec 30 11:33 1E
drwxr-x— 1 axigen axigen 0 čec 30 14:11 1F
drwxr-x— 1 axigen axigen 0 čec 30 13:39 10
drwxr-x— 1 axigen axigen 0 čec 30 16:21 11
drwxr-x— 1 axigen axigen 0 čec 30 16:21 12
drwxr-x— 1 axigen axigen 0 čec 30 12:08 13
drwxr-x— 1 axigen axigen 0 čec 30 16:04 14
drwxr-x— 1 axigen axigen 0 čec 27 12:10 15
drwxr-x— 1 axigen axigen 0 čec 29 16:47 16
drwxr-x— 1 axigen axigen 0 čec 30 12:08 17
drwxr-x— 1 axigen axigen 0 čec 30 16:21 18
drwxr-x— 1 axigen axigen 0 čec 29 09:40 19
drwxr-x— 1 axigen axigen 0 čec 30 15:09 2A
drwxr-x— 1 axigen axigen 0 čec 26 17:50 2B
drwxr-x— 1 axigen axigen 0 čec 30 14:11 2C
drwxr-x— 1 axigen axigen 0 čec 30 15:56 2D
drwxr-x— 1 axigen axigen 0 čec 30 15:52 2E
drwxr-x— 1 axigen axigen 0 čec 30 16:21 2F
drwxr-x— 1 axigen axigen 0 čec 30 15:21 20
drwxr-x— 1 axigen axigen 0 čec 30 16:21 21
drwxr-x— 1 axigen axigen 0 čec 30 12:08 22
drwxr-x— 1 axigen axigen 0 čec 30 11:23 23
drwxr-x— 1 axigen axigen 0 čec 30 15:44 24
drwxr-x— 1 axigen axigen 0 čec 29 09:40 25
drwxr-x— 1 axigen axigen 0 čec 30 13:39 26
drwxr-x— 1 axigen axigen 0 čec 30 15:21 27
drwxr-x— 1 axigen axigen 0 čec 30 13:17 28
drwxr-x— 1 axigen axigen 26 čec 30 16:20 29
drwxr-x— 1 axigen axigen 0 čec 30 12:09 3A
drwxr-x— 1 axigen axigen 0 čec 30 15:56 3B
drwxr-x— 1 axigen axigen 0 čec 27 16:47 3C
drwxr-x— 1 axigen axigen 0 čec 30 15:55 3D
drwxr-x— 1 axigen axigen 0 čec 29 12:45 3E
drwxr-x— 1 axigen axigen 0 čec 29 22:31 3F
drwxr-x— 1 axigen axigen 0 čec 30 14:55 30
drwxr-x— 1 axigen axigen 0 čec 29 09:40 31
drwxr-x— 1 axigen axigen 0 čec 30 11:22 32
drwxr-x— 1 axigen axigen 26 čec 30 16:18 33
drwxr-x— 1 axigen axigen 0 čec 27 08:49 34
drwxr-x— 1 axigen axigen 0 čec 30 11:32 35
drwxr-x— 1 axigen axigen 26 čec 30 16:21 36
drwxr-x— 1 axigen axigen 0 čec 30 11:32 37
drwxr-x— 1 axigen axigen 0 čec 30 16:21 38
drwxr-x— 1 axigen axigen 0 čec 30 15:56 39

ls -ld /var/opt/axigen/queue/
drwxr-x— 1 axigen axigen 286 srp 10 2016 /var/opt/axigen/queue/

Any ideas how to fix this?

It’s on Debian Buster

Hi,

just another observation. On old server where I migrated data from works OK.

Interesting thing is, there are different Axigen server versions aparrently (altough on old server Axigen admin interface was telling it’s latest version available). New server was fresh install from scratch - just copied /var/opt/axigen to transfer my data.

Old server has written everithing.txtlog file:
# created by AXIGEN version 10.3.0.66 (Linux/x64)

New server has this header in lof files:
# created by AXIGEN version 10.3.1.5 (Linux/x64)

So maybe some new bug or something?

Anyway, if I use telnet to ::1 25 and send whole message through here, it works.
So workarround which works for me is:
apt purge bsd-mailx
apt install mutt
echo ‘set smtp_url=“smtp://localhost”’ > /etc/Muttrc.d/smtp-server.rc

And then use mutt command instead mail / mailx in scripts. Works good (of course you must have some SPF exceptions in Acceptance & Routing rules).

Hi,
all required commands for installing sendmail are available in the attached file
to send mail you can use below command:

cat /result | mail -r root@$DomainName -s “$subject $(date +%F)” $emailAddress

replace the variables before send

**sendmail.txt (269 Bytes)

Oooooh. It works now! You showed me the right path :slight_smile:

I uninstalled mutt: apt remove mutt
Installed back mailx: apt install bsd-mailx

And then used your sorcerry:
chown axigen:axigen /opt/axigen/bin/sendmail
chmod 6755 /opt/axigen/bin/sendmail

Not sure why, but it works.
I did 755 permissions, because users outside of axigen group needs to send messages too.

Sorry to come so late at the table but here is our KB that described sendmail setup for Axigen:

https://www.axigen.com/knowledgebase/How-to-send-emails-using-the-sendmail-wrapper_35.html

HTH,
Ioan

Aparrently I am not good in googling. Thanks. That article also explains what I am doing with that 6750 permissions.

It seems that 6750 permissions are more secure, cause of those SUID and SGID. 6755 are for those who believes that axigen budled sendmail cannot be used for some evil purposes (I hope it is secured, but better be careful).