Current time: 12-27-2024, 02:21 PM Hello There, Guest! (LoginRegister)


Thread Closed 
E-mail forwarding don't work
Author Message
Elber Offline
Junior Member
*

Posts: 51
Joined: Oct 2009
Reputation: 0
Post: #21
RE: E-mail forwarding don't work
main.cf:
Code:
# Postfix directory settings; These are critical for normal Postfix MTA functionallity
command_directory            = /usr/sbin
daemon_directory             = /usr/lib/postfix

# Some common configuration parameters
inet_interfaces              = all
mynetworks_style             = host

myhostname                   = mail.pixelmeal.com
mydomain                     = mail.pixelmeal.com.local
myorigin                     = $myhostname

smtpd_banner                 = $myhostname ESMTP ispCP 1.0.5 OMEGA Managed
setgid_group                 = postdrop

# Receiving messages parameters
mydestination                = $myhostname, $mydomain
append_dot_mydomain          = no
append_at_myorigin           = yes
local_transport              = local
virtual_transport            = virtual
transport_maps               = hash:/etc/postfix/ispcp/transport
alias_maps                   = hash:/etc/aliases
alias_database               = hash:/etc/aliases

# Delivering local messages parameters
mail_spool_directory         = /var/mail

# Mailboxquota
# => 0 for unlimited
# => 104857600 for 100 MB
mailbox_size_limit           = 0
mailbox_command              = procmail -a "$EXTENSION"

# Message size limit
# => 0 for unlimited
# => 104857600 for 100 MB
message_size_limit           = 0

biff                         = no
recipient_delimiter          = +

local_destination_recipient_limit = 1
local_recipient_maps         = unix:passwd.byname $alias_database

# ispCP Autoresponder parameters
ispcp-arpl_destination_recipient_limit = 1

# Delivering virtual messages parameters
virtual_mailbox_base         = /var/mail/virtual
virtual_mailbox_limit        = 0

virtual_mailbox_domains      = hash:/etc/postfix/ispcp/domains
virtual_mailbox_maps         = hash:/etc/postfix/ispcp/mailboxes

virtual_alias_maps           = hash:/etc/postfix/ispcp/aliases

virtual_minimum_uid          = 1000
virtual_uid_maps             = static:1000
virtual_gid_maps             = static:8

smtpd_sasl_authenticated_header = yes
receive_override_options = no_address_mappings

# SASL paramters
smtpd_sasl_auth_enable       = yes
smtpd_sasl_security_options  = noanonymous
smtpd_sasl_local_domain      =
broken_sasl_auth_clients     = yes

smtpd_helo_required          = yes

smtpd_helo_restrictions      = permit_mynetworks,
                               permit_sasl_authenticated,
                               reject_invalid_helo_hostname,
                               reject_non_fqdn_helo_hostname

smtpd_sender_restrictions    = reject_non_fqdn_sender,
                               reject_unknown_sender_domain,
                               permit_mynetworks,
                               permit_sasl_authenticated

smtpd_recipient_restrictions = reject_non_fqdn_recipient,
                               reject_unknown_recipient_domain,
                               permit_mynetworks,
                               permit_sasl_authenticated,
                               reject_unauth_destination,
                               reject_unlisted_recipient,
                               permit

smtpd_data_restrictions      = reject_multi_recipient_bounce,
                               reject_unauth_pipelining

# TLS parameters; activate, if avaible/used
#smtpd_use_tls               = yes
#smtpd_tls_loglevel          = 2
#smtpd_tls_cert_file         = /etc/postfix/cert.pem
#smtpd_tls_key_file          = /etc/postfix/privkey.pem
#smtpd_tls_auth_only         = no
#smtpd_tls_received_header   = yes

# AMaViS parameters; activate, if available/used
content_filter               = amavis:[127.0.0.1]:10024

# Quota support; activate, if available/used
#virtual_create_maildirsize     = yes
#virtual_mailbox_extended       = yes
#virtual_mailbox_limit_maps     = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
#virtual_mailbox_limit_override = yes
#virtual_maildir_limit_message  = "The user you're trying to reach is over mailbox quota."
#virtual_overquota_bounce       = yes

master.cf:
Code:
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#    -o receive_override_options=no_address_mappings                # Uncomment this line, when unsing AMaViS
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_enforce_tls=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# For AOL-Accounts
587       inet  n       -       -       -       -       smtpd
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject_unauth_destination
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
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
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
    -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache      unix    -    -    -    -    1    scache
