Link to home
Start Free TrialLog in
Avatar of periclis
periclis

asked on

Sending email via an ISP account

Hello! I'm a Linux newbie and I'd really appreciate some help with my email problem.

***The problem***:
I can't send email via my ISP.

***What I'm using***
The Slackware 3.4 distribution, kernel 2.0.30, is installed on my personal Linux box.
I'm running BSD sendmail 8.8.7.
I'm successfully using fetchmail 4.4.7 to retrieve and read mail from my account with my ISP using POP and a simple .fetchmailrc file in my home directory:

poll mailserver.my.isp.com
protocol POP3
username <my_username_at_my_ISP>
password <my_password_at_my_ISP>
is <usename_on_my_machine>

This works great for receiving mail.

***What's happening***
When I run the outgoing mail queue to send mail via SMTP through my ISP, I get error messages saying that my machine has an unresolvable host name.

PLease help...

Periclis
Avatar of periclis
periclis

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of richrussell
richrussell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello, you need to modify your sendmail.cf for working in a LAN.
Some variables :
my.domain : your local domain
smtp.my.isp.domain : the SMTP server of your ISP
my.isp.domain : the domain of your ISP

edit a new .mc (ex foo.mc)and type (dnl is commetary):
-------cut --------------------
divert(-1)
dnl Check the location of cf.m4
include(`/usr/lib/sendmail-cf/m4/cf.m4')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
GENERICS_DOMAIN(my.domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(always_add_domain)dnl
FEATURE(masquerade_envelope)dnl
dnl The fiels FROM that the ISP gave you
dnl You will create a .db after ...
FEATURE(genericstable,``hash -N /etc/revaliases'')dnl
define(`confDOMAIN_NAME',`my.ISP.domain')dnl
define(`confSMTP_MAILER',`smtp8')dnl
dnl you will probably change this ...
define(`confDEF_CHAR_SET',`ISO-8859-1')dnl
define(`SMART_HOST',`Smtp:smtp.my.ISP.domain')dnl
dnl
dnl If you use Procmail
dnl location of procmail : /usr/bin/procmail
FEATURE(local_procmail,``/usr/bin/procmail'')
dnl by default /usr/local/bin
FEATURE(local_procmail)
dnl Comment out one of these 2 FEATUREs above
dnl depends of your case ...
dnl
MAILER(local)
MAILER(smtp)
----- cut here ------
You "masquerade" your local domain by a real domain.
You can add the cost ... means that every messages is queued until a PPP connection is made (the command is sendmail -q)
Add in the mc file :
define(`confCON_EXPENSIVE,`True')dnl
define(`SMTP_MAILER_FLAG',`e')dnl

1. Generate the sendmail.cw (save your old /etc/sendmail.cw) with:
$ m4 foo.cw > /etc/sendmail.cw
2. Put in the /etc/hosts the IP address of smtp.my.ISP.domain
XXX.XXX.XXX.XXX smtp.my.IPS.domain smtp
3. Put this line in the /etc/revaliases :
my.domain: real-adresse@my.ISP.domain
4. regenarate the base aliases
sendmail -bi -oA/etc/revaliases
5. kill sendmail
kill `head -1 /var/run/sendmail.pid`
6. restart sendmail with :
/usr/sbin/sendmail -bd -os
(you can modify the rc script to start sendmail with these options)
. OK !
Every message is kept in /var/spool/mqueue and once logged on the Internet type:
/usr/sbin/sendmail -q (to empty the queue)
You can add this line in the ip-up script

Hope this helps
Vikie



Thank you very much for the detailed response!
However, there's still a **small problem**:

I can't send mail to myself, or to other users with accounts on the same ISP, no matter whether I use as address

<email_address_at_this_ISP>@<this_ISP_domain>

or

<username_at_this_ISP>@<this_ISP_domain>

I can receive email from users with accounts on the same ISP.

These messages are queued normally when I'm not logegd in to my ISP, but when I log in to my ISP and try to run the queue they bounce with "this address had permanent fatal errors: user unknown".

Messages to recipients on remote addresses are not bouncing, but i don't know yet whether they're getting through.

Periclis
Hi,
Have a look on the /var/log/maillog to see what happens (the format of addresses)
Try to log on your linux box with the same account than your ISP gave to you (bloody english on monday morning ;-)).
Or mail me directly (vikie@iname.com)
Bye
Vikie