parent
c600aa261c
commit
64f0519f7b
|
@ -42,7 +42,7 @@
|
||||||
+ (SOGoMailer *) mailerWithDomainDefaults: (SOGoDomainDefaults *) dd;
|
+ (SOGoMailer *) mailerWithDomainDefaults: (SOGoDomainDefaults *) dd;
|
||||||
|
|
||||||
- (id) initWithDomainDefaults: (SOGoDomainDefaults *) dd;
|
- (id) initWithDomainDefaults: (SOGoDomainDefaults *) dd;
|
||||||
|
- (BOOL) requiresAuthentication;
|
||||||
- (NSException *) sendMailData: (NSData *) data
|
- (NSException *) sendMailData: (NSData *) data
|
||||||
toRecipients: (NSArray *) recipients
|
toRecipients: (NSArray *) recipients
|
||||||
sender: (NSString *) sender
|
sender: (NSString *) sender
|
||||||
|
|
|
@ -181,6 +181,11 @@
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) requiresAuthentication
|
||||||
|
{
|
||||||
|
return ![mailingMechanism isEqualToString: @"sendmail"] && authenticationType;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSException *) _sendmailSendData: (NSData *) mailData
|
- (NSException *) _sendmailSendData: (NSData *) mailData
|
||||||
toRecipients: (NSArray *) recipients
|
toRecipients: (NSArray *) recipients
|
||||||
sender: (NSString *) sender
|
sender: (NSString *) sender
|
||||||
|
|
|
@ -168,6 +168,13 @@
|
||||||
owner = [SOGoUser userWithLogin: ownerId];
|
owner = [SOGoUser userWithLogin: ownerId];
|
||||||
mailer = [SOGoMailer mailerWithDomainDefaults: [owner domainDefaults]];
|
mailer = [SOGoMailer mailerWithDomainDefaults: [owner domainDefaults]];
|
||||||
|
|
||||||
|
if (!staticAuthenticator && [mailer requiresAuthentication])
|
||||||
|
{
|
||||||
|
fprintf (stderr, "Specify the file containing credentials to use for SMTP AUTH.\n"
|
||||||
|
"Use -h for help.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
localContext = [WOContext context];
|
localContext = [WOContext context];
|
||||||
[localContext setActiveUser: owner];
|
[localContext setActiveUser: owner];
|
||||||
app = [[WOApplication alloc] initWithName: @"SOGo"];
|
app = [[WOApplication alloc] initWithName: @"SOGo"];
|
||||||
|
@ -221,26 +228,28 @@
|
||||||
|
|
||||||
- (BOOL) run
|
- (BOOL) run
|
||||||
{
|
{
|
||||||
|
NSArray *arguments, *alarms;
|
||||||
NSCalendarDate *startDate, *toDate;
|
NSCalendarDate *startDate, *toDate;
|
||||||
SOGoEMailAlarmsManager *eaMgr;
|
|
||||||
NSMutableArray *metadata;
|
|
||||||
iCalEntityObject *entity;
|
|
||||||
SOGoCredentialsFile *cf;
|
|
||||||
NSString *credsFilename;
|
|
||||||
NSDictionary *d;
|
NSDictionary *d;
|
||||||
NSArray *alarms;
|
NSMutableArray *metadata;
|
||||||
|
NSString *credsFilename;
|
||||||
|
SOGoCredentialsFile *cf;
|
||||||
|
SOGoEMailAlarmsManager *eaMgr;
|
||||||
|
iCalEntityObject *entity;
|
||||||
|
|
||||||
int count, max;
|
int count, max;
|
||||||
|
|
||||||
[[SOGoProductLoader productLoader] loadAllProducts: NO];
|
[[SOGoProductLoader productLoader] loadAllProducts: NO];
|
||||||
|
|
||||||
if ([[NSUserDefaults standardUserDefaults] stringForKey: @"h"])
|
arguments = [[NSProcessInfo processInfo] arguments];
|
||||||
|
credsFilename = [[NSUserDefaults standardUserDefaults] stringForKey: @"p"];
|
||||||
|
|
||||||
|
if ([arguments count] > 1 && ([[arguments objectAtIndex: 1] isEqualToString: @"-h"] || !credsFilename))
|
||||||
{
|
{
|
||||||
[self usage];
|
[self usage];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
credsFilename = [[NSUserDefaults standardUserDefaults] stringForKey: @"p"];
|
|
||||||
if (credsFilename)
|
if (credsFilename)
|
||||||
{
|
{
|
||||||
cf = [SOGoCredentialsFile credentialsFromFile: credsFilename];
|
cf = [SOGoCredentialsFile credentialsFromFile: credsFilename];
|
||||||
|
|
Loading…
Reference in New Issue