[GH-ISSUE #1152] Issue with emailfrom #903

Closed
opened 2026-02-27 02:54:13 +03:00 by kerem · 24 comments
Owner

Originally created by @Technoblazed on GitHub (Oct 24, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1152

I've been using LGSM for a while as well as the newly introduced emailfrom without any issues, however over the last few days I've been getting an error when sending emails with the emailfrom field.

csgo@ca-dedi:~/surf-testing$ ./csgoserver test-alert
[ .... ] Alert csgo-server: Sending alert: mypersonalemail@gmail.com From: test@mysendingdomain.ext: No such file or directory
[ FAIL ] Alert csgo-server: Sending alert: mypersonalemail@gmail.com
[ WARN ] Alert csgo-server: Pushbullet alerts not enabled
csgo@ca-dedi:~/surf-testing$

I've tried finding what's causing the issue, but have no idea. Any clues?

EDIT: Also, it is not mail server related, it works fine without the emailfrom variable set.

Originally created by @Technoblazed on GitHub (Oct 24, 2016). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1152 I've been using LGSM for a while as well as the newly introduced emailfrom without any issues, however over the last few days I've been getting an error when sending emails with the emailfrom field. ``` csgo@ca-dedi:~/surf-testing$ ./csgoserver test-alert [ .... ] Alert csgo-server: Sending alert: mypersonalemail@gmail.com From: test@mysendingdomain.ext: No such file or directory [ FAIL ] Alert csgo-server: Sending alert: mypersonalemail@gmail.com [ WARN ] Alert csgo-server: Pushbullet alerts not enabled csgo@ca-dedi:~/surf-testing$ ``` I've tried finding what's causing the issue, but have no idea. Any clues? EDIT: Also, it is not mail server related, it works fine without the emailfrom variable set.
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

Having looked into this further, Line 234 in alert_email.sh currently reads:

mail -s "${alertsubject}" -a "From: ${emailfrom}" "${email}" < "${emaillog}"

-a is no longer the correct method for my OS - Ubuntu 16.10. This -a is used for attachments. Not sure if this is the same on other distros, but the correct format should now be:

mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${emaillog}"

Where -r is the from address.

<!-- gh-comment-id:255735440 --> @Technoblazed commented on GitHub (Oct 24, 2016): Having looked into this further, Line 234 in alert_email.sh currently reads: ``` mail -s "${alertsubject}" -a "From: ${emailfrom}" "${email}" < "${emaillog}" ``` `-a` is no longer the correct method for my OS - Ubuntu 16.10. This `-a` is used for attachments. Not sure if this is the same on other distros, but the correct format should now be: ``` mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${emaillog}" ``` Where `-r` is the from address.
Author
Owner

@UltimateByte commented on GitHub (Oct 24, 2016):

Hi,
Thanks for reporting.

Here is my --help output on Debian.
http://hastebin.com/subizucezo.sql

Can you please post yours on Ubuntu 16.04 ?

<!-- gh-comment-id:255736588 --> @UltimateByte commented on GitHub (Oct 24, 2016): Hi, Thanks for reporting. Here is my --help output on Debian. http://hastebin.com/subizucezo.sql Can you please post yours on Ubuntu 16.04 ?
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

csgo@ca-dedi:~$ mail --help
 Synopsis:
  mail -h | --help
  mail [-BDdEFintv~] [-A account]
         [-a attachment] [-b bcc-address] [-c cc-address]
         [-q file] [-r from-address] [-S var[=value]...]
         [-s subject] [-X cmd] [-.] to-address... [-- mta-option...]
  mail [-BDdEeHiNnRv~#] [-A account]
         [-L spec-list] [-r from-address] [-S var[=value]...]
         [-X cmd] -f [file] [-- mta-option...]
  mail [-BDdEeHiNnRv~#] [-A account]
         [-L spec-list] [-r from-address] [-S var[=value]...]
         [-u user] [-X cmd] [-- mta-option...]
csgo@ca-dedi:~$

EDIT: Correction, I'm on Ubuntu 16.10. Recently upgraded and forgot.

<!-- gh-comment-id:255736779 --> @Technoblazed commented on GitHub (Oct 24, 2016): ``` csgo@ca-dedi:~$ mail --help Synopsis: mail -h | --help mail [-BDdEFintv~] [-A account] [-a attachment] [-b bcc-address] [-c cc-address] [-q file] [-r from-address] [-S var[=value]...] [-s subject] [-X cmd] [-.] to-address... [-- mta-option...] mail [-BDdEeHiNnRv~#] [-A account] [-L spec-list] [-r from-address] [-S var[=value]...] [-X cmd] -f [file] [-- mta-option...] mail [-BDdEeHiNnRv~#] [-A account] [-L spec-list] [-r from-address] [-S var[=value]...] [-u user] [-X cmd] [-- mta-option...] csgo@ca-dedi:~$ ``` EDIT: Correction, I'm on Ubuntu 16.10. Recently upgraded and forgot.
Author
Owner

@UltimateByte commented on GitHub (Oct 24, 2016):

Ubuntu... Come on !

Can you please post the output of dpkg-query -l '*' | grep mail so that i can see what mail senders you got ?

<!-- gh-comment-id:255737343 --> @UltimateByte commented on GitHub (Oct 24, 2016): Ubuntu... Come on ! Can you please post the output of `dpkg-query -l '*' | grep mail` so that i can see what mail senders you got ?
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

http://hastebin.com/ocezowayeq.swift

<!-- gh-comment-id:255737485 --> @Technoblazed commented on GitHub (Oct 24, 2016): http://hastebin.com/ocezowayeq.swift
Author
Owner

@UltimateByte commented on GitHub (Oct 24, 2016):

You're pretty fast. :)
Here is mine on Debian 8 for comparison.
http://hastebin.com/wufuyirawa.swift

Maybe install mailx ?

<!-- gh-comment-id:255737872 --> @UltimateByte commented on GitHub (Oct 24, 2016): You're pretty fast. :) Here is mine on Debian 8 for comparison. http://hastebin.com/wufuyirawa.swift Maybe install mailx ?
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

I already have mailx ._.

<!-- gh-comment-id:255738260 --> @Technoblazed commented on GitHub (Oct 24, 2016): I already have mailx ._.
Author
Owner

@UltimateByte commented on GitHub (Oct 24, 2016):

I'm not sure, emails are still kinda mystic to me, just trying to see if it's a user issue rather than GSM/Distro one. @dgibbs64 @cedarlug might know more than i do about it. :)
Seems to me like mailx isn't installed:
un mailx <none> <none> (no description available)

-rwouldn't work on Debian though, so a more universal solution would be great.
Gotta go, catch you later on that (in 5-6 hours or so).

<!-- gh-comment-id:255738720 --> @UltimateByte commented on GitHub (Oct 24, 2016): I'm not sure, emails are still kinda mystic to me, just trying to see if it's a user issue rather than GSM/Distro one. @dgibbs64 @cedarlug might know more than i do about it. :) Seems to me like mailx isn't installed: `un mailx <none> <none> (no description available)` `-r`wouldn't work on Debian though, so a more universal solution would be great. Gotta go, catch you later on that (in 5-6 hours or so).
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

mailx available at /usr/bin/mailx

And later :D

<!-- gh-comment-id:255739080 --> @Technoblazed commented on GitHub (Oct 24, 2016): ``` mailx available at /usr/bin/mailx ``` And later :D
Author
Owner

@UltimateByte commented on GitHub (Oct 24, 2016):

Ubuntu... Brrrr ! I guess i'm becoming a Debian elitist !
Feel free to try stuff other than -r, you got my Debian --help output, if we cannot find a solution, we're gonna have to use a conditional check to send the mail :) Cya !

<!-- gh-comment-id:255739414 --> @UltimateByte commented on GitHub (Oct 24, 2016): Ubuntu... Brrrr ! I guess i'm becoming a Debian elitist ! Feel free to try stuff other than -r, you got my Debian --help output, if we cannot find a solution, we're gonna have to use a conditional check to send the mail :) Cya !
Author
Owner

@cedarlug commented on GitHub (Oct 24, 2016):

Could you both (@UltimateByte & @Technoblazed) post the results of:

which sendmail
ls -l $(which sendmail)
readlink -f $(which sendmail)
grep $(readlink -f $(which sendmail) ) /var/lib/dpkg/info/*.list

In almost every distribution, the real mail program is a symlink to sendmail. And when invoked as sendmail, adheres to the sendmail syntax regardless of what it really is (exim4, mailx, ...).

My take would be that if you convert the mail command to the sendmail equivalent and invoke sendmail to send your message, it will work on almost every platform.

<!-- gh-comment-id:255898362 --> @cedarlug commented on GitHub (Oct 24, 2016): Could you both (@UltimateByte & @Technoblazed) post the results of: ``` bash which sendmail ls -l $(which sendmail) readlink -f $(which sendmail) grep $(readlink -f $(which sendmail) ) /var/lib/dpkg/info/*.list ``` In almost every distribution, the real mail program is a symlink to sendmail. And when invoked as sendmail, adheres to the sendmail syntax regardless of what it really is (exim4, mailx, ...). My take would be that if you convert the mail command to the sendmail equivalent and invoke sendmail to send your message, it will work on almost every platform.
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

readlink -f $(which sendmail) was incorrect, following output below:

csgo@ca-dedi:~$ which sendmail
csgo@ca-dedi:~$ ls -l $(which sendmail)
total 16
-rw-r--r-- 1 csgo csgo 5451 Oct 24 14:33 maps.txt
drwxrwxr-x 8 csgo csgo 4096 Oct 24 15:21 Steam
drwxrwxr-x 6 csgo csgo 4096 Oct 24 15:13 surf-testing
csgo@ca-dedi:~$ readlink -f $which sendmail
/home/drive-2/csgo/sendmail
csgo@ca-dedi:~$ grep $(readlink -f $which sendmail ) /var/lib/dpkg/info/*.list
csgo@ca-dedi:~$
<!-- gh-comment-id:255898878 --> @Technoblazed commented on GitHub (Oct 24, 2016): `readlink -f $(which sendmail)` was incorrect, following output below: ``` csgo@ca-dedi:~$ which sendmail csgo@ca-dedi:~$ ls -l $(which sendmail) total 16 -rw-r--r-- 1 csgo csgo 5451 Oct 24 14:33 maps.txt drwxrwxr-x 8 csgo csgo 4096 Oct 24 15:21 Steam drwxrwxr-x 6 csgo csgo 4096 Oct 24 15:13 surf-testing csgo@ca-dedi:~$ readlink -f $which sendmail /home/drive-2/csgo/sendmail csgo@ca-dedi:~$ grep $(readlink -f $which sendmail ) /var/lib/dpkg/info/*.list csgo@ca-dedi:~$ ```
Author
Owner

@cedarlug commented on GitHub (Oct 24, 2016):

There goes my theory.

<!-- gh-comment-id:255899072 --> @cedarlug commented on GitHub (Oct 24, 2016): There goes my theory.
Author
Owner

@Technoblazed commented on GitHub (Oct 24, 2016):

I know it works on 16.04 using the current method. Something must have changed in 16.10 though :/

<!-- gh-comment-id:255899223 --> @Technoblazed commented on GitHub (Oct 24, 2016): I know it works on 16.04 using the current method. Something must have changed in 16.10 though :/
Author
Owner

@UltimateByte commented on GitHub (Oct 25, 2016):

@cedarlug

csgoserver@webserver:~$ which sendmail
csgoserver@webserver:~$ ls -l $(which sendmail)
total 52
-rwxr-xr-x 1 csgoserver csgoserver 5174 Oct 24 01:16 csgo-classic-casu
-rwxr-xr-x 1 csgoserver csgoserver 5188 Oct  7 03:21 csgo-competitive
-rwxr-xr-x 1 csgoserver csgoserver 5191 Oct  7 03:23 csgo-deathmatch
-rwxr-xr-x 1 csgoserver csgoserver 5193 Oct  7 03:23 csgo-demolition
drwxr-xr-x 4 csgoserver csgoserver 4096 Oct 24 00:46 lgsm
drwxr-xr-x 4 csgoserver csgoserver 4096 Oct  7 00:56 log
drwxr-xr-x 7 csgoserver csgoserver 4096 Oct  7 15:20 serverfiles
drwxr-xr-x 8 csgoserver csgoserver 4096 Oct 25 02:01 Steam
drwxr-xr-x 5 csgoserver csgoserver 4096 Oct 25 02:00 steamcmd
csgoserver@webserver:~$ readlink -f $(which sendmail)
readlink: missing operand
Try 'readlink --help' for more information.
csgoserver@webserver:~$ readlink -f $which sendmail
/home/csgoserver/sendmail
csgoserver@webserver:~$ grep $(readlink -f $(which sendmail) ) /var/lib/dpkg/info/*.list
readlink: missing operand
Try 'readlink --help' for more information.
<!-- gh-comment-id:255901241 --> @UltimateByte commented on GitHub (Oct 25, 2016): @cedarlug ``` csgoserver@webserver:~$ which sendmail csgoserver@webserver:~$ ls -l $(which sendmail) total 52 -rwxr-xr-x 1 csgoserver csgoserver 5174 Oct 24 01:16 csgo-classic-casu -rwxr-xr-x 1 csgoserver csgoserver 5188 Oct 7 03:21 csgo-competitive -rwxr-xr-x 1 csgoserver csgoserver 5191 Oct 7 03:23 csgo-deathmatch -rwxr-xr-x 1 csgoserver csgoserver 5193 Oct 7 03:23 csgo-demolition drwxr-xr-x 4 csgoserver csgoserver 4096 Oct 24 00:46 lgsm drwxr-xr-x 4 csgoserver csgoserver 4096 Oct 7 00:56 log drwxr-xr-x 7 csgoserver csgoserver 4096 Oct 7 15:20 serverfiles drwxr-xr-x 8 csgoserver csgoserver 4096 Oct 25 02:01 Steam drwxr-xr-x 5 csgoserver csgoserver 4096 Oct 25 02:00 steamcmd csgoserver@webserver:~$ readlink -f $(which sendmail) readlink: missing operand Try 'readlink --help' for more information. csgoserver@webserver:~$ readlink -f $which sendmail /home/csgoserver/sendmail csgoserver@webserver:~$ grep $(readlink -f $(which sendmail) ) /var/lib/dpkg/info/*.list readlink: missing operand Try 'readlink --help' for more information. ```
Author
Owner

@UltimateByte commented on GitHub (Oct 27, 2016):

So any key to make this more universal ?

<!-- gh-comment-id:256797346 --> @UltimateByte commented on GitHub (Oct 27, 2016): So any key to make this more universal ?
Author
Owner

@JimTR commented on GitHub (Oct 29, 2016):

the command (ran from the base directory e.g cd /) as root only returns -
root@vps99696888:/# ls -l $(which sendmail) -rwxr-xr-x 1 root root 26648 Apr 13 2016 /usr/sbin/sendmail root@vps99696888:/#

the read link command also returns the same, just wondering how you manage to get 52 results back ?

<!-- gh-comment-id:257099853 --> @JimTR commented on GitHub (Oct 29, 2016): the command (ran from the base directory e.g cd /) as root only returns - `root@vps99696888:/# ls -l $(which sendmail) -rwxr-xr-x 1 root root 26648 Apr 13 2016 /usr/sbin/sendmail root@vps99696888:/#` the read link command also returns the same, just wondering how you manage to get 52 results back ?
Author
Owner

@Technoblazed commented on GitHub (Oct 29, 2016):

@JimTR We ran in game directories, not root.

<!-- gh-comment-id:257100569 --> @Technoblazed commented on GitHub (Oct 29, 2016): @JimTR We ran in game directories, not root.
Author
Owner

@JimTR commented on GitHub (Oct 29, 2016):

Ok I don't understand I have also ran the same command as a user same result ... I am wondering why you have so many entries ?

<!-- gh-comment-id:257101086 --> @JimTR commented on GitHub (Oct 29, 2016): Ok I don't understand I have also ran the same command as a user same result ... I am wondering why you have so many entries ?
Author
Owner

@Technoblazed commented on GitHub (Oct 29, 2016):

Not certain, but it's irrelevant none the less.

EDIT: Total is just the amount of file system blocks present under that user.

<!-- gh-comment-id:257101137 --> @Technoblazed commented on GitHub (Oct 29, 2016): Not certain, but it's irrelevant none the less. EDIT: Total is just the amount of file system blocks present under that user.
Author
Owner

@cedarlug commented on GitHub (Oct 30, 2016):

@JimTR Their results are just the directory entries, because $(which sendmail) returns empty. As a result, they're just getting the output of ls -lfor the current directly.

A system lacking a symlink to sendmail wasn't at all what I expected for a modern Linux deployment.

<!-- gh-comment-id:257123677 --> @cedarlug commented on GitHub (Oct 30, 2016): @JimTR Their results are just the directory entries, because `$(which sendmail)` returns empty. As a result, they're just getting the output of `ls -l`for the current directly. A system lacking a symlink to sendmail wasn't at all what I expected for a modern Linux deployment.
Author
Owner

@UltimateByte commented on GitHub (Oct 30, 2016):

Makes sense now, but doesn't solve the actual issue !

<!-- gh-comment-id:257126448 --> @UltimateByte commented on GitHub (Oct 30, 2016): Makes sense now, but doesn't solve the actual issue !
Author
Owner

@dgibbs64 commented on GitHub (May 4, 2017):

I can confirm that -r works on some distros and doesnt on others. However i believe that -r is probably more common. I will update the email from to use -r instead.

<!-- gh-comment-id:299326086 --> @dgibbs64 commented on GitHub (May 4, 2017): I can confirm that -r works on some distros and doesnt on others. However i believe that -r is probably more common. I will update the email from to use -r instead.
Author
Owner

@lock[bot] commented on GitHub (Jul 18, 2018):

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:406088216 --> @lock[bot] commented on GitHub (Jul 18, 2018): This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#903
No description provided.