I'm trying to send emails from my linux PC to an internet address(yahoo,hotmail/etc)I'm not having much luck with the commands and I'm sure I need to configure sendmail/mta or something. But searching around the internet has confused me to no end.I've tried(from the commands line, replaced "email" with a valid email)mail email@yahoo.com mail email@hotmail.comcomes back with Subject:I put in a subjecttype my message. on a blank linecomes back to EOTtried /bin/mail -s test email@yahoo.comnail -s testnail -r email@yahoo.comnail -s testnail -r -a filename email@yahoo.comnail email@yahoo.comSo what do I need to do? Mainly just want to send myself emails when my server gets sick.
3/9/2008 9:14:53 PM
look at the sendmail logs. they will tell all.
3/9/2008 9:17:12 PM
I've used something similar to http://gentoo-wiki.com/HOWTO_Send_emails_with_shell_scripts to do this kind of thing in the past.
3/9/2008 9:24:25 PM
Thanks. I might have to put this off till tomorrow. I'm starting to fade...
3/9/2008 9:59:32 PM
Try mailx ?
3/9/2008 10:01:00 PM
^ is that the same thing as "nail" ? If so I've tried that with no success...Oh Im running slackware on one PC and Centos 5 on another.edit:for my reference when I decide to work on this tomorrow.http://www.slackbasics.org/html/sendmail.html[Edited on March 9, 2008 at 10:26 PM. Reason : .]
3/9/2008 10:15:20 PM
the easiest/best-way-to-ensure-your-email-doesnt-get-filtered-out-by-spam-filters is to set up sendmail to use a smart host so your machine isn't actively an MTA communicating with other servers, but you get an ISP or something of that sort to act as an intermediary.most spam filters are set to automatically reject messages originating from an MTA hosted on an IP that ARIN considers to be dynamically allocated.
3/9/2008 11:35:07 PM
^ ARIN does not classify IPs as being dynamically allocated or not. That is up to the service provider. Many mail admins block mail that comes from an IP with reverse DNS of a-b-c-d.blahblah where a.b.c.d is the IP address. There are also blacklists with lots of common dynamic IP ranges, such as the Spamhaus PBL.The problem could also be that your linux box is trying to deliver directly to a recipient mail server and your system's hostname is set wrong or the from address is @localhost.localdomain. Using a Smarthost would be a good idea if you don't have a static IP and control of your reverse DNS.Run 'tail -n 30 /var/log/maillog' after you try to send a test message and paste it here.
3/10/2008 7:27:50 AM
I was running into a problem like you guys had been describing (DNS was set up wrong, leading to a host of 'not a valid domain' type e-mails). It's straightforward enough to fix with a proper MX record, you just need to know it's the issue.Sendmail logs are definitely the thing to go look at. Is this a server you're hosting on your ISP or a site you're hosting at a hosting company/datacenter?
3/10/2008 7:53:35 AM
3/10/2008 8:35:58 AM
3/10/2008 8:59:19 AM
hmmm this is turning into more than I expected... All I wanted to do was send an email from my linux PC to my internet mail!!! lolSet this up on zoneedit.comIP Addresses: Domain Name IP Address myhostname.us 0.0.0.0 mail.myhostname.us 0.0.0.0 http://www.myhostname.us 0.0.0.0 Mail Servers:Domain Server Rankmyhostname.us mail.myhostname.us 0*changed the hostname and IP to generic names.now.. I wonder if I have to edit my updateIP script to change the mails IP when the ISP changes it??
3/10/2008 9:22:20 AM
3/10/2008 9:29:36 AM
I've got some config files I need to mess with before I can post the maillog
3/10/2008 12:27:16 PM
Ok.. this is weird.. I just checked my yahoo account and found 4 new emails in the BULK folder. they all 4 came from my slackware box..They have to be from testing messages I sent last night as I didn't send any today...I've replaced the username with myusername and the servers hostname with myhostname.myusername@myhostname.localdomainSo now I gotta figure out when it was working based on these emails...
3/10/2008 7:17:25 PM
looks like these are the 4 that made it through...Mar 10 15:15:16 hostname postfix/smtp[19183]: 2A11EF7DAA: to=<name@yahoo.com>, relay=c.mx.mail.yahoo.com[216.39.53.3]:25, delay=17046, delays=17035/0.01/0.76/10, dsn=2.0.0, status=sent (250 ok dirdel)Mar 10 16:05:06 hostname postfix/smtp[19659]: 156BCF7D71: to=<name@yahoo.com>, relay=g.mx.mail.yahoo.com[206.190.53.191]:25,delay=63147, delays=63146/0.01/0.55/0.26, dsn=2.0.0, status=sent (250 ok dirdel)Mar 10 17:11:48 hostname postfix/smtp[20257]: 82154F7D79: to=<name@yahoo.com>, relay=f.mx.mail.yahoo.com[209.191.88.247]:25,delay=66182, delays=66180/0.15/1.7/0.54, dsn=2.0.0, status=sent (250 ok dirdel)Mar 10 18:18:27 hostname postfix/smtp[20538]: 284D0F7DA9: to=<name@yahoo.com>, relay=d.mx.mail.yahoo.com[216.39.53.2]:25, delay=28073, delays=28072/0.01/0.32/0.19, dsn=2.0.0, status=sent (250 ok dirdel)full headers from yahoo for one emailFrom username@hostname.localdomain Mon Mar 10 07:31:10 2008X-Apparently-To: name@yahoo.com via 216.252.110.216; Mon, 10 Mar 2008 12:15:16 -0700X-YahooFilteredBulk: my ipX-Originating-IP: [my ip]Return-Path: <username@hostname.localdomain>Authentication-Results: mta278.mail.re4.yahoo.com from=hostname.localdomai; domainkeys=neutral (no sig)Received: from my ip (EHLO hostname.localdomain) (myip) by mta278.mail.re4.yahoo.com with SMTP; Mon, 10Mar 2008 12:15:06 -0700Received: by hostname.localdomain (Postfix, from userid 1000) id 2A11EF7DAA; Mon, 10 Mar 2008 10:31:10 -0400 (EDT)Date: Mon, 10 Mar 2008 10:31:10 -0400To: name@yahoo.comSubject: test2User-Agent: nail 11.25 7/29/05MIME-Version: 1.0Content-Type: text/plain; charset=us-asciiContent-Transfer-Encoding: 7bitMessage-Id: <20080310143146.2A11EF7DAA@hostname.localdomain>From: username@hostname.localdomain Add Mobile AlertContent-Length: 5testmaillog after I sent a new test messageMar 10 21:55:03 hostname postfix/local[21393]: fatal: open database /etc/aliases.db: No such file or directoryMar 10 21:55:04 hostname postfix/master[17692]: warning: process /usr/libexec/postfix/local pid 21393 exit status 1Mar 10 21:55:04 hostname postfix/master[17692]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 10 21:55:48 hostname postfix/pickup[20985]: 9EA8AAFDDE: uid=1000 from=<username:>Mar 10 21:55:48 hostname postfix/cleanup[21397]: 9EA8AAFDDE: message-id=<20080311015548.9EA8AAFDDE@hostname.localdomain>Mar 10 21:55:48 hostname postfix/qmgr[21018]: 9EA8AAFDDE: from=<username:@hostname.localdomain>, size=445, nrcpt=1 (queue active)Mar 10 21:55:49 hostname postfix/smtp[21399]: 9EA8AAFDDE: host c.mx.mail.yahoo.com[216.39.53.3] refused to talk to me: 553 Mail from myip not allowed - 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL; see http://postmaster.yahoo.com/550-bl21.html [550]Mar 10 21:55:49 hostname postfix/smtp[21399]: 9EA8AAFDDE: host a.mx.mail.yahoo.com[209.191.118.103] refused to talk to me: 553 Mail from myip not allowed - 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL; see http://postmaster.yahoo.com/550-bl21.html [550]Mar 10 21:55:52 hostname postfix/smtp[21399]: 9EA8AAFDDE: host g.mx.mail.yahoo.com[209.191.88.239] refused to talk to me: 421 Message from (myip) temporarily deferred - 4.16.50. Please refer to http://help.yahoo.com/help/us/mail/defer/defer-06.htmlMar 10 21:55:52 hostname postfix/smtp[21399]: 9EA8AAFDDE: host e.mx.mail.yahoo.com[216.39.53.1] refused to talk to me: 553 Mail from myip not allowed - 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL; see http://postmaster.yahoo.com/550-bl21.html [550]Mar 10 21:55:52 hostname postfix/smtp[21399]: 9EA8AAFDDE: to=<email@yahoo.com>, relay=f.mx.mail.yahoo.com[68.142.202.247]:25, delay=4.3, delays=0.01/0.01/4.3/0, dsn=4.0.0, status=deferred (host f.mx.mail.yahoo.com[68.142.202.247] refused to talk to me: 553 Mail from myip not allowed - 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL; see http://postmaster.yahoo.com/550-bl21.html [550])Mar 10 21:56:04 hostname postfix/local[21402]: fatal: open database /etc/aliases.db: No such file or directoryMar 10 21:56:05 hostname postfix/master[17692]: warning: process /usr/libexec/postfix/local pid 21402 exit status 1Mar 10 21:56:05 hostname postfix/master[17692]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 10 21:57:05 hostname postfix/local[21403]: fatal: open database /etc/aliases.db: No such file or directoryMar 10 21:57:06 hostname postfix/master[17692]: warning: process /usr/libexec/postfix/local pid 21403 exit status 1Mar 10 21:57:06 hostname postfix/master[17692]: warning: /usr/libexec/postfix/local: bad command startup -- throttling[Edited on March 10, 2008 at 9:00 PM. Reason : .]
3/10/2008 8:39:38 PM
3/10/2008 11:16:17 PM
I don't really have anything useful to add since the resolution has been posted, but chown postfix /etc/aliases.db;chgrp postfix /etc/aliases.dbcan be condensed intochown postfix:postfix /etc/aliases.dbfor future reference
3/11/2008 7:09:30 AM
added the ISPs smtp address and changed the hostname to myhostname.usMar 11 10:39:36 myhostname postfix/smtp[24874]: A2398AFE00: to=<root@myhostname.localdomain>, relay=smtpauth.earthlink.net[207.69.189.209]:25, delay=52, delays=0/47/0.22/5, dsn=5.0.0, status=bounced (host smtpauth.earthlink.net[207.69.189.209] said: 550 Please configure your mail client to use authentication. (in reply to RCPT TO command))myhostname is my actually my hostname, changed for privacyalso getting thisMar 11 10:39:37 myhostname postfix/master[24866]: warning: process /usr/libexec/postfix/local pid 24913 exit status 1Mar 11 10:39:37 myhostname postfix/master[24866]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 10:40:37 myhostname postfix/local[24914]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 10:40:38 myhostname postfix/master[24866]: warning: process /usr/libexec/postfix/local pid 24914 exit status 1Mar 11 10:40:38 myhostname postfix/master[24866]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 10:41:38 myhostname postfix/local[24918]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 10:41:39 myhostname postfix/master[24866]: warning: process /usr/libexec/postfix/local pid 24918 exit status 1Mar 11 10:41:39 myhostname postfix/master[24866]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 10:42:39 myhostname postfix/local[24923]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 10:42:40 myhostname postfix/master[24866]: warning: process /usr/libexec/postfix/local pid 24923 exit status 1Mar 11 10:42:40 myhostname postfix/master[24866]: warning: /usr/libexec/postfix/local: bad command startup -- throttling[Edited on March 11, 2008 at 9:44 AM. Reason : .]
3/11/2008 9:42:03 AM
your smtp server wants you to authenticatepostfix can't do that.doesn't earthlink have a smtp server that doesn't require authentication?alsotry:postmap /etc/aliases]
3/11/2008 10:08:56 AM
3/11/2008 10:17:53 AM
try smtp.earthlink.net
3/11/2008 10:20:18 AM
ok that worked and a test email came through within a few seconds. Wasn't even blocked by the BULK/spam filter!Mar 11 11:34:35 hostname postfix/smtp[25337]: DBFBEAFDEE: to=<email@yahoo.com>, relay=smtp.earthlink.net[209.86.93.210]:25, delay=2.5, delays=0/0/0.15/2.3, dsn=2.0.0, status=sent (250 OK id=1JZ6Uu-0006mW-00)
3/11/2008 10:41:14 AM
look at all you fucking spammers.:grr:
3/11/2008 2:12:05 PM
stfu. I'm only spamming MYSELF!ok evan what do I do about this?Mar 11 15:11:42 hostname postfix/master[26654]: warning: process /usr/libexec/postfix/local pid 26817 exit status 1Mar 11 15:11:42 hostname postfix/master[26654]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 15:12:42 hostname postfix/local[26818]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 15:12:43 hostname postfix/master[26654]: warning: process /usr/libexec/postfix/local pid 26818 exit status 1Mar 11 15:12:43 hostname postfix/master[26654]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 15:13:43 hostname postfix/local[26823]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 15:13:44 hostname postfix/master[26654]: warning: process /usr/libexec/postfix/local pid 26823 exit status 1Mar 11 15:13:44 hostname postfix/master[26654]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 15:14:44 hostname postfix/local[26826]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 15:14:45 hostname postfix/master[26654]: warning: process /usr/libexec/postfix/local pid 26826 exit status 1Mar 11 15:14:45 hostname postfix/master[26654]: warning: /usr/libexec/postfix/local: bad command startup -- throttlingMar 11 15:15:06 hostname postfix/pickup[26655]: 4D6CCF7D96: uid=0 from=<root>Mar 11 15:15:06 hostname postfix/cleanup[26848]: 4D6CCF7D96: message-id=<20080311191506.4D6CCF7D96@hostname.us>Mar 11 15:15:06 hostname postfix/qmgr[26656]: 4D6CCF7D96: from=<root@hostname.us>, size=1443, nrcpt=1 (queue active)Mar 11 15:15:45 hostname postfix/local[26850]: fatal: open database /etc/aliases.db: Bad file descriptorMar 11 15:15:46 hostname postfix/master[26654]: warning: process /usr/libexec/postfix/local pid 26850 exit status 1Mar 11 15:15:46 hostname postfix/master[26654]: warning: /usr/libexec/postfix/local: bad command startup -- throttling-rw-rw-rw- 1 postfix postfix 21 2008-03-11 14:36 aliases-rw-rw-rw- 1 postfix postfix 0 2008-03-11 14:42 aliases.dbcat aliaseswebmaster : myusernamenewaliasespostalias: fatal: cannot remove zero-length database file /etc/aliases.db: Permission denied[Edited on March 11, 2008 at 2:23 PM. Reason : .]
3/11/2008 2:14:51 PM
log in as root (or su)rm -f /etc/aliases.dbpostmap /etc/aliases
3/11/2008 3:02:36 PM
i tried that before but..# postmap /etc/aliasespostmap: fatal: open database /etc/aliases.db: Permission denied
3/11/2008 3:32:29 PM
gg evan
3/11/2008 3:35:26 PM
is it because postfix is trying to run the command but can't write to /etc?drwxr-xr-x 57 root root 8192 2008-03-11 16:31 etc/
3/11/2008 3:44:44 PM
cp aliases aliases.dbthen ran new aliases and didn't get any errors.I can send from my PC to internet mail but I can not receive mail on my PC if I reply from the internet mail to my username on the pcMar 12 16:08:40 myhostname.us postfix/postfix-script: stopping the Postfix mail systemMar 12 16:08:40 myhostname.us postfix/master[26654]: terminating on signal 15Mar 12 16:08:41 myhostname.us postfix/postfix-script: warning: group or other writable: /etc/postfix/./aliasesMar 12 16:08:41 myhostname.us postfix/postfix-script: starting the Postfix mail systemMar 12 16:08:41 myhostname.us postfix/master[1048]: daemon started -- version 2.3.3, configuration /etc/postfixMar 12 16:15:06 myhostname.us postfix/pickup[1049]: E5326AFDE9: uid=0 from=<root>Mar 12 16:15:06 myhostname.us postfix/cleanup[1112]: E5326AFDE9: message-id=<20080312201506.E5326AFDE9@myhostname.us.us>Mar 12 16:15:06 myhostname.us postfix/qmgr[1050]: E5326AFDE9: from=<root@myhostname.us.us>, size=1443, nrcpt=1 (queue active)Mar 12 16:15:06 myhostname.us postfix/local[1114]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabledMar 12 16:15:06 myhostname.us postfix/local[1114]: E5326AFDE9: to=<myusername@myhostname.us.us>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)Mar 12 16:15:06 myhostname.us postfix/qmgr[1050]: E5326AFDE9: removed# postmap /etc/aliasespostmap: warning: /etc/aliases, line 15: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 16: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 19: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 20: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 21: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 22: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 23: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 24: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 25: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 26: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 29: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 31: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 32: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 33: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 34: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 37: record is in "key: value" format; is this an alias file?postmap: warning: /etc/aliases, line 233: record is in "key: value" format; is this an alias file?[Edited on March 12, 2008 at 3:23 PM. Reason : .]
3/12/2008 3:22:35 PM
appears I fixed the nis errorMar 12 17:35:05 hostname postfix/postfix-script: starting the Postfix mail systemMar 12 17:35:05 hostname postfix/master[3145]: daemon started -- version 2.3.3, configuration /etc/postfix# postconf | grep alias | grep nisalias_maps = hash:/etc/aliases, nis:mail.aliasesto# postconf | grep alias | grep nisalias_maps = hash:/etc/aliasesstill can't figure out why I cant receive mail from the internet on my pc..[Edited on March 12, 2008 at 4:42 PM. Reason : .]
3/12/2008 4:14:04 PM
port 25 FTW thanks evan
3/12/2008 8:08:58 PM