# ====================================================================
# ispCP ω (OMEGA) a Virtual Hosting Control System
#
# @copyright    2001-2006 by moleSoftware GmbH
# @copyright    2006-2010 by ispCP | http://isp-control.net
# @version        SVN: $Id: master.cf 2505 2010-01-06 20:30:53Z nuxwin $
# @link            http://isp-control.net
# @author        ispCP Team
# ====================================================================
# for AMaViS and spam filter support
amavis    unix  -       -       n       -       2       smtp
   -o smtp_data_done_timeout=1200
   -o smtp_send_xforward_command=yes
   -o disable_dns_lookups=yes

localhost: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 smtpd_override_options=no_address_mappings
   -o mynetworks=127.0.0.0/8
   -o strict_rfc821_envelopes=yes

# ispCP autoresponder
ispcp-arpl unix  -      n       n       -       -       pipe
  flags=O user=vmail argv=/var/www/ispcp/engine/messenger/ispcp-arpl-msgr

# TLS - Activate, if TLS is avaiable/used
smtps     inet  n       -       -       -       -       smtpd
   -o smtpd_tls_wrappermode=yes
   -o smtpd_sasl_auth_enable=yes
#   -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
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 -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}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

amavisd.conf:
Code:
# Sample amavisd.conf file for Maia Mailguard 1.0.1
# Modified for use with Debian by Gary V, mr88talent at yahoo dot com

use strict;

$mydomain = 'mail.pixelmeal.com'; # a convenient default for other settings
$myhostname = 'mail.pixelmeal.com';  # must be a fully-qualified domain name!

@lookup_sql_dsn =
   ( ['DBI:mysql:database=****;host=127.0.0.1;port=3306', '****', '****'] );
#( ['DBI:mysql:maia:127.0.0.1', '*****', '****'] );


$max_servers = 2;             # number of pre-forked children (2..15 is common)
$daemon_user  = 'amavis';     # (no default;  customary: vscan or amavis)
$daemon_group = 'amavis';     # (no default;  customary: vscan or amavis)

$MYHOME   = '/var/lib/amavis';   # a convenient default for other settings
$TEMPBASE = $MYHOME;    # working directory
$ENV{TMPDIR} = $TEMPBASE;     # environment variable TMPDIR
$pid_file  = "/var/run/amavis/amavisd.pid";  
$lock_file = "/var/run/amavis/amavisd.lock";
$QUARANTINEDIR = '/var/lib/amavis/virusmails';

# Blowfish encryption key file (optional)
#$key_file = "$MYHOME/maia.key";

# $daemon_chroot_dir = $MYHOME;   # chroot directory or undef

# $db_home   = "$MYHOME/db";
# $helpers_home = "$MYHOME/var";  # prefer $MYHOME clean and owned by root?
#NOTE: create directories $MYHOME/tmp, $MYHOME/var, $MYHOME/db manually

# Use external notification templates (Debian specific)
#read_l10n_templates('en_US', '/etc/amavis');

@local_domains_maps = ( [".$mydomain"] );
# @mynetworks = qw( 127.0.0.0/8 );

$log_level = 0;              # verbosity 0..5
$log_recip_templ = undef;    # disable by-recipient level-0 log entries
$LOGFILE = "/var/log/amavis.log";
$DO_SYSLOG = 1;              # log via syslogd (preferred)
$SYSLOG_LEVEL = 'mail.debug';

$enable_db = 1;              # enable use of BerkeleyDB/libdb (SNMP and nanny)
$enable_global_cache = 1;    # enable use of libdb-based cache if $enable_db=1

$inet_socket_port = 10024;   # listen on this local TCP port(s) (see $protocol)

$sa_tag_level_deflt  = -999; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 5.0;  # add 'spam detected' headers at that level
$sa_kill_level_deflt = 5.0;  # triggers spam evasive actions
$sa_dsn_cutoff_level = 10;   # spam level beyond which a DSN is not sent

$sa_mail_body_size_limit = 500*1024*1024; # don't waste time on SA if mail is larger
$sa_local_tests_only = 0;    # only tests which do not require internet access?
$sa_auto_whitelist = 0;      # turn on AWL in SA 2.63 or older (irrelevant
                             # for SA 3.0, cf option is 'use_auto_whitelist')

$virus_admin               = "postmaster\@$mydomain";  # notifications recip.
$banned_admin              = "postmaster\@$mydomain";              
$mailfrom_notify_admin     = "virusalert\@$mydomain";  # notifications sender
$mailfrom_notify_recip     = "virusalert\@$mydomain";  # notifications sender
$mailfrom_notify_spamadmin = "spam.police\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef

