Current time: 04-19-2024, 08:56 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[UPDATED] Roundcube Fetchmail Plugin v0.2
Author Message
wynni Offline


Posts: 4
Joined: Sep 2010
Reputation: 0
Post: #11
RE: [UPDATED] Roundcube Fetchmail Plugin v0.2
nein das perlskript (cronjob geplant) liest die daten aus mysql aus und schreibt sie in die /etc/fetchmailrc. lösche ich nun einen eintrag in der db holt sich das skript wieder die daten aus der db und überschreibt das file...

Code:
#!/usr/bin/perl
  
   use DBI;
  
   $db_database="roundcubedb";
   $db_username="roundcubeuser";
   $db_password="password";
   $text='#fetchmailrc
   #dieses Fetchmailrd File wird von /var/mail/fetchmail.pl erzeugt.
  
  defaults:
  timeout 300
  antispam -1
  batchlimit 100
  
$dbh = DBI->connect("DBI:mysql:$db_database", $db_username,   $db_password) or die "Database connection error: $DBI::errstr\n";
  
  $sth = $dbh->prepare("SELECT mailget_id,userhere,remoteserver,remoteuser,remotepass,type,options,active FROM virtual_fetchmail WHERE active='y' ORDER BY remoteserver ASC");
  $sth->execute;
  while(my ($mailget_id,$userhere,$remoteserver,$remoteuser,$remotepass,$type,$options,$act​ive) = $sth->fetchrow_array()) {
          $text.="\npoll $remoteserver with proto $type\n";
          if ( $options eq 'n' ) { $keep='keep'; } else { $keep=''; }
          $text.="\tuser \"$remoteuser\" there with password \"$remotepass\" is \"$userhere\" here $keep\n";
  }
  
  $dbh->disconnect();
  open(DA, ">/etc/fetchmailrc") or die "Can't Open File.";
  print DA $text;
  close(DA);

wynni


P.S. bin auf das plugin gespannt....
09-18-2010 03:07 AM
Find all posts by this user Quote this message in a reply
sKaoS Offline


Posts: 1
Joined: Sep 2010
Reputation: 0
Post: #12
RE: [UPDATED] Roundcube Fetchmail Plugin v0.2
Moin, es gibt einen Fehler im script.

Sofern man seine externe Mailserver einträgt mittels Roundcube GUI wird in der Datenbank ein "active = 1" eingetragen. Jedoch schaut fetchmail.pl nach einem "active = y" und somit macht das perl script nichts Wink

Außerdem muss
if ( $options eq 'n' ) { $keep='keep'; } else { $keep=''; }
in
if ( $options eq '0' ) { $keep='keep'; } else { $keep=''; }

geändert werden...
(This post was last modified: 09-19-2010 01:46 AM by sKaoS.)
09-19-2010 01:42 AM
Find all posts by this user Quote this message in a reply
flames Offline
Junior Member
*

Posts: 98
Joined: Oct 2006
Reputation: 3
Post: #13
RE: [UPDATED] Roundcube Fetchmail Plugin v0.2
ups, danke für info, werd gleich mal korrigieren.

edit: korrigierte version angehängt. danke sKaoS.
(This post was last modified: 09-20-2010 12:26 AM by flames.)
09-20-2010 12:08 AM
Find all posts by this user Quote this message in a reply
flames Offline
Junior Member
*

Posts: 98
Joined: Oct 2006
Reputation: 3
Post: #14
RE: [UPDATED] Roundcube Fetchmail Plugin v0.2
so, da ich im an einem anderen wichtigen projekt beschäftigt bin, und nicht weiss was ich wieder zeit habe an diesem plugin zu erbeiten, habe ich es auf github freigegeben. wer mag kann sich damit beschäftigen. ich werde auf jeden fall dran weiter machen sobald mal wieder freizeit da ist. (ich mag git und github deswegen da und nicht wo anders)

here you go: https://github.com/flames/RCFetchmail
(This post was last modified: 01-22-2011 12:35 PM by flames.)
01-22-2011 12:34 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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