OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Problem with virtual_alias_maps

From: Ph. Marek (philippmarek.priv.at)
Date: Mon Jan 03 2005 - 03:16:57 CST


Hello everybody!

I've got a problem with (I believe) virtual domain setup.
I already searched google wide and far, read most of postfix documentation,
but still can't find the answer.

The wanted setup is:
- the server fetches mail from different pop3 mailboxes (using fetchmail).
  some of these are catch-all adresses.
  I've already used fetchmail and don't expect problems (though I don't have
  it configured here yet).
- it should virus-scan and spamfilter them (amavis/spamassassin/clamd).
- it should deliver the mails in various inboxes of cyrus.
  that works for mail sent to *local* recipients (ie. unix accounts)
  via "mail" and "telnet localhost smtp".
- user should send mails with various identities (that correspond to the
above
  defined pop3 mailboxes); these mails have partly to be sent via other
  smtp relay servers (because of spf and similar causes). (Should I just
  send directly without relay servers??)
  I'm mostly blank about this point, but believe there's something to be done
  with transport maps. Tips, please??

The server is x86/debian unstable, with these package versions:
  ii amavisd-new 20030616p10-5 Interface between MTA and virus
scanner/cont
  ii clamav 0.80-7 Antivirus scanner for Unix
  ii clamav 0.80-7 Antivirus scanner for Unix
  ii clamav-base 0.80-7 Base package for clamav, an anti-virus
utili
  ii clamav-base 0.80-7 Base package for clamav, an anti-virus
utili
  ii clamav-daemon 0.80-7 Powerful Antivirus scanner daemon
  ii clamav-daemon 0.80-7 Powerful Antivirus scanner daemon
  ii clamav-freshcl 0.80-7 Downloads clamav virus databases from
the In
  ii clamav-freshcl 0.80-7 Downloads clamav virus databases from
the In
  ii cyrus21-admin 2.1.17-3 Cyrus mail system (administration tool)
  ii cyrus21-client 2.1.17-3 Cyrus mail system (test clients)
  ii cyrus21-common 2.1.17-3 Cyrus mail system (common files)
  ii cyrus21-doc 2.1.17-3 Cyrus mail system (documentation files)
  ii cyrus21-imapd 2.1.17-3 Cyrus mail system (IMAP support)
  ii cyrus21-murder 2.1.17-3 Cyrus mail system (proxies and
aggregator)
  ii cyrus21-pop3d 2.1.17-3 Cyrus mail system (POP3 support)
  ii libclamav1 0.80-7 Virus scanner library
  ii libclamav1 0.80-7 Virus scanner library
  ii libcyrus-imap- 2.1.17-3 Interface to Cyrus imap client
imclient libr
  ii postfix 2.1.5-3 A high-performance mail transport agent
  ii spamassassin 3.0.1-1 Perl-based spam filter using text
analysis
  ii spamassassin 3.0.1-1 Perl-based spam filter using text
analysis
  ii spamc 3.0.1-1 Client for SpamAssassin spam filtering
daemo

Please assume that m1mail1.at, m2mail2.at are the pop3 boxes to fetch, and
catchall1.at and catchall2.at are the domains with catch-all mailboxes.

The server resides in mail1.at.

The local unix-accounts are l1, l2 and l3.

The generated database files are up-to-date, I even wrote a Makefile so as
not having to remember the hashing.

(BTW: does "postmap -q" need postfix to be restarted? It didn't find the
keys set in virtual for some time. I'm not sure why it did then; I may have
restarted postfix)

postmap gives an answer
  # postmap -q testcatchall1.at /etc/postfix/virtual
  l3

The symtom is a return mail (indented for clarity).
Please see the mail and the varios configuration files below.
In the mail.info-logfile I get
  Jan 3 09:59:25 server postfix/qmgr[3895]: 82BD7526EC:
from=<rootserver.mail1.at>, size=755, nrcpt=1 (queue active)
  Jan 3 09:59:25 server postfix/error[3904]: 82BD7526EC:
to=<testcatchall1.at>, relay=none, delay=0, status=bounced (User
unknown in virtual alias table)

And if you can give me and hints or tips regarding the relaying to various
smtp servers I would be grateful, too.

Thank you for all answers!

Regards,

Phil

