You are not logged in.
I would like to know how to send email from command line to my local user localhost linux system mail.
I feel like maybe the emails are sending but I dont know how to check the email and read the messages.
I saw some messages in mailq at one point that looked maybe like failed delivery messages but could not figure out how to read them. Checked for hours.
I would like to know how to check that mail. What is the command? SItes are telling me to telnet in to send mail. No telnet please.
I have tried setting this up with Postfix with no success. (Followed the Postfix wiki for days)
I can not possibly go through all the config permutations I have tried to get this working so just give me your best shot assuming a fresh Postfix install.
IF I DONT NEED POSTFIX THAT WOULD BE GREAT. I WANT SIMPLE LOCAL MAIL. THE KIND OF THING THAT USED TO BE STANDARD.
I set this up on ubuntu before without any trouble.
If you would like the text of config files just ask.
TL;DR
1. How to setup local email only. (i dont want to send mail to anyone other than myself on my localhost)
2. How do I send a test mail to myself using your solution.
3. How do I check and read the email I have sent to myself using your solution.
Thank you for your time.
Last edited by phraxos (2015-01-30 21:19:00)
Offline
Unless you have an SMTP mail server you can relay to, you have no choice but to set up an SMTP server on your system in order to send mail. Postfix is a pretty good choice for this, as the default install does most of the configuration for you. Since you're only wanting to send mail from the host running Postfix (correct?) you don't need to bother with setting up TLS for relaying or anything like this, however you must install Postfix, and you must do some minimal configuration. Be glad you're using Arch, by the way; setting Postfix up on, say Debian or Ubuntu is automatically a bigger pain in the ass, because Postfix is confined to a chroot jail by default.
So, maybe I can get you started; ask additional questions if this doesn't work. Postfix has 2 main configuration files: /etc/postfix/master.cf and /etc/postfix/main.cf. You probably don't need to make any changes in master.cf. Here are the fields in /etc/postfix/main.cf you'll need to edit. I'll just use the domain (spinningwheel.org) I recently used for test server. You'll have to substitute your own values for these.
myhostname = mail.spinningwheel.org
myorigin = spinningwheel.org
mydestination = mail.spinningwheel.org, spinningwheel.org, ibis.spinningwheel.org,
localhost, localhost.spinningwheel.org
I think these 3 fields are the only ones you need to change/set, given that you just want mail to be delivered to /var/spool/mail.
The other 2 fields you might have to pay attention to are
mailbox_transport =
mail_spool_directory =
however, since you're looking for local delivery to /var/spool/mail, I think these are already the defaults. I don't know for certain, because I haven't set up a mail system that doesn't use lmtp to transport mail to an IMAP server in a decade or longer.
The postconf command will tell you if you have any errors in your configuration files.
Offline
I'd suggest a different route; skip postfix and install opensmtpd. The default setup allows you to deliver mail to a local mbox. You obviously need to make sure you'd mail to an existing user on your local system, using the correct domain-name.
2 opensmtpd provides sendmail. `sendmail user@localhost` will send an email
3 your mail will end up in `/var/mail/user` (you will probably get a notification after sending.
# pacman -S opensmtpd
# systemctl start smtpd
$ sendmail user@localhost
test<ctrl+d>
You have mail in /var/mail/user
Last edited by Spider.007 (2015-02-01 10:07:49)
Offline
Thanks for that suggestion -- I completely forgot that there are simplified smtp alternatives. I have lots of hosts that just redirect mail to a primary smtp server. I'll need to check and see if opensmtp (or esmtp or msmtp) are appropriate tools for providing that basic service; then I won't need to install postfix on all these machines.
Offline