@addr_extension_virus_maps      = ('virus');
@addr_extension_spam_maps       = ('spam');
@addr_extension_banned_maps     = ('banned');
@addr_extension_bad_header_maps = ('badh');
# $recipient_delimiter = '+';  # undef disables address extensions altogether
# when enabling addr extensions do also Postfix/main.cf: recipient_delimiter=+
$recipient_delimiter = undef;

$path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin';
$file        = '/usr/bin/file';   # file(1) utility; use recent versions
$gzip        = 'gzip';
$bzip2       = 'bzip2';
$lzop        = 'lzop';
$rpm2cpio    = ['rpm2cpio.pl','rpm2cpio'];
$cabextract  = 'cabextract';
$uncompress  = ['uncompress', 'gzip -d', 'zcat'];
$unfreeze    = ['unfreeze', 'freeze -d', 'melt', 'fcat'];
$arc         = ['nomarch', 'arc'];
$unarj       = ['arj', 'unarj'];
$unrar       = ['rar', 'unrar'];
$zoo         = 'zoo';
$lha         = 'lha';
$cpio        = ['gcpio','cpio'];
$ar          = 'ar';
$dspam       = 'dspam';

$MAXLEVELS = 14;
$MAXFILES = 1500;
$MIN_EXPANSION_QUOTA =      100*1024;  # bytes  (default undef, not enforced)
$MAX_EXPANSION_QUOTA = 300*1024*1024;  # bytes  (default undef, not enforced)

$sa_spam_subject_tag = '***SPAM*** ';
$defang_virus  = 1;  # MIME-wrap passed infected mail
$defang_banned = 1;  # MIME-wrap passed mail containing banned name

$notify_method  = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025';  # set to undef with milter!

$final_virus_destiny      = D_DISCARD;
$final_banned_destiny     = D_DISCARD;
$final_spam_destiny       = D_DISCARD;
$final_bad_header_destiny = D_DISCARD;

$warnvirussender = 1;
$warnspamsender = 0;
$warnbannedsender = 1;
$warnvirusrecip = 1;
$warnbannedrecip = 1;


$X_HEADER_LINE = "Maia Mailguard 1.0.2";
$X_HEADER_TAG = 'X-Virus-Scanned';
$X_HEADER_LINE = "Maia Mailguard 1.0.2";

use DBI;
my $db = "ispcp";
my $user="root";           # Type here your ispCP MySQL User
               # (is the same you typed during the setup)
my $host="localhost";
my $password="MarDolSob-SQL"; # Type here your ispCP MySQL Password
               #(is the same you typed during the setup)

my $dbh = DBI->connect("DBI:mysql:database=$db;host=$host", $user, $password, {RaiseError => 1});
my $arr = $dbh->selectcol_arrayref('SELECT domain_name, 1 FROM domain', {Columns=>[1,2]});
my $arre = $dbh->selectcol_arrayref('SELECT alias_name, 1 FROM domain_aliasses', {Columns=>[1,2]});

my $lis = ($arre,$arr);
%local_domains = (@$arr,@$arre);


@viruses_that_fake_sender_maps = (new_RE(
  [qr'\bEICAR\b'i => 0],            # av test pattern name
  [qr'^(WM97|OF97|Joke\.)'i => 0],  # adjust names to match your AV scanner
  [qr/.*/ => 1],  # true for everything else
));

@keep_decoded_original_maps = (new_RE(
# qr'^MAIL$',   # retain full original message for virus checking (can be slow)
  qr'^MAIL-UNDECIPHERABLE$', # recheck full mail if it contains undecipherables
  qr'^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)'i,
# qr'^Zip archive data',     # don't trust Archive::Zip
));

$banned_filename_re = new_RE(
# qr'^UNDECIPHERABLE$',  # is or contains any undecipherable components

  # block certain double extensions anywhere in the base name
  qr'\.[^./]*\.(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)\.?$'i,

# qr'[{}]',      # curly braces in names (serve as Class ID extensions - CLSID)

  qr'^application/x-msdownload$'i,                  # block these MIME types
  qr'^application/x-msdos-program$'i,
  qr'^application/hta$'i,
  qr'^message/partial$'i, qr'^message/external-body$'i, # rfc2046 MIME types

# [ qr'^\.(Z|gz|bz2)$'           => 0 ],  # allow any type in Unix-compressed
# [ qr'^\.(rpm|cpio|tar)$'       => 0 ],  # allow any type in Unix archives
# [ qr'^\.(zip|rar|arc|arj|zoo)$'=> 0 ],  # allow any type within such archives

# qr'.\.(exe|vbs|pif|scr|bat|cmd|com|cpl)$'i, # banned extension - basic
  qr'.\.(ade|adp|app|bas|bat|chm|cmd|com|cpl|crt|exe|fxp|hlp|hta|inf|ins|isp|​
         js|jse|lnk|mda|mdb|mde|mdw|mdt|mdz|msc|msi|msp|mst|ops|pcd|pif|prg|
         reg|scr|sct|shb|shs|vb|vbe|vbs|wsc|wsf|wsh)$'ix,  # banned ext - long

# qr'.\.(mim|b64|bhx|hqx|xxe|uu|uue)$'i,  # banned extension - WinZip vulnerab.

  qr'^\.(exe-ms)$',                       # banned file(1) types
  qr'^\.(exe|lha|cab|dll)$',         # banned file(1) types
);

@score_sender_maps = ({});  # should be empty if using Maia Mailguard

# See https://secure.renaissoft.com/maia/wiki/VirusScannerConfig
# for more virus scanner definitions.
@av_scanners = (

### http://www.clamav.net/
['ClamAV-clamd',
   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
   qr/\bOK$/, qr/\bFOUND$/,
   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
  # NOTE: run clamd under the same user as amavisd, or run it under its own
  #   uid such as clamav, add user clamav to the amavis group, and then add
  #   AllowSupplementaryGroups to clamd.conf;
  # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
  #   this entry; when running chrooted one may prefer socket "$MYHOME/clamd".

#  ### http://www.bitdefender.com/
#  ['BitDefender', 'bdc',
#    '--arc --mail {}', qr/^Infected files *:0+(?!\d)/,
#    qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/,
#    qr/(?:suspected|infected): (.*)(?:\033|$)/ ],
#  # consider also: --all --nowarn --alev=15 --flev=15.  The --all argument may
#  # not apply to your version of bdc, check documentation and see 'bdc --help'

#  ### http://www.kaspersky.com/  (kav4mailservers)
#  ['KasperskyLab AVP - aveclient',
#    ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient',
#     '/opt/kav/5.5/kav4mailservers/bin/aveclient','aveclient'],
#    '-p /var/run/aveserver -s {}/*',
#    [0,3,6,8], qr/\b(INFECTED|SUSPICION|SUSPICIOUS)\b/,
#    qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.+)/,
#  ],
#  # NOTE: one may prefer [0],[2,3,4,5], depending on how suspicious,
#  # currupted or protected archives are to be handled

#   ### http://www.kaspersky.com/
#   ['Kaspersky Antivirus v5.5',
#     ['/opt/kav/5.5/kav4unix/bin/kavscanner',
#      '/opt/kav/5.5/kav4mailservers/bin/kavscanner','kavscanner'],
#     '-i0 -xn -xp -mn -R -ePASBME {}/*', [0,10,15], [5,20,21,25],
#     qr/(?:INFECTED|WARNING|SUSPICION|SUSPICIOUS) (.*)/ ,
#   ],

);

# See https://secure.renaissoft.com/maia/wiki/VirusScannerConfig
# for more virus scanner definitions.
@av_scanners_backup = (

### http://www.clamav.net/   - backs up clamd or Mail::ClamAV
['ClamAV-clamscan', 'clamscan',
    "--stdout --disable-summary -r --tempdir=$TEMPBASE {}", [0], [1],
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],

);

1;  # insure a defined return
05-25-2010 11:14 PM
Find all posts by this user
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #22
RE: E-mail forwarding don't work
ok.

try the followin:

in line 10 in master.cf uncomment the line which should be uncommented when using amavis.

comment the "receive_override_options = no_address_mappings" in the main.cf

and remove the line
-o smtpd_override_options=no_address_mappings
in the master.cf in the block
"localhost:10025 inet ..."

this tells postfix to use the aliases mappings only after the content filter (amavis) - when amavis is giving back the mails to postfix (on port 10025).

/J
05-25-2010 11:24 PM
Visit this user's website Find all posts by this user
Elber Offline
Junior Member
*

Posts: 51
Joined: Oct 2009
Reputation: 0
Post: #23
RE: E-mail forwarding don't work
WORKING !!!!!!! Very very thanks !! Smile
(This post was last modified: 05-25-2010 11:32 PM by Elber.)
05-25-2010 11:31 PM
Find all posts by this user
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #24
RE: E-mail forwarding don't work
your welcome Smile

[close]
05-25-2010 11:43 PM
Visit this user's website Find all posts by this user
Thread Closed 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)