--- mail starts
  From: MAILER-DAEMONserver.mail1.at (Mail Delivery System)
  Subject: Undelivered Mail Returned to Sender
  To: rootserver.mail1.at
  MIME-Version: 1.0
  Content-Type: multipart/report; report-type=delivery-status;
  boundary="79331524F0.1104740153/server.mail1.at"
  Message-Id: <20050103081553.077B3524F5server.mail1.at>

  This is a MIME-encapsulated message.

  --79331524F0.1104740153/server.mail1.at
    Content-Description: Notification
    Content-Type: text/plain

    This is the Postfix program at host server.mail1.at.

    I'm sorry to have to inform you that your message could not be
    be delivered to one or more recipients. It's attached below.

    For further assistance, please send mail to <postmaster>

    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.

    The Postfix program

    <m2mail2.at>: User unknown in virtual alias table

  --79331524F0.1104740153/server.mail1.at
    Content-Description: Delivery report
    Content-Type: message/delivery-status

    Reporting-MTA: dns; server.mail1.at
    X-Postfix-Queue-ID: 79331524F0
    X-Postfix-Sender: rfc822; rootserver.mail1.at
    Arrival-Date: Mon, 3 Jan 2005 09:15:51 +0100 (CET)

    Final-Recipient: rfc822; m2mail2.at
    Action: failed
    Status: 5.0.0
    Diagnostic-Code: X-Postfix; User unknown in virtual alias table

  --79331524F0.1104740153/server.mail1.at
    Content-Description: Undelivered Message
    Content-Type: message/rfc822

    Received: from localhost (localhost [127.0.0.1])
    by server.mail1.at (Postfix) with ESMTP id 79331524F0
    for <m2mail2.at>; Mon, 3 Jan 2005 09:15:51 +0100 (CET)
    Received: from server.mail1.at ([127.0.0.1])
    by localhost (server.mail1.at [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id 03272-01 for <m2mail2.at>;
    Mon, 3 Jan 2005 09:15:49 +0100 (CET)
    Received: by server.mail1.at (Postfix, from userid 0)
    id D0FF7524F5; Mon, 3 Jan 2005 09:15:48 +0100 (CET)
    To: steiermail2.at
    Message-Id: <20050103081548.D0FF7524F5server.mail1.at>
    Date: Mon, 3 Jan 2005 09:15:48 +0100 (CET)
    From: rootserver.mail1.at (root)
    X-Virus-Scanned: by amavisd-new-20030616-p10 at mail1.at

    test-mail
  --79331524F0.1104740153/server.mail1.at--
--- mail ends

--- master.cf start
  smtp inet n - - - - smtpd
  pickup fifo n - - 60 1 pickup
  cleanup unix n - - - 0 cleanup
  qmgr fifo n - - 300 1 qmgr
  rewrite unix - - - - - trivial-rewrite
  bounce unix - - - - 0 bounce
  defer unix - - - - 0 bounce
  trace unix - - - - 0 bounce
  verify unix - - - - 1 verify
  flush unix n - - 1000? 0 flush
  proxymap unix - - n - - proxymap
  smtp unix - - - - - smtp
  relay unix - - - - - smtp
  showq unix n - - - - showq
  error unix - - - - - error
  local unix - n n - - local
  virtual unix - n n - - virtual
  lmtp unix - - n - - lmtp
  anvil unix - - n - 1 anvil

  smtp-amavis unix - - n - 2 smtp
      -o smtp_data_done_timeout=1200
      -o smtp_send_xforward_command=yes
      -o disable_dns_lookups=yes

  127.0.0.1:10025 inet n - n - - smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_client_restrictions=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks=127.0.0.0/8
      -o strict_rfc821_envelopes=yes
      -o smtpd_error_sleep_time=0
      -o smtpd_soft_error_limit=1001
      -o smtpd_hard_error_limit=1000

  maildrop unix - n n - - pipe
    flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${user}${nexthop}
${extension} ${recipient} ${user} ${nexthop}
  uucp unix - n n - - pipe
    flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
  ifmail unix - n n - - pipe
    flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
  bsmtp unix - n n - - pipe
    flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender
$recipient
  scalemail-backend unix - n n - 2 pipe
    flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
${nexthop} ${user} ${extension}
--- master.cf end

--- main.cf start
  smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
  biff = no

  append_dot_mydomain = no

  myhostname = server.mail1.at
  mydomain = mail1.at
  alias_maps = hash:/etc/aliases
  alias_database = hash:/etc/aliases
  myorigin = /etc/mailname
  mydestination = server.mail1.at, localhost, localhost.localdomain,
localhost, mail1.at
  relayhost =
  mailbox_size_limit = 0
  local_transport = lmtp:unix:/var/run/cyrus/socket/lmtp
  recipient_delimiter = +

  inet_interfaces=localhost, server
  mynetworks_style = subnet
  mynetworks = 127.0.0.0/8, 10.1.1.0/24

  content_filter=smtp-amavis:[127.0.0.1]:10024
  receive_override_options = no_address_mappings

  # here the confusion starts - I merged parts of various howtos
  virtual_alias_domains = mail1.at catchall1.at mail2.at
  virtual_alias_maps = hash:/etc/postfix/virtual
  virtual_transport = lmtp:unix:/var/run/cyrus/socket/lmtp
  #virtual_mailbox_domains = mail1.at catchall1.at mail2.at
  #virtual_mailbox_maps = hash:/etc/postfix/virtual

  local_recipient_maps =
  virtual_recipient_maps =
--- main.cf end

--- virtual start
  m1mail2.at l1
  catchall1.at l2
  testcatchall1.at l3
  mail1.at l3
  postmastermail1.at postmaster
  postmastercatchall1.at postmaster
--- virtual end