[SLE] Postmail sends mail to root@myprovider.nl instead of root@mypc.myprovider.nl (was: Re: [SLE] Sendmail Dials ISP for Local Mail)
HellOO :) I had a perhaps similar problem with Postfix, a more secure mta (which is present in SuSE 6.3 and 6.4, see www.postfix.org). When installing and configuring with YaST, I was a good boy and just filled in the data as it was (hostname=mypc, domain=myprovider.nl - i have a static ip address, but use PPP dialin with wvdial), and loopback. However, YaST then generates a /etc/postfix/main.cf that is wrong imho. It sets the entry "myorigin = $mydomain" instead of (Postfix's default, by the way) "myorigin = $myhostname". While I understand SuSE's setting is more appropiate for larger networks/ organizations (but still only if some intelligent relaying and name scheme like firstname.lastname is used), this is not good for a home user, because local mail (eg. sec-check mail to root), now goes to the Postfix queue for root@myprovider.nl and when you connect the first time... your provider get's your root mail --- quite embarrasing :) Maybe this excerpt from my personal "howtoetje" helps people with Postfix and maybe SuSE (LenZ?) has use for it. The most important /etc/postfix/main.cf settings are: myhostname = mypc.myprovider.nl mydomain = myprovider.nl myorigin = mypc.myprovider.nl Replace "myprovider.nl" with "yourprovider.com" and "mypc" with "yourlinuxboxie" as appropiate. Note that i send out mail with smtp, which comes in the queue if you're not online---when i'm online i just say 'postfix flush' to have Postfix send out the pending mail when I'm connected---this way you can create all your mail un-connected and send it out in a "batch" when online. Comments/suggestions welcome, please use this info at your own discretion! ===cut o Remove Postfix mail and fix Postfix setup. The settings as entered above result in mail sent to root@myprovider.nl, instead of root@mypc.myprovider.nl. Therefore, do _not_ connect to the Internet (wvdial, setup with yast) _yet_. Stop Postfix and inspect queue: # postfix stop # mailq Move mail away from the queue, inspect and throw away when done: # mkdir /tmp/{defer,deferred}; cd /var/spool/postfix # mv defer/*/*/* /tmp/defer; mv deferred/* /tmp/deferred # ( cat /tmp/defer/*; postcat /tmp/deferred/* ) | less -eiMs # rm -rf /tmp/{defer,deferred} Fix Postfix setup. Files are in directory /etc/postfix---note that we are bypassing file '/etc/rc.config.d/postfix.rc.config', because that one does not fix the problem (start a 'tail -f /var/log/mail' in a separate window). First suppress creation by SuSEconfig of the postfix config files: # vi /etc/rc.config.d/postfix.rc.config [---- Begin file (fragment): /etc/rc.config.d/postfix.rc.config ----] POSTFIX_CREATECF="no" [------ End file (fragment): /etc/rc.config.d/postfix.rc.config ----] # cd /etc/postfix && ls -l main.cf master.cf # vi /etc/postfix/main.cf [---- Begin file (fragment): /etc/postfix/main.cf ----] myhostname = mypc.myprovider.nl mydomain = myprovider.nl myorigin = mypc.myprovider.nl smtp_connect_timeout = 300 default_transport = smtp [------ End file (fragment): /etc/postfix/main.cf ----] The entry that gave the problems is 'myorigin', which was set to $mydomain (which is set to 'myprovider.nl'). Take a high smtp timeout for lazy pobox.com. Always use smtp (by default) for outbound mail (no transport tables). # postfix start Do a test (do _not_ go online to your ISP!): mail from root to: (1) root (2) root@mypc (3) root@mypc.myprovider.nl and reply to those mails (use 'mutt'). Everything should stay local and 'mailq' should be empty when all mail is read and deleted with mutt. There should be no 'root@myprovider.nl' anymore. ===cut
"Alvaro A. Novo" wrote:
... Speaking of rc.config (or rather /etc/rc.config.d/sendmail.rc.config for SuSE 6.4), further entries are SENDMAIL_EXPENSIVE="yes" and SENDMAIL_NOCANONIFY="yes". further: SENDMAIL_SMARTHOST="mail.foo.bar" # your providers mailserver SENDMAIL_LOCALHOST="localhost marvin marvin.forty.two" SENDMAIL_RELAY="" ...
Bye-bye,
Eric Maryniak
--
Eric Maryniak
participants (1)
-
e.maryniak@pobox.com