Gentoo Forums
Gentoo Forums
Quick Search: in
Sendmail aliases works only locally
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
analogDevices
n00b
n00b


Joined: 28 Oct 2004
Posts: 25

PostPosted: Fri Apr 07, 2006 9:15 am    Post subject: Sendmail aliases works only locally Reply with quote

I have setup a mail hub (sendmail-fetchmail-procmail-courier-imap) and everything works fine exept that fact that it ignores the aliases only when the mail comes from internet.
When the mail comes from lan or i send it manualy (telnet or sendmail -t < test.email) the aliases works properly.

I can't understand WHERE the problem beggins, i'm working on this problem for weeks and I will be greatfull for any good ideas.

/etc/fetchmailrc
Code:

set postmaster "root"
set nobouncemail
set properties ""
poll mail.spark.net.gr with proto POP3
user myuser there with password "mypass" is root here
mda "/usr/sbin/sendmail -i -f %F --  %T"


/etc/procmailrc
Code:

SHELL=/bin/sh
VERBOSE=yes
MAILDIR=$HOME/.maildir/
DEFAULT=$HOME/.maildir/
LOGFILE=/var/log/procmail.log
UMASK = 000
:0
* ^TO_\/(administrator|user1|user2|user3|user4)
/home/$MATCH/.maildir/


/etc/mail/sendmail.mc
Code:

divert(-1)
divert(0)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`Sendmail on Gentoo Linux')dnl
OSTYPE(linux)dnl
DOMAIN(generic)dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`SMART_HOST',`mail.spark.net.gr')dnl
define(`confTO_IDENT', `0')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`confLOG_Level', `14')dnl

FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo.db')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(masquerade_entire_domain)
FEATURE(masquerade_envelope)
EXPOSED_USER(`root')dnl

LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
MASQUERADE_DOMAIN(mycompany.gr)
MASQUERADE_AS(mycompany.gr)dnl


when I run fetchmail
Code:

dealer ~ # fetchmail -f /etc/fetchmailrc -v -v -k -m "/usr/sbin/sendmail -i -f %F -- %T"

fetchmail: WARNING: Running as root is discouraged.
fetchmail: 6.3.2 querying mail.spark.net.gr (protocol POP3) at Fri Apr  7 11:01:58 2006: poll started
fetchmail: POP3< +OK POP3 charlie.spark.net.gr v2003.83 server ready
fetchmail: POP3> CAPA
fetchmail: POP3< +OK Capability list follows:
fetchmail: POP3< TOP
fetchmail: POP3< LOGIN-DELAY 180
fetchmail: POP3< UIDL
fetchmail: POP3< USER
fetchmail: POP3< SASL LOGIN
fetchmail: POP3< .
fetchmail: POP3> USER mycompany
fetchmail: POP3< +OK User name accepted, password please
fetchmail: POP3> PASS *
fetchmail: POP3< +OK Mailbox open, 1 messages
fetchmail: selecting or re-polling default folder
fetchmail: POP3> STAT
fetchmail: POP3< +OK 1 1810
fetchmail: POP3> LAST
fetchmail: POP3< +OK 0
1 message for mycompany at mail.spark.net.gr (1810 octets).
fetchmail: POP3> LIST 1
fetchmail: POP3< +OK 1 1810
fetchmail: POP3> RETR 1
fetchmail: POP3< +OK 1810 octets
reading message mycompany@mail.spark.net.gr:1 of 1 (1810 octets)
About to rewrite Return-Path: <krockodile@gmail.com>
Rewritten version is Return-Path: <krockodile@gmail.com>

About to rewrite From: Stefanos <krockodile@gmail.com>
Rewritten version is From: Stefanos <krockodile@gmail.com>

About to rewrite To: administrator@mycompany.gr
Rewritten version is To: administrator@mycompany.gr

fetchmail: about to deliver with: /usr/sbin/sendmail -i -f 'krockodile@gmail.com' -- 'root'
#*************** not flushed
fetchmail: POP3> QUIT
fetchmail: POP3< +OK Sayonara
fetchmail: 6.3.2 querying mail.spark.net.gr (protocol POP3) at Fri Apr  7 11:02:01 2006: poll completed
fetchmail: not swapping UID lists, no UIDs seen this query
fetchmail: Deleting fetchids file.
fetchmail: normal termination, status 0
fetchmail: Deleting fetchids file.
Back to top
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Fri Apr 07, 2006 1:26 pm    Post subject: Re: Sendmail aliases works only locally Reply with quote

The only thing that jumps off the screen on quick read if
analogDevices wrote:

Code:
About to rewrite To: administrator@mycompany.gr
Rewritten version is To: administrator@mycompany.gr


Did fetchmail indeed change the To: address? You don't list what the original message recipient was, or where it actually got delivered.

Dave
Back to top
View user's profile Send private message
analogDevices
n00b
n00b


Joined: 28 Oct 2004
Posts: 25

PostPosted: Sat Apr 08, 2006 11:49 am    Post subject: Reply with quote

what makes us believe that a problem lies there since the specified email was delivered to the administrator maildir?
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Sat Apr 08, 2006 3:19 pm    Post subject: Reply with quote

Are you using virtusertable.db or aliases.db to do the aliasing?
Back to top
View user's profile Send private message
analogDevices
n00b
n00b


Joined: 28 Oct 2004
Posts: 25

PostPosted: Sat Apr 08, 2006 4:58 pm    Post subject: Reply with quote

just the /etc/aliases
( define(`ALIAS_FILE', `/etc/aliases')dnl )

I also tryed with /etc/mail/aliases.db but the problem remains.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Sun Apr 09, 2006 12:05 am    Post subject: Reply with quote

If your virtusertable is empty then take the feature out of the config. Be aware that virtuser will always override an alias from the aliases file.
Try to send yourself an email from outside the network (ie direct to sendmail, use a free yahoo account or something) and see if the aliasing works then. If it does try using fetchmails smtphost setting instead of calling sendmail locally.
If your using virtusertable as a catch-all for a domain then don't, use LUSER_RELAY instead.

Sendmail is the only program where I find Gentoo's way of storing different configs in files and include statements a real pain in the arse.
Back to top
View user's profile Send private message
analogDevices
n00b
n00b


Joined: 28 Oct 2004
Posts: 25

PostPosted: Mon Apr 10, 2006 8:00 am    Post subject: [ please wait.... ] Reply with quote

My ISP has declared bankruptcy (!) so I have to wait until the my new ISP complete the transfer process of all domains and accounts... :(
Back to top
View user's profile Send private message
analogDevices
n00b
n00b


Joined: 28 Oct 2004
Posts: 25

PostPosted: Sat Apr 15, 2006 12:26 pm    Post subject: Reply with quote

I try without virtusertable in sendmail.mc.... same problem
I try with smtphost dealer.mycompany.gr option in fetchmailrc... same problem
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum