2019-09-20 - hschneider, Admin
Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.
![]() |
| XMail Forum · Newbies read here ! All about SMTP,MX-Records,DNS etc. |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
| aju_rathod |
Posted: Jun 10 2006, 09:37 AM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
Hi,
I want a copy of all the outgoing mails on the server. This is the requirement of the organization. The configuration is as follows but still it doesnt works. filter.out.tab is as follows: "*" "*" "0.0.0.0/0" "0.0.0.0/0" "copy.tab" copy.tab is as follows "\var\MailRoot\filters\copy.pl" "@@FILE" Copy.pl is as follows #!/usr/bin/perl require MIME::Lite; system('export MAIL_ROOT=/var/MailRoot'); $mess = $ARGV[0]; $tmess = $mess; #$path_to_box ="/var/MailRoot/domains/synchronresearch.com/outgoing/Maildir/new"; $boss = 'outgoing@synchronresearch.com'; $action = 5; open(FILE,$mess); @mess = <FILE>; close(FILE); $mess = join('',@mess); $mess = split(/<<MAIL-DATA>>\r\n/,$mess); @mess = split('\n',$mess); $cnt = scalar(@mess); for ($i=0; $i<$cnt; $i++){ if (@mess[$i] =~ m/Subject/g){@mess[$i] =~ s/Subject\: /Subject\: \[copy\] /g;} } @tmess = split('/',$tmess); $tcnt = scalar(@tmess); #this will copy to local maildir #open(FILE,">$path_to_box@tmess[$tcnt-1]"); #for ($i=0; $i<$cnt; $i++){ #print FILE "@mess[$i]\n"; #} #close(FILE); #this will send e-mail $msg = MIME::Lite->new( From => 'synchronresearch.com', To => $boss, Subject => 'Copy', Type => 'multipart/related'); $msg->attach( Type => 'text/plain; charset=windows-1250', Data => $mess); MIME::Lite->send('smtp', "127.0.0.1", Timeout=>60); What could be the reason? Regarsd, Ahay Rathod. |
| atomant |
Posted: Jun 10 2006, 03:19 PM
|
![]() No - I'm not an answering script ... Group: Admin Posts: 1776 Member No.: 427 Joined: 18-January 03 |
- do you have a module MIME::Lite isntalled ?
- change From => 'synchronresearch.com', to From => 'something@synchronresearch.com', - what is not working? - what errors? - anything in the logs? - run Xmail in debug mode to see what is going on -------------------- Bye,
Sasa ------------------------------------------------------------------- All electric machines work on smoke...when the smoke escape from machines, they don't work anymore Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming or what?" |
| aju_rathod |
Posted: Jun 10 2006, 04:33 PM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
I am not getting the copy of outgoing messages in the mailbox of Outgoing@synchronresearch.com Following is the ouput of logs Jun 10 20:50:50 synchronresearch last message repeated 7 times Jun 10 20:51:30 synchronresearch last message repeated 8 times Jun 10 20:51:31 synchronresearch XMail[23084]: Filter error (-97): Sender = "aja y@synchronresearch.com" Recipient = "postmaster@interveinlab.com" Filter = "\var \MailRoot\filters\copy.pl" Jun 10 20:51:35 synchronresearch pam_timestamp_check: pam_timestamp: `/var/' per missions are lax Jun 10 20:52:10 synchronresearch last message repeated 7 times Jun 10 20:53:15 synchronresearch last message repeated 13 times Jun 10 20:54:20 synchronresearch last message repeated 13 times Jun 10 20:55:00 synchronresearch last message repeated 8 times Jun 10 20:55:01 synchronresearch crond(pam_unix)[23173]: session opened for user root by (uid=0) Jun 10 20:55:02 synchronresearch crond(pam_unix)[23173]: session closed for user root Jun 10 20:55:05 synchronresearch pam_timestamp_check: pam_timestamp: `/var/ Following is the output of running Xmail in debug mode [PSYNC/MASQ] MasqDomain = "synchronresearch.com,synchronresearch.com" - RmtDomain = "synchronresearch.com" - RmtName = "synchron" [PSYNC] entry [PSYNC/MASQ] MasqDomain = "litchtech.net,litchtech.net" - RmtDomain = "litchtech.net" - RmtName = "litchtec" [PSYNC] entry [PSYNC/MASQ] MasqDomain = "interveinlab.com,interveinlab.com" - RmtDomain = "interveinlab.com" - RmtName = "intervei" [PSYNC] exit [PSYNC] exit [PSYNC] exit [PSYNC] entry [PSYNC/MASQ] MasqDomain = "synchronresearch.com,synchronresearch.com" - RmtDomain = "synchronresearch.com" - RmtName = "synchron" [PSYNC] entry [PSYNC/MASQ] MasqDomain = "interveinlab.com,interveinlab.com" - RmtDomain = "interveinlab.com" - RmtName = "intervei" [PSYNC] entry [PSYNC/MASQ] MasqDomain = "litchtech.net,litchtech.net" - RmtDomain = "litchtech.net" - RmtName = "litchtec" [PSYNC] exit [PSYNC] exit [PSYNC] exit execv error: cmd='\var\MailRoot\filters\copy.pl' Filter error (-97): Sender = "rahul@synchronresearch.com" Recipient = "drshiv@synchronreseach.com" Filter = "\var\MailRoot\filters\copy.pl" MX records for domain "synchronreseach.com" not found, trying direct. SMAIL SMTP-Send FF = "synchronreseach.com" SMTP = "192.168.0.11" From = "rahul@synchronresearch.com" To = "drshiv@synchronreseach.com" << ErrCode = -40 ErrString = Invalid server address ErrInfo = synchronreseach.com SMAIL SMTP-Send FF = "synchronreseach.com" SMTP = "192.168.0.11" From = "rahul@synchronresearch.com" To = "drshiv@synchronreseach.com" Failed ! SMTP-Error = "417 Temporary delivery error" SMTP-Server = "synchronreseach.com" I am not getting the copy of outgoing messages with the configuration specified in Copy.pl file. |
| atomant |
Posted: Jun 10 2006, 06:24 PM
|
||||
![]() No - I'm not an answering script ... Group: Admin Posts: 1776 Member No.: 427 Joined: 18-January 03 |
It says that domain synchronresearch.com does not exists. Looks like you have dns problem. When I telnet to synchronresearch.com I get:
This is not Xmail server running but Exim. Port 25 blocked?? -------------------- Bye,
Sasa ------------------------------------------------------------------- All electric machines work on smoke...when the smoke escape from machines, they don't work anymore Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming or what?" |
||||
| aju_rathod |
Posted: Jun 11 2006, 10:09 AM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
Port 25 is not blocked, it is open on my gateway for my internal mail server address which is 192.168.0.11. and what you are getting is you are getting from my main server which is hosted on 66.45.240.50. I want a copy of all the outgoing messages. The copy.pl file doesnt put the copy og outgoing messages in the mail directory of outgoing@synchronresearch.com. Mail server works fine , there is no any problem in that. What i did for a copy that i already mentioned.
Thanks for the support, Ajay Rathod. |
| atomant |
Posted: Jun 12 2006, 05:29 AM
|
![]() No - I'm not an answering script ... Group: Admin Posts: 1776 Member No.: 427 Joined: 18-January 03 |
As in my prevous message: Xmail says that synchronresearch.com is an invalid address. So either it is or Xmail cannot resolve it correctly. If you have a local dns server or using ISP's dns server you can put all of them in the dnsroots file.
-------------------- Bye,
Sasa ------------------------------------------------------------------- All electric machines work on smoke...when the smoke escape from machines, they don't work anymore Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming or what?" |
| aju_rathod |
Posted: Jun 13 2006, 06:43 AM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
Sorry to say but what you are looking at is synchronreseach.com and not synchronresearch.com. My domain is synchronresearch.com. So there is no any problem of domain. That message shows the information about the bounced mail.
Regards, Ajay Rathod |
| bim |
Posted: Jun 13 2006, 10:25 PM
|
||||
|
Advanced Wizard ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 489 Member No.: 297 Joined: 6-October 02 |
synchronreseach.com is from your logs:
And keep in mind that filters.out.tab will only work for remotely delivered mails. So if the mailser that is running this script, is also the mailserver for synchronresearch.com, then internal mails sent from one synchronresearch.com-address to an other synchronresearch.com-address won't be logged. ...but if this mailserver isn't the mailserver hosting mailboxes for synchronresearch.com, then keep in mind that your script will cause an endless loop since the mails you log, will also be logged, which will also be logged, which... And for testing: get yourself a copy of a message from the server. I think this will do the trick:
and now call your script from the command line with the location of the file you just saved as a parameter... If anything is wrong in your script, then you should now get a nice error message telling you exactly what. |
||||
| NomadCF |
Posted: Jun 20 2006, 01:40 PM
|
||||||||||||||
|
Wizard ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 428 Member No.: 434 Joined: 21-January 03 |
Here what we use for archiving all sent messages. filters.in.tab
filters.out.tab
record-in.tab
record-out.tab
record.sh
This will create a storage structure like this.
Or as a real example of a message send to no_spam@nomadcf.com on 6/20/06 would look like this.
This is by no means an ideal archiving system but it's simple and works for single domain hosts. And it's easy to script web interfaces for so people can allow there users to restore or call up old emails (but not remove them form the archive). -------------------- |
||||||||||||||
| aju_rathod |
Posted: Jun 26 2006, 10:05 AM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
Hi,
Thanks for the information. I followed all the information as mentioned above but still there is no single mail is /var/MailRoot/archive. Do i need to change anything in record.sh ? Regards, Ajay Rathod |
| NomadCF |
Posted: Jun 26 2006, 01:36 PM
|
||
|
Wizard ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 428 Member No.: 434 Joined: 21-January 03 |
is record.sh chown'ed so it's executable ? have you tried running this by hand ? example :
So don't forget those are TABs in those filter.*.tab files ! -------------------- |
||
| aju_rathod |
Posted: Jun 26 2006, 02:37 PM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
Hi,
I chown to root and chmod 777 for record.sh. I ran the script by hand but nothing is the output. And I already gave the TABs in filters.*.tab. What is the above code which you specified. /var/MailRoot/filters/record.sh "TEST@remotedomain" "USER@LOCALDOMAIN" "FILE_TO_ARCHIVE_LOCATION" "IN" Where do i need to put this lines? Regards, Ajay Rathod. |
| NomadCF |
Posted: Jun 26 2006, 02:45 PM
|
|
Wizard ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 428 Member No.: 434 Joined: 21-January 03 |
no where just try running it from the command line and see if it works.
(don't forget to replace FILE_TO_ARCHIVE_LOCATION with a real file and USER@LOCALDOMAIN with a real localuser and domain) -------------------- |
| aju_rathod |
Posted: Jun 27 2006, 06:03 AM
|
|
Advanced Member ![]() ![]() ![]() ![]() Group: Members Posts: 137 Member No.: 1858 Joined: 17-December 05 |
Hi,
Yes the script is working by hand but where are the mails? The structure of the folder is as follows: /var/MailRoot/archive/IN/letter/username/year/month/date/ /var/MailRoot/archive/OUT/letter/username/year/month/date/ but there are no mails in this directory. Then where does the mails goes? Thanks and Regards, Ajay Rathod. |
| NomadCF |
Posted: Jun 27 2006, 11:41 AM
|
|
Wizard ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 428 Member No.: 434 Joined: 21-January 03 |
So your saying it did create the directory structure but didn't copy mail into it.
Is SELinux turned on,on your machine ? Where there any errors when you tried running it by hand ? are you able to copys files yuor self in any of the "created" directory structure ? -------------------- |